PortableSerialLib
v0.2
a portable serial port lib
|
This functions are not related to a specific port object but provide some useful functionality.
Functions | |
int | PSerLib_getAvailablePorts (char *o_names, int i_maxlen) |
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 |
int PSerLib_getAvailablePorts | ( | char * | o_names, |
int | i_maxlen | ||
) |
returns a list with device names of available serial ports
o_names | buffer for output Device names are each separated by a \0 character The last name is terminated by \0\0. Look at details - section for an example how to use the output. |
i_maxlen | length of buffer |
Fiddeling out devices may be done in following fashion:
{.c} char buff[1000]; char* iterator = buff; int n = PSerLib_getAvailablePorts(buff, sizeof(buff)); 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 |