![]() |
botsense
3.2.0
RoadNarrows Client-Server Proxied Services Framework
|
BotSense client library declarations. More...
Go to the source code of this file.
Classes | |
struct | BsClientAppInfo_T |
BotSense client library information and callbacks to application-specific data. More... | |
struct | BsClientConnState_T |
struct | BsVecHandles_T |
struct | BsVConnInfo_T |
Macros | |
#define | BSCLIENT_INFO_STR_MAX_SIZE 256 |
#define | BSCLIENT_LOG_WARN(pClient, ecode, wfmt, ...) |
Log Warning. More... | |
#define | BSCLIENT_LOG_ERROR(pClient, ecode, efmt, ...) |
Log Error. More... | |
#define | BSCLIENT_LOG_NM_ERROR(pClient, nmecode, efmt, ...) |
Log NetMsgs Error. More... | |
#define | BSCLIENT_LOG_SYSERROR(pClient, ecode, efmt, ...) |
Log System Error. More... | |
#define | BSCLIENT_TRY_ECODE(pClient, ecode, efmt, ...) |
Check if BotSense return value is not an error ( < 0). More... | |
#define | BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt, ...) |
Check if NetMsgs (un)packing return value is not an error ( < 0). More... | |
#define | BSCLIENT_TRY_EXPR(pClient, expr, ecode, efmt, ...) |
Check if expression evaluates to true. More... | |
#define | BSCLIENT_IS_VCONN_HANDLE(hnd) |
Test if the handle is in the valid client virtual connection range. More... | |
#define | BSCLIENT_HAS_VCONN(pClient, hnd) (BSCLIENT_IS_VCONN_HANDLE(hnd) && bsClientAttrHasVConn(pClient, hnd)) |
Tests if the handle is valid and there is an established virtual connection. More... | |
Typedefs | |
typedef struct _bsClientStruct * | BsClient_P |
Pointer to client structure forward declaration. | |
Functions | |
const char * | bsStrError (int nECode) |
Get the error string describing the BotSense error code. More... | |
int | bsPackMsgHdr (BsProxyMsgHdr_T *pMsgHdr, byte_t buf[], size_t bufSize) |
Pack BotSense bsProxy message header. More... | |
int | bsUnpackMsgHdr (byte_t buf[], size_t bufSize, BsProxyMsgHdr_T *pMsgHdr) |
Unpack BotSense bsProxy message header. More... | |
void | bsLogBuf (const char *sBufName, byte_t buf[], size_t uCount) |
Log data bytes. More... | |
void | bsLogAsciiBuf (const char *sBufName, byte_t buf[], size_t uCount) |
Log ascii data bytes. More... | |
BsClient_P | bsClientNew (const char *sClientName) |
Create a new unconnected proxied client. More... | |
void | bsClientDelete (BsClient_P pClient) |
Delete a proxied client. More... | |
int | bsClientTrans (BsClient_P pClient, int hndVConn, uint_t uReqMsgId, byte_t bufReq[], size_t uReqBodyLen, uint_t uRspMsgId, byte_t bufRsp[], size_t sizeRspBuf) |
Execute a request - response transaction with the server. More... | |
const char * | bsClientAttrGetName (BsClient_P pClient) |
Get client name. More... | |
void | bsClientAttrGetTimeouts (BsClient_P pClient, uint_t *pReqTimeout, uint_t *pRspTimeout) |
Get client request (write) and response (read) timeouts. More... | |
void | bsClientAttrSetTimeouts (BsClient_P pClient, uint_t uReqTimeout, uint_t uRspTimeout) |
Set client request (write) and response (read) timeouts. More... | |
bool_t | bsClientAttrGetTraceState (BsClient_P pClient, BsVConnHnd_T hndVConn) |
Get client virtual connection trace state. More... | |
int | bsClientAttrGetVConnCount (BsClient_P pClient) |
Get the number of active virtual connections for this client. More... | |
bool_t | bsClientAttrHasVConn (BsClient_P pClient, BsVConnHnd_T hndVConn) |
Test if client has a virtual connection identified by the handle. More... | |
const char * | bsClientAttrGetDevName (BsClient_P pClient, BsVConnHnd_T hndVConn) |
Get client virtual connection device name. More... | |
const char * | bsClientAttrGetModName (BsClient_P pClient, BsVConnHnd_T hndVConn) |
Get client virtual connection interface module name. More... | |
void | bsClientAttrSetLogging (BsClient_P pClient, int nLevel) |
Set client's diagnostics logging threshold. More... | |
void | bsClientAttrGetConnState (BsClient_P pClient, BsClientConnState_T *pConnState) |
Get client's connection state. More... | |
void | bsClientFillMsgHdr (BsClient_P pClient, BsVConnHnd_T hndVConn, uint_t uMsgId, size_t uBodyLen, BsProxyMsgHdr_T *pMsgHdr) |
Fill in message header. More... | |
const char * | bsClientGetMsgName (BsClient_P pClient, BsVConnHnd_T hndVConn, uint_t uMsgId) |
Get the message name. More... | |
void | bsClientLogMsgHdr (BsClient_P pClient, const char *sPreface, BsProxyMsgHdr_T *pMsgHdr) |
Log [pre/un]packed message header. More... | |
int | bsServerConnect (BsClient_P pClient, const char *sServerHostName, int ipPortServer) |
Connect to the bsProxy server. More... | |
int | bsServerDisconnect (BsClient_P pClient) |
Disconnect from the bsProxy server. More... | |
int | bsServerReqGetVersion (BsClient_P pClient, char buf[], size_t sizeBuf) |
Request server to return the server's version string. More... | |
int | bsServerReqLoopback (BsClient_P pClient, char sLoopbackMsg[]) |
Request server to loopback the requested message data. More... | |
int | bsServerReqSetLogging (BsClient_P pClient, int nLogLevel) |
Request server to set the server's logging level. More... | |
int | bsServerReqMsgTrace (BsClient_P pClient, BsVConnHnd_T hndVConn, bool_t bTrace) |
Request server to enable/disable message tracing on a virtual connection. More... | |
int | bsServerReqOpenDev (BsClient_P pClient, const char *sDevName, const char *sModName, byte_t argbuf[], size_t arglen, const BsClientAppInfo_T *pAppInfo, bool_t bTrace) |
Request server to establish a virtual connection to the device end point. More... | |
int | bsServerReqCloseDev (BsClient_P pClient, BsVConnHnd_T hndVConn) |
Request server to close a client's vitual connection. More... | |
int | bsServerReqGetVConnList (BsClient_P pClient, BsVecHandles_T *pVecHandles) |
Request server to retrieve the server's list of virtual connection handles for this client. More... | |
int | bsServerReqGetVConnInfo (BsClient_P pClient, BsVConnHnd_T hndVConn, BsVConnInfo_T *pVConnInfo) |
Request server to retrieve the server's information for a given virtual connection. More... | |
BotSense client library declarations.
Definition in file libBotSense.h.
#define BSCLIENT_HAS_VCONN | ( | pClient, | |
hnd | |||
) | (BSCLIENT_IS_VCONN_HANDLE(hnd) && bsClientAttrHasVConn(pClient, hnd)) |
Tests if the handle is valid and there is an established virtual connection.
pClient |
Definition at line 285 of file libBotSense.h.
Referenced by bsI2CReqRead(), bsI2CReqScan(), bsI2CReqTrans(), bsI2CReqWrite(), bsNullReqWrite(), bsSerialReqRead(), bsSerialReqTrans(), bsSerialReqWrite(), bsServerReqCloseDev(), and bsServerReqGetVConnInfo().
#define BSCLIENT_INFO_STR_MAX_SIZE 256 |
Maximum size (including null) of a virtual connection information string.
Definition at line 132 of file libBotSense.h.
#define BSCLIENT_IS_VCONN_HANDLE | ( | hnd | ) |
Test if the handle is in the valid client virtual connection range.
hnd | Virtual connection handle. |
Definition at line 274 of file libBotSense.h.
Referenced by bsClientAttrHasVConn(), bsGetVConn(), bsVConnAdd(), and bsVConnRemove().
#define BSCLIENT_LOG_ERROR | ( | pClient, | |
ecode, | |||
efmt, | |||
... | |||
) |
Log Error.
pClient |
Definition at line 170 of file libBotSense.h.
Referenced by bsClientRecvRsp(), bsClientTrans(), bsResync(), bsServerReqOpenDev(), bsTransLoadCached(), bsVConnAdd(), bsVConnDelete(), bsVConnNew(), bsVConnRemove(), LtThreadI2C(), LtThreadNull(), and LtThreadSerial().
#define BSCLIENT_LOG_NM_ERROR | ( | pClient, | |
nmecode, | |||
efmt, | |||
... | |||
) |
Log NetMsgs Error.
pClient |
Definition at line 184 of file libBotSense.h.
Referenced by bsServerReqOpenDev().
#define BSCLIENT_LOG_SYSERROR | ( | pClient, | |
ecode, | |||
efmt, | |||
... | |||
) |
Log System Error.
pClient |
Definition at line 196 of file libBotSense.h.
Referenced by bsClientRead(), bsClientWrite(), bsServerConnect(), bsTransLock(), bsTransUnlock(), ClientStartTestThreadI2C(), ClientStartTestThreadNull(), ClientStartTestThreadSerial(), and ClientStartTestThreadServer().
#define BSCLIENT_LOG_WARN | ( | pClient, | |
ecode, | |||
wfmt, | |||
... | |||
) |
Log Warning.
pClient |
Definition at line 156 of file libBotSense.h.
Referenced by bsClientDelete().
#define BSCLIENT_TRY_ECODE | ( | pClient, | |
ecode, | |||
efmt, | |||
... | |||
) |
Check if BotSense return value is not an error ( < 0).
If the check is false, an appropriate error is logged and the calling function is immediately exited by invoking a return with the < 0 error code.
pClient |
Definition at line 214 of file libBotSense.h.
Referenced by bsClientRecvRsp(), bsClientSendReq(), bsClientTrans(), bsI2CReqOpen(), bsI2CReqRead(), bsI2CReqScan(), bsI2CReqTrans(), bsI2CReqWrite(), bsNullReqOpen(), bsNullReqWrite(), bsSerialReqOpen(), bsSerialReqRead(), bsSerialReqTrans(), bsSerialReqWrite(), bsServerReqCloseDev(), bsServerReqGetVConnInfo(), bsServerReqGetVConnList(), bsServerReqGetVersion(), bsServerReqLoopback(), bsServerReqMsgTrace(), and bsServerReqSetLogging().
#define BSCLIENT_TRY_EXPR | ( | pClient, | |
expr, | |||
ecode, | |||
efmt, | |||
... | |||
) |
Check if expression evaluates to true.
If the check is false, an appropriate error is logged and the calling function is immediately exited by invoking a return with the < 0 error code.
pClient |
Definition at line 259 of file libBotSense.h.
Referenced by bsClientPackMsgHdr(), bsClientRecvRsp(), bsClientSendReq(), bsClientTrans(), bsClientUnpackMsgHdr(), bsI2CReqRead(), bsI2CReqScan(), bsI2CReqTrans(), bsI2CReqWrite(), bsNullReqWrite(), bsSerialReqRead(), bsSerialReqTrans(), bsSerialReqWrite(), bsServerReqCloseDev(), bsServerReqGetVConnInfo(), bsServerReqOpenDev(), bsVConnAdd(), bsVConnDelete(), and bsVConnRemove().
#define BSCLIENT_TRY_NM_ECODE | ( | pClient, | |
nmecode, | |||
efmt, | |||
... | |||
) |
Check if NetMsgs (un)packing return value is not an error ( < 0).
If the check is false, an appropriate error is logged and the calling function is immediately exited by invoking a return with the < 0 error code.
pClient |
Definition at line 236 of file libBotSense.h.
Referenced by bsI2CReqRead(), bsI2CReqScan(), bsI2CReqTrans(), bsI2CReqWrite(), bsNullReqWrite(), bsSerialReqOpen(), bsSerialReqRead(), bsSerialReqTrans(), bsSerialReqWrite(), bsServerReqCloseDev(), bsServerReqGetVConnInfo(), bsServerReqGetVConnList(), bsServerReqGetVersion(), bsServerReqLoopback(), bsServerReqMsgTrace(), and bsServerReqSetLogging().
void bsClientAttrGetConnState | ( | BsClient_P | pClient, |
BsClientConnState_T * | pConnState | ||
) |
Get client's connection state.
pClient |
Definition at line 1120 of file bsLibClient.c.
References BsClientConnState_T::m_bIsConnected, _bsClientStruct::m_pSocket, and BsClientConnState_T::m_sServerHostName.
const char* bsClientAttrGetDevName | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn | ||
) |
Get client virtual connection device name.
pClient |
Definition at line 1054 of file bsLibClient.c.
References bsClientAttrHasVConn(), BSPROXY_VCONN_SERVER, BsVConn_T::m_sDevName, and _bsClientStruct::m_tblVConn.
const char* bsClientAttrGetModName | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn | ||
) |
Get client virtual connection interface module name.
pClient |
Definition at line 1083 of file bsLibClient.c.
References bsClientAttrHasVConn(), BSPROXY_VCONN_SERVER, BsVConn_T::m_sModName, and _bsClientStruct::m_tblVConn.
const char* bsClientAttrGetName | ( | BsClient_P | pClient | ) |
Get client name.
pClient |
Definition at line 918 of file bsLibClient.c.
References _bsClientStruct::m_sClientName.
Referenced by bsTransCacheRsp(), and bsTransLoadCached().
void bsClientAttrGetTimeouts | ( | BsClient_P | pClient, |
uint_t * | pReqTimeout, | ||
uint_t * | pRspTimeout | ||
) |
Get client request (write) and response (read) timeouts.
pClient |
Definition at line 930 of file bsLibClient.c.
References _bsClientStruct::m_uReqTimeout, and _bsClientStruct::m_uRspTimeout.
bool_t bsClientAttrGetTraceState | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn | ||
) |
Get client virtual connection trace state.
pClient |
Definition at line 970 of file bsLibClient.c.
References bsClientAttrHasVConn(), bsGetVConn(), BSPROXY_VCONN_SERVER, BsVConn_T::m_bTrace, and _bsClientStruct::m_bTraceServer.
int bsClientAttrGetVConnCount | ( | BsClient_P | pClient | ) |
Get the number of active virtual connections for this client.
pClient |
Definition at line 998 of file bsLibClient.c.
References _bsClientStruct::m_nVConnCount.
Referenced by bsVConnNew().
bool_t bsClientAttrHasVConn | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn | ||
) |
Test if client has a virtual connection identified by the handle.
pClient |
Definition at line 1019 of file bsLibClient.c.
References BSCLIENT_IS_VCONN_HANDLE, BSPROXY_VCONN_UNDEF, _bsClientStruct::m_tblHndIndex, and _bsClientStruct::m_tblVConn.
Referenced by bsClientAttrGetDevName(), bsClientAttrGetModName(), bsClientAttrGetTraceState(), and bsClientGetMsgName().
void bsClientAttrSetLogging | ( | BsClient_P | pClient, |
int | nLevel | ||
) |
Set client's diagnostics logging threshold.
pClient |
Definition at line 1109 of file bsLibClient.c.
void bsClientAttrSetTimeouts | ( | BsClient_P | pClient, |
uint_t | uReqTimeout, | ||
uint_t | uRspTimeout | ||
) |
Set client request (write) and response (read) timeouts.
A timeout value of 0 means block forever until i/o operation is complete.
pClient |
Definition at line 950 of file bsLibClient.c.
References _bsClientStruct::m_uReqTimeout, and _bsClientStruct::m_uRspTimeout.
void bsClientDelete | ( | BsClient_P | pClient | ) |
Delete a proxied client.
pClient |
Definition at line 1438 of file bsLibClient.c.
References BS_ECODE_GEN, BSCLIENT_LOG_WARN, bsTransForget(), bsVConnClearAll(), _bsClientStruct::m_mutexTrans, _bsClientStruct::m_pSocket, _bsClientStruct::m_sClientName, and _bsClientStruct::m_tblTransCache.
void bsClientFillMsgHdr | ( | BsClient_P | pClient, |
int | hndVConn, | ||
uint_t | uMsgId, | ||
size_t | uBodyLen, | ||
BsProxyMsgHdr_T * | pMsgHdr | ||
) |
Fill in message header.
pClient |
Definition at line 1148 of file bsLibClient.c.
References bsNextTid(), BSPROXY_MSG_MAGIC, BsProxyMsgHdr_T::m_hdrBodyLen, BsProxyMsgHdr_T::m_hdrMagic, BsProxyMsgHdr_T::m_hdrMsgId, BsProxyMsgHdr_T::m_hdrTid, and BsProxyMsgHdr_T::m_hdrVConn.
Referenced by bsClientTrans().
const char* bsClientGetMsgName | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
uint_t | uMsgId | ||
) |
Get the 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 1175 of file bsLibClient.c.
References bsClientAttrHasVConn(), bsGetVConn(), BSPROXY_VCONN_SERVER, BsProxyLookupMsgDef(), BsClientAppInfo_T::fnGetMsgName, and BsVConn_T::m_pAppInfo.
Referenced by bsClientLogMsgHdr().
void bsClientLogMsgHdr | ( | BsClient_P | pClient, |
const char * | sPreface, | ||
BsProxyMsgHdr_T * | pMsgHdr | ||
) |
Log [pre/un]packed message header.
pClient |
Definition at line 1219 of file bsLibClient.c.
References bsClientGetMsgName(), BsProxyMsgHdr_T::m_hdrBodyLen, BsProxyMsgHdr_T::m_hdrMagic, BsProxyMsgHdr_T::m_hdrMsgId, BsProxyMsgHdr_T::m_hdrTid, and BsProxyMsgHdr_T::m_hdrVConn.
BsClient_P bsClientNew | ( | const char * | sClientName | ) |
Create a new unconnected proxied client.
sClientName | Proxied client (robot)'s name. |
Definition at line 1396 of file bsLibClient.c.
References BSCLIENT_T_READ, BSCLIENT_T_WRITE, BSPROXY_VCONN_UNDEF, _bsClientStruct::m_bTraceServer, _bsClientStruct::m_mutexTrans, _bsClientStruct::m_nVConnCount, _bsClientStruct::m_pSocket, _bsClientStruct::m_sClientName, _bsClientStruct::m_tblHndIndex, _bsClientStruct::m_tblTransCache, _bsClientStruct::m_tblVConn, _bsClientStruct::m_uReqTimeout, _bsClientStruct::m_uRspTimeout, and _bsClientStruct::m_uTidCounter.
int bsClientTrans | ( | BsClient_P | pClient, |
int | hndVConn, | ||
uint_t | uReqMsgId, | ||
byte_t | bufReq[], | ||
size_t | uReqBodyLen, | ||
uint_t | uRspMsgId, | ||
byte_t | bufRsp[], | ||
size_t | sizeRspBuf | ||
) |
Execute a request - response transaction with the server.
pClient |
Definition at line 1279 of file bsLibClient.c.
References _BS_LOG_REQ, _BS_LOG_RSP, BS_ECODE_MSG_BAD_HDR, BSCLIENT_LOG_ERROR, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, bsClientFillMsgHdr(), bsClientRecvRsp(), bsClientSendReq(), BSPROXY_MSG_HDR_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdRspErr, BsProxyUnpackRspErr(), bsTransCacheRsp(), bsTransForget(), bsTransLoadCached(), bsTransMark(), BsProxyRspErr_T::m_ecode, BsProxyRspErr_T::m_emsg, BsProxyMsgHdr_T::m_hdrBodyLen, BsProxyMsgHdr_T::m_hdrMsgId, BsProxyMsgHdr_T::m_hdrTid, and BsProxyMsgHdr_T::m_hdrVConn.
void bsLogAsciiBuf | ( | const char * | sBufName, |
byte_t | buf[], | ||
size_t | uCount | ||
) |
Log ascii data bytes.
Print diagnostic logging of the contents of a buffer of ASCII bytes.
sBufName | Name of buffer. |
buf | Buffer. |
uCount | Number of bytes to log. |
Definition at line 175 of file bsLibUtils.c.
void bsLogBuf | ( | const char * | sBufName, |
byte_t | buf[], | ||
size_t | uCount | ||
) |
Log data bytes.
Print diagnostic logging of the contents of a buffer of bytes.
sBufName | Name of buffer. |
buf | Buffer. |
uCount | Number of bytes to log. |
Definition at line 145 of file bsLibUtils.c.
int bsPackMsgHdr | ( | BsProxyMsgHdr_T * | pMsgHdr, |
byte_t | buf[], | ||
size_t | bufSize | ||
) |
Pack BotSense bsProxy message header.
[in] | pMsgHdr | Pointer to message header structure. |
[out] | buf | Output message buffer. |
bufSize | Size of output buffer. |
On error, the appropriate < 0 negated BotSense Error Code is returned.
Definition at line 85 of file bsLibUtils.c.
References BS_ECODE_INTERNAL, BSPROXY_MSG_HDR_LEN, BsProxyMsgHdr_T::m_hdrBodyLen, BsProxyMsgHdr_T::m_hdrMagic, BsProxyMsgHdr_T::m_hdrMsgId, BsProxyMsgHdr_T::m_hdrTid, and BsProxyMsgHdr_T::m_hdrVConn.
int bsServerConnect | ( | BsClient_P | pClient, |
const char * | sServerHostName, | ||
int | ipServerPort | ||
) |
Connect to the bsProxy server.
pClient |
Definition at line 167 of file bsLibServer.c.
References BS_ECODE_SERVER_CONN_FAIL, BS_OK, BSCLIENT_LOG_SYSERROR, bsServerDisconnect(), _bsClientStruct::m_pSocket, and _bsClientStruct::m_sClientName.
int bsServerDisconnect | ( | BsClient_P | pClient | ) |
Disconnect from the bsProxy server.
pClient |
Definition at line 207 of file bsLibServer.c.
References BS_OK, bsVConnClearAll(), _bsClientStruct::m_pSocket, and _bsClientStruct::m_sClientName.
Referenced by bsServerConnect().
int bsServerReqCloseDev | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn | ||
) |
Request server to close a client's vitual connection.
pClient |
Definition at line 597 of file bsLibServer.c.
References BS_ECODE_BAD_VAL, BS_OK, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqDevClose, BsProxyMsgIdRspOk, BsProxyPackReqDevClose(), bsVConnDelete(), bsVConnRemove(), _bsClientStruct::m_sClientName, and BsProxyReqDevClose_T::m_vconn.
int bsServerReqGetVConnInfo | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
BsVConnInfo_T * | pVConnInfo | ||
) |
Request server to retrieve the server's information for a given virtual connection.
pClient |
Definition at line 735 of file bsLibServer.c.
References BS_ECODE_BAD_VAL, BS_OK, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqGetVConnInfo, BsProxyMsgIdRspGetVConnInfo, BsProxyPackReqGetVConnInfo(), BsProxyUnpackRspGetVConnInfo(), BsVConnInfo_T::m_client, BsProxyRspGetVConnInfo_T::m_client, BsVConnInfo_T::m_devuri, BsProxyRspGetVConnInfo_T::m_devuri, BsVConnInfo_T::m_moddate, BsProxyRspGetVConnInfo_T::m_moddate, BsVConnInfo_T::m_moduri, BsProxyRspGetVConnInfo_T::m_moduri, BsVConnInfo_T::m_modver, BsProxyRspGetVConnInfo_T::m_modver, BsVConnInfo_T::m_rd, BsProxyRspGetVConnInfo_T::m_rd, BsVConnInfo_T::m_vconn, BsProxyReqGetVConnInfo_T::m_vconn, and BsProxyRspGetVConnInfo_T::m_vconn.
int bsServerReqGetVConnList | ( | BsClient_P | pClient, |
BsVecHandles_T * | pVecHandles | ||
) |
Request server to retrieve the server's list of virtual connection handles for this client.
pClient |
Definition at line 672 of file bsLibServer.c.
References BS_OK, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_NM_ECODE, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_CLIENT_MAX, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqGetVConnList, BsProxyMsgIdRspGetVConnList, BsProxyUnpackRspGetVConnList(), BsProxyRspGetVConnList_T::m_count, BsVecHandles_T::m_uCount, BsProxyRspGetVConnList_T::m_vconn, BsVecHandles_T::m_vecHnd, and BsProxyRspGetVConnList_T::u.
int bsServerReqGetVersion | ( | BsClient_P | pClient, |
char | bufVer[], | ||
size_t | bufSize | ||
) |
Request server to return the server's version string.
pClient |
Definition at line 354 of file bsLibServer.c.
References BS_OK, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_NM_ECODE, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqGetVersion, BsProxyMsgIdRspGetVersion, BsProxyUnpackRspGetVersion(), and BsProxyRspGetVersion_T::m_version.
int bsServerReqLoopback | ( | BsClient_P | pClient, |
char | sLoopbackMsg[] | ||
) |
Request server to loopback the requested message data.
pClient |
Definition at line 230 of file bsLibServer.c.
References BS_OK, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqLoopback, BsProxyMsgIdRspLoopback, BsProxyPackReqLoopback(), BsProxyUnpackRspLoopback(), BsProxyReqLoopback_T::m_cdata, and BsProxyRspLoopback_T::m_cdata.
int bsServerReqMsgTrace | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
bool_t | bNewTrace | ||
) |
Request server to enable/disable message tracing on a virtual connection.
pClient |
Definition at line 411 of file bsLibServer.c.
References BS_OK, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqMsgTrace, BsProxyMsgIdRspOk, BsProxyPackReqMsgTrace(), BsProxyReqMsgTrace_T::m_trace, and BsProxyReqMsgTrace_T::m_vconn.
int bsServerReqOpenDev | ( | BsClient_P | pClient, |
const char * | sDevName, | ||
const char * | sModName, | ||
byte_t | argbuf[], | ||
size_t | arglen, | ||
const BsClientAppInfo_T * | pAppInfo, | ||
bool_t | bInitTrace | ||
) |
Request server to establish a virtual connection to the device end point.
The device is open if not already opened by another virtual connection. Otherwise it is attached to this vconn.
The interface module is dynamically loaded into the server and provides the set of services for the client application communicating with the device.
pClient |
Definition at line 485 of file bsLibServer.c.
References _BS_LOG_VCONN_OPEN, BS_ECODE_BAD_MSG, BS_ECODE_BAD_VAL, BSCLIENT_LOG_ERROR, BSCLIENT_LOG_NM_ERROR, BSCLIENT_TRY_EXPR, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSPROXY_REQDEVOPEN_ARGBUF_LEN, BSPROXY_REQDEVOPEN_DEVNAME_LEN, BSPROXY_REQDEVOPEN_MODNAME_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqDevOpen, BsProxyMsgIdRspDevOpen, BsProxyPackReqDevOpen(), BsProxyUnpackRspDevOpen(), bsVConnAdd(), bsVConnDelete(), bsVConnNew(), BsProxyReqDevOpen_T::m_argbuf, BsProxyReqDevOpen_T::m_count, BsProxyReqDevOpen_T::m_devname, BsProxyReqDevOpen_T::m_modname, BsProxyReqDevOpen_T::m_trace, BsProxyRspDevOpen_T::m_vconn, and BsProxyReqDevOpen_T::u.
int bsServerReqSetLogging | ( | BsClient_P | pClient, |
int | nLogLevel | ||
) |
Request server to set the server's logging level.
pClient |
Definition at line 298 of file bsLibServer.c.
References BS_OK, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_NM_ECODE, BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BSPROXY_VCONN_SERVER, BsProxyMsgIdReqSetLogging, BsProxyMsgIdRspOk, BsProxyPackReqSetLogging(), and BsProxyReqSetLogging_T::m_level.
const char* bsStrError | ( | int | ecode | ) |
Get the error string describing the BotSense error code.
The absolute value of the error code is taken prior retrieving the string. An unknown or out-of-range error code will be mapped to BS_ECODE_BADEC.
ecode |
Definition at line 122 of file bsLibError.c.
References BS_ECODE_BADEC, and bsEcodeStrTbl.
int bsUnpackMsgHdr | ( | byte_t | buf[], |
size_t | bufSize, | ||
BsProxyMsgHdr_T * | pMsgHdr | ||
) |
Unpack BotSense bsProxy message header.
[in] | buf | Input message buffer. |
bufSize | Size of input buffer. | |
[out] | pMsgHdr | Pointer to message header structure. |
On error, the appropriate < 0 negated BotSense Error Code is returned.
Definition at line 115 of file bsLibUtils.c.
References BS_ECODE_INTERNAL, BSPROXY_MSG_HDR_LEN, BsProxyMsgHdr_T::m_hdrBodyLen, BsProxyMsgHdr_T::m_hdrMagic, BsProxyMsgHdr_T::m_hdrMsgId, BsProxyMsgHdr_T::m_hdrTid, and BsProxyMsgHdr_T::m_hdrVConn.