PortableSerialLib  v0.4
a portable serial port lib
Functions
Serial Port Handling Functions

This functions provide the functionality that is required to setup and configure a port.

Functions

PSL_ErrorCodes_e PSerLib_close (PSerLibHandle_t *io_portH)
 closes and deinitializes the port
PSL_ErrorCodes_e PSerLib_open (const char *i_portName, PSerLibHandle_t *o_handle)
 tries to open the specified serial port
PSL_ErrorCodes_e PSerLib_setParams (PSerLibHandle_t io_port, PSL_Baudrates_e i_baudrate, PSL_NumDataBits_e i_bits, PSL_Parity_e i_parity, PSL_StopBits_e i_stopbits, PSL_FlowControl_e i_flowControl)
 sets the port to the given configuration
PSL_ErrorCodes_e PSerLib_setTimeOuts (PSerLibHandle_t io_port)

Function Documentation

closes and deinitializes the port

Parameters:
io_portHpointer to port handle to close. The handle will be invalidated.
Returns:
PSL_ERROR_none if successful else another error code
PSL_ErrorCodes_e PSerLib_open ( const char *  i_portName,
PSerLibHandle_t o_handle 
)

tries to open the specified serial port

Parameters:
i_portNamename of the port to open
These names are indeed some kind of platform specific - sorry. But you may get a list of possible ports from
See also:
PSerLib_getAvailablePorts.
Parameters:
o_handlepointer to a handle variable that receives the handle to the opened port on success or PSL_NOPORT_HANDLE if opening failed
Returns:
PSL_ERROR_none if successful else another error code
PSL_ErrorCodes_e PSerLib_setParams ( PSerLibHandle_t  io_port,
PSL_Baudrates_e  i_baudrate,
PSL_NumDataBits_e  i_bits,
PSL_Parity_e  i_parity,
PSL_StopBits_e  i_stopbits,
PSL_FlowControl_e  i_flowControl 
)

sets the port to the given configuration

Attention:
currently not all baud rates are supported on linux (have to figure out how to set custom baud rates that are not defined in termios)
Todo:
support all enumerated and custom baud rates
Parameters:
io_porthandle of port to be configured
i_baudratebaudrate if argument is less than PSL_BR_CONSTANTS_COUNT it is interpreted as one of the enumerated constants. If it is larger it is interpreted as baudrate.
i_bitsnumber of data bits
i_parityparity
i_stopbitsnumber of stopbits
i_flowControlflow control to use
Returns:
PSL_ERROR_none if successful else another error code
Todo:
specify