Go to the source code of this file.
Functions | |
uint32 | sbgGetWindowsErrorMsg (char outErrorMsg[256]) |
SbgErrorCode | sbgInterfaceSerialChangeBaudrate (SbgInterface *pHandle, uint32 baudRate) |
SbgErrorCode | sbgInterfaceSerialCreate (SbgInterface *pHandle, const char *deviceName, uint32 baudRate) |
SbgErrorCode | sbgInterfaceSerialDestroy (SbgInterface *pHandle) |
SbgErrorCode | sbgInterfaceSerialFlush (SbgInterface *pHandle) |
SbgErrorCode | sbgInterfaceSerialRead (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead) |
SbgErrorCode | sbgInterfaceSerialWrite (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite) |
uint32 sbgGetWindowsErrorMsg | ( | char | outErrorMsg[256] | ) |
Returns the last error message for windows api calls.
[out] | outErrorMsg | Pointer on an allocated string that can stores the windows error message. |
Definition at line 13 of file sbgInterfaceSerialWin.c.
SbgErrorCode sbgInterfaceSerialChangeBaudrate | ( | SbgInterface * | pHandle, |
uint32 | baudRate | ||
) |
Change the serial interface baud rate immediatly.
[in] | handle | Valid handle on an initialized interface. |
[in] | baudRate | The new baudrate to apply in bps. |
Definition at line 293 of file sbgInterfaceSerialWin.c.
SbgErrorCode sbgInterfaceSerialCreate | ( | SbgInterface * | pHandle, |
const char * | deviceName, | ||
uint32 | baudRate | ||
) |
Initialize a serial interface for read and write operations.
[in] | pHandle | Pointer on an allocated interface instance to initialize. |
[in] | deviceName | Serial interface location (COM21 , /dev/ttys0, depending on platform). |
[in] | baudRate | Serial interface baud rate in bps. |
Definition at line 59 of file sbgInterfaceSerialWin.c.
SbgErrorCode sbgInterfaceSerialDestroy | ( | SbgInterface * | pHandle | ) |
Destroy an interface initialized using sbgInterfaceSerialCreate.
[in] | pInterface | Valid handle on an initialized interface. |
Definition at line 205 of file sbgInterfaceSerialWin.c.
SbgErrorCode sbgInterfaceSerialFlush | ( | SbgInterface * | pHandle | ) |
Flush the RX and TX buffers (remove all old data)
[in] | handle | Valid handle on an initialized interface. |
Definition at line 233 of file sbgInterfaceSerialWin.c.
SbgErrorCode sbgInterfaceSerialRead | ( | SbgInterface * | pHandle, |
void * | pBuffer, | ||
size_t * | pReadBytes, | ||
size_t | bytesToRead | ||
) |
Try to read some data from an interface.
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that can hold at least bytesToRead bytes of data. |
[out] | pReadBytes | Pointer on an uint32 used to return the number of read bytes. |
[in] | bytesToRead | Number of bytes we would like to read. |
Definition at line 416 of file sbgInterfaceSerialWin.c.
SbgErrorCode sbgInterfaceSerialWrite | ( | SbgInterface * | pHandle, |
const void * | pBuffer, | ||
size_t | bytesToWrite | ||
) |
Try to write some data to an interface.
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that contains the data to write |
[in] | bytesToWrite | Number of bytes we would like to write. |
Definition at line 361 of file sbgInterfaceSerialWin.c.