PortableSerialLib
v0.4
a portable serial port lib
|
This functions are not related to a specific port object but provide some useful functionality.
Functions | |
PSL_ErrorCodes_e | PSerLib_getAvailablePorts (char *o_names, int i_maxlen, int *o_numPortsFound) |
returns a list with device names of available serial ports | |
const char * | PSerLib_getErrorMessage (PSL_ErrorCodes_e i_errorCode) |
translates an error code in something printable |
PSL_ErrorCodes_e PSerLib_getAvailablePorts | ( | char * | o_names, |
int | i_maxlen, | ||
int * | o_numPortsFound | ||
) |
returns a list with device names of available serial ports
o_names | buffer for output Each device name is quit a \0 character. An empty name indicates the end of the list. Look at details - section for an example how to use the output. |
i_maxlen | length of buffer |
o_numPortsFound | pointer to variable that receives the number of ports found |
Fiddeling out devices may be done in following fashion:
{.c} char buff[1000]; char* iterator = buff; int n; PSerLib_getAvailablePorts(buff, sizeof(buff), &n); printf("found %i devices:\n", n); for( ;*iterator; iterator+=strlen(iterator)+1 ) { printf("%s\n",iterator); }
const char* PSerLib_getErrorMessage | ( | PSL_ErrorCodes_e | i_errorCode | ) |
translates an error code in something printable
i_errorCode | the error code to translate |