![]() |
botsense
3.2.0
RoadNarrows Client-Server Proxied Services Framework
|
BotSense bsProxy client library RS-232 serial interface. More...
Go to the source code of this file.
Macros | |
| #define | BS_SER_DEV_NAME_DFT "/dev/ttyS0" |
| default serial device | |
| #define | BS_SER_SERVER_MOD "libbsserver_serial" |
| server plugin dll module | |
| #define | BS_SER_CLIENT_LIB "libbsclient_serial" |
| client app library | |
Functions | |
| const char * | bsSerialGetMsgName (BsClient_P pClient, BsVConnHnd_T hndVConn, uint_t uMsgId) |
| Get the serial message name. More... | |
| int | bsSerialReqOpen (BsClient_P pClient, const char *sDevName, int nBaudRate, int nByteSize, int cParity, int nStopBits, bool_t bRtsCts, bool_t bXonXoff, bool_t bInitTrace) |
| Request proxy server to establish a virtual connection to an RS-232 serial device. More... | |
| int | bsSerialReqClose (BsClient_P pClient, BsVConnHnd_T hndVConn) |
| Request proxy server to close client's proxied serial device vitual connection. More... | |
| int | bsSerialReqRead (BsClient_P pClient, BsVConnHnd_T hndVConn, size_t uReadLen, byte_t rbuf[]) |
| Proxied request to read from an RS-232 serial device. More... | |
| int | bsSerialReqWrite (BsClient_P pClient, BsVConnHnd_T hndVConn, byte_t wbuf[], size_t uWriteLen) |
| Proxied request to write to a RS-232 serial device. More... | |
| int | bsSerialReqTrans (BsClient_P pClient, BsVConnHnd_T hndVConn, byte_t wbuf[], size_t uWriteLen, size_t uReadLen, byte_t rbuf[]) |
| Proxied request to execute a write-read transaction on a RS-232 serial device. More... | |
BotSense bsProxy client library RS-232 serial interface.
Add bsSerialReqFlushInput() function.
Add bsSerialReqIoctl() function.
Add bsSerialReqReadLine() function.
Add bsSerialReqWriteLine() function.
Definition in file bsSerial.h.
| const char* bsSerialGetMsgName | ( | BsClient_P | pClient, |
| BsVConnHnd_T | hndVConn, | ||
| uint_t | uMsgId | ||
| ) |
Get the serial message name.
For each (virtual connection, message id) 2-tuple, there can be a known name string (provided the id is valid and an application provides the information).
| pClient |
Definition at line 102 of file bsSerialClient.c.
References BsSerialLookupMsgDef().
| int bsSerialReqClose | ( | BsClient_P | pClient, |
| BsVConnHnd_T | hndVConn | ||
| ) |
Request proxy server to close client's proxied serial device vitual connection.
| pClient |
Definition at line 193 of file bsSerialClient.c.
| int bsSerialReqOpen | ( | BsClient_P | pClient, |
| const char * | sDevName, | ||
| int | nBaudRate, | ||
| int | nByteSize, | ||
| int | cParity, | ||
| int | nStopBits, | ||
| bool_t | bRtsCts, | ||
| bool_t | bXonXoff, | ||
| bool_t | bInitTrace | ||
| ) |
Request proxy server to establish a virtual connection to an RS-232 serial device.
| pClient |
Definition at line 131 of file bsSerialClient.c.
References BS_SER_SERVER_MOD, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_NM_ECODE, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_SERVER, BsSerialMsgIdReqOpenArgs, BsSerialPackReqOpenArgs(), BsSerialReqOpenArgs_T::m_baudrate, BsSerialReqOpenArgs_T::m_bytesize, BsSerialReqOpenArgs_T::m_parity, BsSerialReqOpenArgs_T::m_rtscts, BsSerialReqOpenArgs_T::m_stopbits, and BsSerialReqOpenArgs_T::m_xonxoff.
| int bsSerialReqRead | ( | BsClient_P | pClient, |
| BsVConnHnd_T | hndVConn, | ||
| size_t | uReadLen, | ||
| byte_t | rbuf[] | ||
| ) |
Proxied request to read from an RS-232 serial device.
| pClient |
Definition at line 210 of file bsSerialClient.c.
References BS_ECODE_BAD_VAL, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSSERIAL_RSPREAD_READBUF_LEN, BsSerialMsgIdReqRead, BsSerialMsgIdRspRead, BsSerialPackReqRead(), BsSerialUnpackRspRead(), BsSerialRspRead_T::m_count, BsSerialRspRead_T::m_readbuf, BsSerialReqRead_T::m_readlen, and BsSerialRspRead_T::u.
| int bsSerialReqTrans | ( | BsClient_P | pClient, |
| BsVConnHnd_T | hndVConn, | ||
| byte_t | wbuf[], | ||
| size_t | uWriteLen, | ||
| size_t | uReadLen, | ||
| byte_t | rbuf[] | ||
| ) |
Proxied request to execute a write-read transaction on a RS-232 serial device.
| pClient |
Definition at line 373 of file bsSerialClient.c.
References BS_ECODE_BAD_VAL, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSSERIAL_REQTRANS_WRITEBUF_LEN, BSSERIAL_RSPREAD_READBUF_LEN, BsSerialMsgIdReqTrans, BsSerialMsgIdRspRead, BsSerialPackReqTrans(), BsSerialUnpackRspRead(), BsSerialReqTrans_T::m_count, BsSerialRspRead_T::m_count, BsSerialRspRead_T::m_readbuf, BsSerialReqTrans_T::m_readlen, BsSerialReqTrans_T::m_writebuf, BsSerialReqTrans_T::u, and BsSerialRspRead_T::u.
| int bsSerialReqWrite | ( | BsClient_P | pClient, |
| BsVConnHnd_T | hndVConn, | ||
| byte_t | wbuf[], | ||
| size_t | uWriteLen | ||
| ) |
Proxied request to write to a RS-232 serial device.
| pClient |
Definition at line 292 of file bsSerialClient.c.
References BS_ECODE_BAD_VAL, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSSERIAL_REQWRITE_WRITEBUF_LEN, BsSerialMsgIdReqWrite, BsSerialMsgIdRspWrite, BsSerialPackReqWrite(), BsSerialUnpackRspWrite(), BsSerialRspWrite_T::m_byteswritten, BsSerialReqWrite_T::m_count, BsSerialReqWrite_T::m_writebuf, and BsSerialReqWrite_T::u.