botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
bsLibServer.c File Reference

Server-Client connection, control, and information functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <libgen.h>
#include <string.h>
#include "rnr/rnrconfig.h"
#include "rnr/sock.h"
#include "rnr/new.h"
#include "rnr/log.h"
#include "botsense/BotSense.h"
#include "botsense/libBotSense.h"
#include "botsense/bsProxyMsgs.h"
#include "bsLibInternal.h"

Go to the source code of this file.

Macros

#define _BS_LOG_VCONN_OPEN(pClient, index)
 Log virtual connection open event. More...
 

Functions

static void bsLogVConnOpenEvent (BsClient_T *pClient, int index)
 Log virtual connection open event. More...
 
int bsServerConnect (BsClient_P pClient, const char *sServerHostName, int ipServerPort)
 Connect to the bsProxy server. More...
 
int bsServerDisconnect (BsClient_P pClient)
 Disconnect from the bsProxy server. 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 bsServerReqGetVersion (BsClient_P pClient, char bufVer[], size_t bufSize)
 Request server to return the server's version string. More...
 
int bsServerReqMsgTrace (BsClient_P pClient, BsVConnHnd_T hndVConn, bool_t bNewTrace)
 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 bInitTrace)
 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...
 

Detailed Description

Server-Client connection, control, and information functions.

LastChangedDate
2010-08-20 11:36:38 -0600 (Fri, 20 Aug 2010)
Rev
568
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)

Definition in file bsLibServer.c.

Macro Definition Documentation

#define _BS_LOG_VCONN_OPEN (   pClient,
  index 
)
Value:
do \
{ \
if( LOGABLE(LOG_LEVEL_DIAG2) ) \
{ \
bsLogVConnOpenEvent(pClient, index); \
} \
} while(0)
static void bsLogVConnOpenEvent(BsClient_T *pClient, int index)
Log virtual connection open event.
Definition: bsLibServer.c:91

Log virtual connection open event.

Parameters
pClient

Definition at line 76 of file bsLibServer.c.

Referenced by bsServerReqOpenDev().

Function Documentation

static void bsLogVConnOpenEvent ( BsClient_T pClient,
int  index 
)
static

Log virtual connection open event.

Parameters
pClient

Definition at line 91 of file bsLibServer.c.

References BsClientAppInfo_T::app_name, BsClientAppInfo_T::brief, BsClientAppInfo_T::date, BsVConn_T::m_hndVConn, BsVConn_T::m_pAppInfo, _bsClientStruct::m_sClientName, BsVConn_T::m_sDevName, BsVConn_T::m_sModName, _bsClientStruct::m_tblVConn, BsClientAppInfo_T::maintainer, and BsClientAppInfo_T::version.

92 {
93  FILE *fp;
94  BsVConn_T *pVConn;
95  const BsClientAppInfo_T *pAppInfo;
96 
97  fp = LOG_GET_LOGFP();
98  pVConn = pClient->m_tblVConn[index];
99 
100  if( pVConn == NULL )
101  {
102  fprintf(fp, "%s: internal data corruption.\n", pClient->m_sClientName);
103  return;
104  }
105 
106  pAppInfo = pVConn->m_pAppInfo;
107 
108  fprintf(fp, "%s: Opened Virtual Connection\n", pClient->m_sClientName);
109  fprintf(fp, "{\n");
110  fprintf(fp, " VConn: %d\n", pVConn->m_hndVConn);
111  fprintf(fp, " Device: %s\n", pVConn->m_sDevName);
112  fprintf(fp, " I/F Module: %s\n", pVConn->m_sModName);
113  if( pAppInfo != NULL )
114  {
115  fprintf(fp, " Application = {\n");
116  if( pAppInfo->app_name != NULL )
117  {
118  fprintf(fp, " Name: %s\n", pAppInfo->app_name);
119  }
120  if( pAppInfo->brief != NULL )
121  {
122  fprintf(fp, " Brief: %s\n", pAppInfo->brief);
123  }
124  if( pAppInfo->version != NULL )
125  {
126  fprintf(fp, " Version: %s\n", pAppInfo->version);
127  }
128  if( pAppInfo->date != NULL )
129  {
130  fprintf(fp, " Date: %s\n", pAppInfo->date);
131  }
132  if( pAppInfo->maintainer != NULL )
133  {
134  fprintf(fp, " Maintainer: %s\n", pAppInfo->maintainer);
135  }
136  fprintf(fp, " }\n");
137  }
138  fprintf(fp, "}\n");
139 }
BsVConnHnd_T m_hndVConn
virtual connection handle
Definition: bsLibInternal.h:86
const BsClientAppInfo_T * m_pAppInfo
app-specific info (optional)
Definition: bsLibInternal.h:90
BsVConn_T * m_tblVConn[BSPROXY_VCONN_CLIENT_MAX]
table of virtual connections
const char * m_sModName
interface module path name
Definition: bsLibInternal.h:89
Client Virtual Connection Info Structure.
Definition: bsLibInternal.h:84
const char * brief
brief one-line description
Definition: libBotSense.h:89
const char * date
version date
Definition: libBotSense.h:91
const char * maintainer
maintainer/owner
Definition: libBotSense.h:92
const char * version
dotted version x.y.z[-app]
Definition: libBotSense.h:90
const char * m_sDevName
device path name
Definition: bsLibInternal.h:88
<b><i>BotSense</i></b> client library information and callbacks to application-specific data...
Definition: libBotSense.h:86
const char * m_sClientName
client name
Definition: bsLibInternal.h:98
const char * app_name
application name
Definition: libBotSense.h:88
int bsServerConnect ( BsClient_P  pClient,
const char *  sServerHostName,
int  ipServerPort 
)

Connect to the bsProxy server.

Parameters
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.

170 {
171  Socket_T *pSocket;
172 
173  // close socket if already opened
174  if( SocketStateIsOpen(pClient->m_pSocket) )
175  {
176  bsServerDisconnect(pClient);
177  }
178 
179  // make TCP connection
180  pSocket = SocketOpenTcpConnection(sServerHostName, ipServerPort);
181 
182  if( pSocket == NULL )
183  {
185  "%s:%d", sServerHostName, ipServerPort);
187  }
188 
189  // set socket for non-block I/O
190  SocketAttrSetNonBlocking(pSocket);
191 
192  LOGDIAG2("%s: Connected to server at %s.\n",
193  pClient->m_sClientName, SocketAttrGetRemoteName(pSocket));
194 
195  pClient->m_pSocket = pSocket;
196 
197  return BS_OK;
198 }
Socket_T * m_pSocket
IP socket to server.
Definition: bsLibInternal.h:99
#define BS_ECODE_SERVER_CONN_FAIL
cannot connect to server
Definition: BotSense.h:89
#define BSCLIENT_LOG_SYSERROR(pClient, ecode, efmt,...)
Log System Error.
Definition: libBotSense.h:196
int bsServerDisconnect(BsClient_P pClient)
Disconnect from the bsProxy server.
Definition: bsLibServer.c:207
#define BS_OK
not an error, success
Definition: BotSense.h:66
const char * m_sClientName
client name
Definition: bsLibInternal.h:98
int bsServerDisconnect ( BsClient_P  pClient)

Disconnect from the bsProxy server.

Parameters
pClient

Definition at line 207 of file bsLibServer.c.

References BS_OK, bsVConnClearAll(), _bsClientStruct::m_pSocket, and _bsClientStruct::m_sClientName.

Referenced by bsServerConnect().

208 {
209  if( SocketStateIsOpen(pClient->m_pSocket) )
210  {
211  LOGDIAG2("%s: Disconnected from server at %s.\n",
212  pClient->m_sClientName, SocketAttrGetRemoteName(pClient->m_pSocket));
213  SocketClose(pClient->m_pSocket);
214  SocketDelete(pClient->m_pSocket);
215  pClient->m_pSocket = NULL;
216  bsVConnClearAll(pClient);
217  }
218 
219  return BS_OK;
220 }
Socket_T * m_pSocket
IP socket to server.
Definition: bsLibInternal.h:99
#define BS_OK
not an error, success
Definition: BotSense.h:66
void bsVConnClearAll(BsClient_T *pClient)
Remove and delete all of a client&#39;s vConnections.
Definition: bsLibClient.c:1478
const char * m_sClientName
client name
Definition: bsLibInternal.h:98
int bsServerReqCloseDev ( BsClient_P  pClient,
BsVConnHnd_T  hndVConn 
)

Request server to close a client's vitual connection.

Parameters
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.

598 {
599  static BsProxyMsgId_T msgIdReq = BsProxyMsgIdReqDevClose;
600  static BsProxyMsgId_T msgIdRsp = BsProxyMsgIdRspOk;
601 
602  BsProxyReqDevClose_T msgReq; // request message
603  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
604  bool_t bTrace; // do [not] trace messages
605  int n; // number of bytes/return code
606  int index; // internal vconn index
607 
608  //
609  // Parameter checks.
610  //
611  BSCLIENT_TRY_EXPR(pClient, BSCLIENT_HAS_VCONN(pClient, hndVConn),
612  BS_ECODE_BAD_VAL, "VConn=%d", hndVConn);
613 
614 
615  // trace state
616  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
617 
618  //
619  // Set request message values.
620  //
621  msgReq.m_vconn = (byte_t)hndVConn;
622 
623  //
624  // Pack request.
625  //
626  n = BsProxyPackReqDevClose(&msgReq, BSPROXY_BUF_BODY(buf), bTrace);
627 
628  // check packing return code
629  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdReq);
630 
631  //
632  // Execute request-response transaction.
633  //
634  n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
635  msgIdReq, buf, (size_t)n,
636  msgIdRsp, buf, sizeof(buf));
637 
638  // check transaction return code
639  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
640 
641  //
642  // Unpack response. No response body.
643  //
644 
645  //
646  // Set return values from response. No response values.
647  //
648 
649  //
650  // Remove and delete client vConnection.
651  //
652  if( (index = bsVConnRemove(pClient, hndVConn)) >= 0 )
653  {
654  bsVConnDelete(pClient, index);
655  }
656 
657  LOGDIAG2("%s: Virtual connecton %u closed.",
658  pClient->m_sClientName, (uint_t)hndVConn);
659 
660  return BS_OK;
661 }
#define BSCLIENT_TRY_ECODE(pClient, ecode, efmt,...)
Check if <b><i>BotSense</i></b> return value is not an error ( &lt; 0).
Definition: libBotSense.h:214
#define BS_ECODE_BAD_VAL
bad value
Definition: BotSense.h:77
int bsVConnRemove(BsClient_T *pClient, BsVConnHnd_T hndVConn)
Remove a vConnection from the client&#39;s tblHndIndex table.
Definition: bsLibClient.c:1565
INLINE_IN_H int BsProxyPackReqDevClose(BsProxyReqDevClose_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsProxyReqDevClose ITV message in big-endian byte order into the output buffer.
Definition: bsProxyMsgs.h:689
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
#define BS_OK
not an error, success
Definition: BotSense.h:66
int bsVConnDelete(BsClient_T *pClient, int index)
Delete a vConnection (and proxied device) from the client&#39;s tblVConn table.
Definition: bsLibClient.c:1684
const char * m_sClientName
client name
Definition: bsLibInternal.h:98
#define BSCLIENT_TRY_EXPR(pClient, expr, ecode, efmt,...)
Check if expression evaluates to true.
Definition: libBotSense.h:259
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
#define BSPROXY_BUF_BODY(buf)
Convenience macro to produce a buffer (offset, size) 2-tuple.
Definition: BotSense.h:272
#define BSCLIENT_HAS_VCONN(pClient, hnd)
Tests if the handle is valid and there is an established virtual connection.
Definition: libBotSense.h:285
#define BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt,...)
Check if NetMsgs (un)packing return value is not an error ( &lt; 0).
Definition: libBotSense.h:236
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259
byte_t m_vconn
vconn
Definition: bsProxyMsgs.h:216
int bsServerReqGetVConnInfo ( BsClient_P  pClient,
BsVConnHnd_T  hndVConn,
BsVConnInfo_T pVConnInfo 
)

Request server to retrieve the server's information for a given virtual connection.

Parameters
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.

738 {
741 
742  BsProxyReqGetVConnInfo_T msgReq; // request message
743  BsProxyRspGetVConnInfo_T msgRsp; // response message
744  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
745  bool_t bTrace; // do [not] trace messages
746  int n; // num bytes/return code
747 
748  //
749  // Parameter checks.
750  //
751  BSCLIENT_TRY_EXPR(pClient, BSCLIENT_HAS_VCONN(pClient, hndVConn),
752  BS_ECODE_BAD_VAL, "VConn=%d", hndVConn);
753 
754 
755  // trace state
756  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
757 
758  //
759  // Set request message values.
760  //
761  msgReq.m_vconn = (byte_t)hndVConn;
762 
763  //
764  // Pack request.
765  //
766  n = BsProxyPackReqGetVConnInfo(&msgReq, BSPROXY_BUF_BODY(buf), bTrace);
767 
768  // check packing return code
769  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdReq);
770 
771  //
772  // Execute request-response transaction.
773  //
774  n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
775  msgIdReq, buf, (size_t)n,
776  msgIdRsp, buf, sizeof(buf));
777 
778  // check transaction return code
779  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
780 
781  //
782  // Unpack response.
783  //
784  n = BsProxyUnpackRspGetVConnInfo(buf, (size_t)n, &msgRsp, bTrace);
785 
786  // check unpack return code
787  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdRsp);
788 
789  //
790  // Set return values from response.
791  //
792  pVConnInfo->m_vconn = msgRsp.m_vconn;
793  pVConnInfo->m_rd = msgRsp.m_rd;
794  strcpy_s(pVConnInfo->m_client, sizeof(pVConnInfo->m_client),
795  msgRsp.m_client);
796  strcpy_s(pVConnInfo->m_devuri, sizeof(pVConnInfo->m_devuri), msgRsp.m_devuri);
797  strcpy_s(pVConnInfo->m_moduri, sizeof(pVConnInfo->m_moduri), msgRsp.m_moduri);
798  strcpy_s(pVConnInfo->m_modver, sizeof(pVConnInfo->m_modver), msgRsp.m_modver);
799  strcpy_s(pVConnInfo->m_moddate, sizeof(pVConnInfo->m_moddate),
800  msgRsp.m_moddate);
801 
802  return BS_OK;
803 }
#define BSCLIENT_TRY_ECODE(pClient, ecode, efmt,...)
Check if <b><i>BotSense</i></b> return value is not an error ( &lt; 0).
Definition: libBotSense.h:214
#define BS_ECODE_BAD_VAL
bad value
Definition: BotSense.h:77
byte_t m_vconn
virtual connection handle
Definition: libBotSense.h:139
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
INLINE_IN_H int BsProxyPackReqGetVConnInfo(BsProxyReqGetVConnInfo_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsProxyReqGetVConnInfo ITV message in big-endian byte order into the output buffer...
Definition: bsProxyMsgs.h:775
ReqGetVConnInfo.
Definition: bsProxyMsgs.h:51
#define BS_OK
not an error, success
Definition: BotSense.h:66
RspGetVConnInfo.
Definition: bsProxyMsgs.h:52
char m_moddate[256]
i/f module date
Definition: libBotSense.h:145
char m_modver[256]
i/f module version
Definition: libBotSense.h:144
char m_devuri[(NMFVAL_LEN_MAX_STRING)+1]
devuri
Definition: bsProxyMsgs.h:283
char m_client[256]
client name
Definition: libBotSense.h:141
INLINE_IN_H int BsProxyUnpackRspGetVConnInfo(byte_t buf[], size_t uMsgLen, BsProxyRspGetVConnInfo_T *pStruct, bool_t bTrace)
Unpack a BsProxyRspGetVConnInfo ITV message in big-endian byte order from the input buffer...
Definition: bsProxyMsgs.h:839
char m_moduri[256]
i/f module URI
Definition: libBotSense.h:143
#define BSCLIENT_TRY_EXPR(pClient, expr, ecode, efmt,...)
Check if expression evaluates to true.
Definition: libBotSense.h:259
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
char m_client[(NMFVAL_LEN_MAX_STRING)+1]
client
Definition: bsProxyMsgs.h:281
#define BSPROXY_BUF_BODY(buf)
Convenience macro to produce a buffer (offset, size) 2-tuple.
Definition: BotSense.h:272
#define BSCLIENT_HAS_VCONN(pClient, hnd)
Tests if the handle is valid and there is an established virtual connection.
Definition: libBotSense.h:285
#define BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt,...)
Check if NetMsgs (un)packing return value is not an error ( &lt; 0).
Definition: libBotSense.h:236
int m_rd
resource descriptor
Definition: libBotSense.h:140
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259
char m_modver[(NMFVAL_LEN_MAX_STRING)+1]
modver
Definition: bsProxyMsgs.h:287
char m_moduri[(NMFVAL_LEN_MAX_STRING)+1]
moduri
Definition: bsProxyMsgs.h:285
char m_devuri[256]
device URI
Definition: libBotSense.h:142
char m_moddate[(NMFVAL_LEN_MAX_STRING)+1]
moddate
Definition: bsProxyMsgs.h:289
int bsServerReqGetVConnList ( BsClient_P  pClient,
BsVecHandles_T pVecHandles 
)

Request server to retrieve the server's list of virtual connection handles for this client.

Parameters
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.

674 {
677 
678  BsProxyRspGetVConnList_T msgRsp; // response message
679  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
680  bool_t bTrace; // do [not] trace messages
681  int n; // num bytes/return code
682  int i; // working index
683 
684  // trace state
685  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
686 
687  //
688  // Set request message values. No request values.
689  //
690 
691  //
692  // Pack request. No request body.
693  //
694 
695  //
696  // Execute request-response transaction.
697  //
698  n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
699  msgIdReq, buf, (size_t)0,
700  msgIdRsp, buf, sizeof(buf));
701 
702  // check transaction return code
703  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
704 
705  //
706  // Unpack response.
707  //
708  n = BsProxyUnpackRspGetVConnList(buf, (size_t)n, &msgRsp, bTrace);
709 
710  // check unpack return code
711  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdRsp);
712 
713  //
714  // Set return values from response.
715  //
716  for(i=0; (i<msgRsp.m_vconn.m_count) && (i<BSPROXY_VCONN_CLIENT_MAX); ++i)
717  {
718  pVecHandles->m_vecHnd[i] = (BsVConnHnd_T)msgRsp.m_vconn.u.m_buf[i];
719  }
720  pVecHandles->m_uCount = msgRsp.m_vconn.m_count;
721 
722  return BS_OK;
723 }
#define BSCLIENT_TRY_ECODE(pClient, ecode, efmt,...)
Check if <b><i>BotSense</i></b> return value is not an error ( &lt; 0).
Definition: libBotSense.h:214
union BsProxyRspGetVConnList_T::@12::@13 u
aligned vector items
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
INLINE_IN_H int BsProxyUnpackRspGetVConnList(byte_t buf[], size_t uMsgLen, BsProxyRspGetVConnList_T *pStruct, bool_t bTrace)
Unpack a BsProxyRspGetVConnList ITV message in big-endian byte order from the input buffer...
Definition: bsProxyMsgs.h:753
#define BS_OK
not an error, success
Definition: BotSense.h:66
BsVConnHnd_T m_vecHnd[BSPROXY_VCONN_CLIENT_MAX]
vector of handles
Definition: libBotSense.h:125
struct BsProxyRspGetVConnList_T::@12 m_vconn
vector
RspGetVConnList.
Definition: bsProxyMsgs.h:50
size_t m_uCount
vector length
Definition: libBotSense.h:124
ReqGetVConnList.
Definition: bsProxyMsgs.h:49
size_t m_count
vector item count
Definition: bsProxyMsgs.h:231
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
#define BSPROXY_VCONN_CLIENT_MAX
max number of virtual conn/client
Definition: BotSense.h:122
#define BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt,...)
Check if NetMsgs (un)packing return value is not an error ( &lt; 0).
Definition: libBotSense.h:236
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259
int BsVConnHnd_T
virtual connection handle type
Definition: BotSense.h:151
int bsServerReqGetVersion ( BsClient_P  pClient,
char  bufVer[],
size_t  bufSize 
)

Request server to return the server's version string.

Parameters
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.

355 {
356  static BsProxyMsgId_T msgIdReq = BsProxyMsgIdReqGetVersion;
357  static BsProxyMsgId_T msgIdRsp = BsProxyMsgIdRspGetVersion;
358 
359  BsProxyRspGetVersion_T msgRsp; // response message
360  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
361  bool_t bTrace; // do [not] trace messages
362  int n; // num. of bytes/return code
363 
364  // trace state
365  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
366 
367  //
368  // Set request message values. No request values.
369  //
370 
371  //
372  // Pack request. No request body.
373  //
374 
375  //
376  // Execute request-response transaction.
377  //
378  n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
379  msgIdReq, buf, (size_t)0,
380  msgIdRsp, buf, sizeof(buf));
381 
382  // check transaction return code
383  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
384 
385  //
386  // Unpack response.
387  //
388  n = BsProxyUnpackRspGetVersion(buf, (size_t)n, &msgRsp, bTrace);
389 
390  // check unpack return code
391  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdRsp);
392 
393  //
394  // Set return values from response.
395  //
396  strcpy_s(bufVer, bufSize, msgRsp.m_version);
397 
398  return BS_OK;
399 }
#define BSCLIENT_TRY_ECODE(pClient, ecode, efmt,...)
Check if <b><i>BotSense</i></b> return value is not an error ( &lt; 0).
Definition: libBotSense.h:214
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
#define BS_OK
not an error, success
Definition: BotSense.h:66
char m_version[(NMFVAL_LEN_MAX_STRING)+1]
version
Definition: bsProxyMsgs.h:139
INLINE_IN_H int BsProxyUnpackRspGetVersion(byte_t buf[], size_t uMsgLen, BsProxyRspGetVersion_T *pStruct, bool_t bTrace)
Unpack a BsProxyRspGetVersion ITV message in big-endian byte order from the input buffer...
Definition: bsProxyMsgs.h:538
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
#define BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt,...)
Check if NetMsgs (un)packing return value is not an error ( &lt; 0).
Definition: libBotSense.h:236
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259
int bsServerReqLoopback ( BsClient_P  pClient,
char  sLoopbackMsg[] 
)

Request server to loopback the requested message data.

Parameters
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.

231 {
232  static BsProxyMsgId_T msgIdReq = BsProxyMsgIdReqLoopback;
233  static BsProxyMsgId_T msgIdRsp = BsProxyMsgIdRspLoopback;
234 
235  BsProxyReqLoopback_T msgReq; // request message
236  BsProxyRspLoopback_T msgRsp; // response message
237  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
238  bool_t bTrace; // do [not] trace messages
239  int n; // number of bytes/return code
240  size_t m; // loopback cdata length
241 
242  // trace state
243  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
244 
245  //
246  // Set request message values.
247  //
248  m = strlen(sLoopbackMsg) + 1;
249  if( sizeof(msgReq.m_cdata) < m )
250  {
251  m = sizeof(msgReq.m_cdata);
252  }
253 
254  strcpy_s(msgReq.m_cdata, m, sLoopbackMsg);
255 
256  //
257  // Pack request.
258  //
259  n = BsProxyPackReqLoopback(&msgReq, BSPROXY_BUF_BODY(buf), bTrace);
260 
261  // check packing return code
262  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdReq);
263 
264  //
265  // Execute request-response transaction.
266  //
267  n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
268  msgIdReq, buf, (size_t)n,
269  msgIdRsp, buf, sizeof(buf));
270 
271  // check transaction return code
272  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
273 
274  //
275  // Unpack response.
276  //
277  n = BsProxyUnpackRspLoopback(buf, (size_t)n, &msgRsp, bTrace);
278 
279  // check unpack return code
280  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdRsp);
281 
282  //
283  // Set return values from response.
284  //
285  strcpy_s(sLoopbackMsg, m, msgRsp.m_cdata);
286 
287  return BS_OK;
288 }
char m_cdata[(NMFVAL_LEN_MAX_STRING)+1]
cdata
Definition: bsProxyMsgs.h:109
#define BSCLIENT_TRY_ECODE(pClient, ecode, efmt,...)
Check if <b><i>BotSense</i></b> return value is not an error ( &lt; 0).
Definition: libBotSense.h:214
INLINE_IN_H int BsProxyPackReqLoopback(BsProxyReqLoopback_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsProxyReqLoopback ITV message in big-endian byte order into the output buffer.
Definition: bsProxyMsgs.h:388
char m_cdata[(NMFVAL_LEN_MAX_STRING)+1]
cdata
Definition: bsProxyMsgs.h:92
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
#define BS_OK
not an error, success
Definition: BotSense.h:66
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
INLINE_IN_H int BsProxyUnpackRspLoopback(byte_t buf[], size_t uMsgLen, BsProxyRspLoopback_T *pStruct, bool_t bTrace)
Unpack a BsProxyRspLoopback ITV message in big-endian byte order from the input buffer.
Definition: bsProxyMsgs.h:452
#define BSPROXY_BUF_BODY(buf)
Convenience macro to produce a buffer (offset, size) 2-tuple.
Definition: BotSense.h:272
#define BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt,...)
Check if NetMsgs (un)packing return value is not an error ( &lt; 0).
Definition: libBotSense.h:236
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259
int bsServerReqMsgTrace ( BsClient_P  pClient,
BsVConnHnd_T  hndVConn,
bool_t  bNewTrace 
)

Request server to enable/disable message tracing on a virtual connection.

Parameters
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.

414 {
415  static BsProxyMsgId_T msgIdReq = BsProxyMsgIdReqMsgTrace;
416  static BsProxyMsgId_T msgIdRsp = BsProxyMsgIdRspOk;
417 
418  BsProxyReqMsgTrace_T msgReq; // request message
419  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
420  bool_t bTrace; // do [not] trace messages
421  int n; // number of bytes/return code
422 
423  // trace state
424  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
425 
426  //
427  // Set request message values.
428  //
429  msgReq.m_vconn = (byte_t)hndVConn;
430  msgReq.m_trace = bNewTrace;
431 
432  //
433  // Pack request.
434  //
435  n = BsProxyPackReqMsgTrace(&msgReq, BSPROXY_BUF_BODY(buf), bTrace);
436 
437  // check packing return code
438  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdReq);
439 
440  //
441  // Execute request-response transaction.
442  //
443  n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
444  msgIdReq, buf, (size_t)n,
445  msgIdRsp, buf, sizeof(buf));
446 
447  // check transaction return code
448  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
449 
450  //
451  // Unpack response. No response body.
452  //
453 
454  //
455  // Set return values from response. No response values.
456  //
457 
458  return BS_OK;
459 }
#define BSCLIENT_TRY_ECODE(pClient, ecode, efmt,...)
Check if <b><i>BotSense</i></b> return value is not an error ( &lt; 0).
Definition: libBotSense.h:214
bool_t m_trace
trace
Definition: bsProxyMsgs.h:154
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
#define BS_OK
not an error, success
Definition: BotSense.h:66
INLINE_IN_H int BsProxyPackReqMsgTrace(BsProxyReqMsgTrace_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsProxyReqMsgTrace ITV message in big-endian byte order into the output buffer.
Definition: bsProxyMsgs.h:560
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
#define BSPROXY_BUF_BODY(buf)
Convenience macro to produce a buffer (offset, size) 2-tuple.
Definition: BotSense.h:272
#define BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt,...)
Check if NetMsgs (un)packing return value is not an error ( &lt; 0).
Definition: libBotSense.h:236
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259
byte_t m_vconn
vconn
Definition: bsProxyMsgs.h:153
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.

Parameters
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.

492 {
493  static BsProxyMsgId_T msgIdReq = BsProxyMsgIdReqDevOpen;
494  static BsProxyMsgId_T msgIdRsp = BsProxyMsgIdRspDevOpen;
495 
496  BsProxyReqDevOpen_T msgReq; // request message
497  BsProxyRspDevOpen_T msgRsp; // response message
498  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
499  bool_t bTrace; // do [not] trace messages
500  int index; // internal vconn index
501  int n; // number of bytes/return code
502  int rc; // return code
503 
504  //
505  // Parameter checks.
506  //
507  BSCLIENT_TRY_EXPR(pClient, (strlen(sDevName)<=BSPROXY_REQDEVOPEN_DEVNAME_LEN),
509  "%zu > %u", strlen(sDevName), BSPROXY_REQDEVOPEN_DEVNAME_LEN);
510 
511  BSCLIENT_TRY_EXPR(pClient, (strlen(sModName)<=BSPROXY_REQDEVOPEN_MODNAME_LEN),
513  "%zu > %u", strlen(sModName), BSPROXY_REQDEVOPEN_MODNAME_LEN);
514 
517  "%zu > %u", arglen, BSPROXY_REQDEVOPEN_ARGBUF_LEN);
518 
519  //
520  // Create and reserve new client vConnection.
521  //
522  if((index=bsVConnNew(pClient, sDevName, sModName, pAppInfo, bInitTrace)) < 0)
523  {
524  return index;
525  }
526 
527  // server-ended trace state
528  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
529 
530  //
531  // Set request message values.
532  //
533  msgReq.m_trace = bInitTrace;
534  strcpy(msgReq.m_devname, sDevName);
535  strcpy(msgReq.m_modname, sModName);
536  memcpy(msgReq.m_argbuf.u.m_buf, argbuf, arglen);
537  msgReq.m_argbuf.m_count = arglen;
538 
539  //
540  // Pack request.
541  //
542  if( (n = BsProxyPackReqDevOpen(&msgReq, BSPROXY_BUF_BODY(buf), bTrace)) < 0 )
543  {
544  BSCLIENT_LOG_NM_ERROR(pClient, n, "MsgId=%u", msgIdReq);
545  rc = -BS_ECODE_BAD_MSG;
546  }
547 
548  //
549  // Execute request-response transaction.
550  //
551  else if( (n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
552  msgIdReq, buf, (size_t)n,
553  msgIdRsp, buf, sizeof(buf))) < 0 )
554  {
555  BSCLIENT_LOG_ERROR(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
556  rc = n;
557  }
558 
559  //
560  // Unpack response.
561  //
562  else if( (n = BsProxyUnpackRspDevOpen(buf, (size_t)n, &msgRsp, bTrace)) < 0 )
563  {
564  BSCLIENT_LOG_NM_ERROR(pClient, n, "MsgId=%u", msgIdRsp);
565  rc = -BS_ECODE_BAD_MSG;
566  }
567 
568  //
569  // Success
570  //
571  else
572  {
573  bsVConnAdd(pClient, msgRsp.m_vconn, index);
574  _BS_LOG_VCONN_OPEN(pClient, index);
575  rc = (int)msgRsp.m_vconn;
576  }
577 
578  //
579  // Error clean up
580  //
581  if( rc < 0 )
582  {
583  bsVConnDelete(pClient, index);
584  }
585 
586  return rc;
587 }
int bsVConnNew(BsClient_T *pClient, const char *sDevName, const char *sModName, const BsClientAppInfo_T *pAppInfo, bool_t bTrace)
Reserve a new client vConnection (and proxied device) in the client&#39;s tblVConn table.
Definition: bsLibClient.c:1614
#define BS_ECODE_BAD_VAL
bad value
Definition: BotSense.h:77
#define BSPROXY_REQDEVOPEN_MODNAME_LEN
Definition: bsProxyMsgs.h:166
char m_modname[(NMFVAL_LEN_MAX_STRING)+1]
modname
Definition: bsProxyMsgs.h:179
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
#define BSCLIENT_LOG_ERROR(pClient, ecode, efmt,...)
Log Error.
Definition: libBotSense.h:170
bool_t m_trace
trace
Definition: bsProxyMsgs.h:176
INLINE_IN_H int BsProxyUnpackRspDevOpen(byte_t buf[], size_t uMsgLen, BsProxyRspDevOpen_T *pStruct, bool_t bTrace)
Unpack a BsProxyRspDevOpen ITV message in big-endian byte order from the input buffer.
Definition: bsProxyMsgs.h:667
#define BSCLIENT_LOG_NM_ERROR(pClient, nmecode, efmt,...)
Log NetMsgs Error.
Definition: libBotSense.h:184
size_t m_count
vector item count
Definition: bsProxyMsgs.h:183
int bsVConnAdd(BsClient_T *pClient, BsVConnHnd_T hndVConn, int index)
Add a created vConnection to the client&#39;s tblHndIndex table.
Definition: bsLibClient.c:1506
#define BS_ECODE_BAD_MSG
bad message
Definition: BotSense.h:76
#define BSPROXY_REQDEVOPEN_DEVNAME_LEN
Definition: bsProxyMsgs.h:163
#define _BS_LOG_VCONN_OPEN(pClient, index)
Log virtual connection open event.
Definition: bsLibServer.c:76
int bsVConnDelete(BsClient_T *pClient, int index)
Delete a vConnection (and proxied device) from the client&#39;s tblVConn table.
Definition: bsLibClient.c:1684
byte_t m_vconn
vconn
Definition: bsProxyMsgs.h:203
union BsProxyReqDevOpen_T::@10::@11 u
aligned vector items
struct BsProxyReqDevOpen_T::@10 m_argbuf
vector
#define BSCLIENT_TRY_EXPR(pClient, expr, ecode, efmt,...)
Check if expression evaluates to true.
Definition: libBotSense.h:259
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
#define BSPROXY_BUF_BODY(buf)
Convenience macro to produce a buffer (offset, size) 2-tuple.
Definition: BotSense.h:272
#define BSPROXY_REQDEVOPEN_ARGBUF_LEN
Definition: bsProxyMsgs.h:169
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259
char m_devname[(NMFVAL_LEN_MAX_STRING)+1]
devname
Definition: bsProxyMsgs.h:177
INLINE_IN_H int BsProxyPackReqDevOpen(BsProxyReqDevOpen_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsProxyReqDevOpen ITV message in big-endian byte order into the output buffer.
Definition: bsProxyMsgs.h:603
int bsServerReqSetLogging ( BsClient_P  pClient,
int  nLogLevel 
)

Request server to set the server's logging level.

Parameters
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.

299 {
300  static BsProxyMsgId_T msgIdReq = BsProxyMsgIdReqSetLogging;
301  static BsProxyMsgId_T msgIdRsp = BsProxyMsgIdRspOk;
302 
303  BsProxyReqSetLogging_T msgReq; // request message
304  byte_t buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
305  bool_t bTrace; // do [not] trace messages
306  int n; // num. of bytes/return code
307 
308  // trace state
309  bTrace = bsClientAttrGetTraceState(pClient, BSPROXY_VCONN_SERVER);
310 
311  //
312  // Set request message values.
313  //
314  msgReq.m_level = nLogLevel;
315 
316  //
317  // Pack request.
318  //
319  n = BsProxyPackReqSetLogging(&msgReq, BSPROXY_BUF_BODY(buf), bTrace);
320 
321  // check packing return code
322  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdReq);
323 
324  //
325  // Execute request-response transaction.
326  //
327  n = bsClientTrans(pClient, BSPROXY_VCONN_SERVER,
328  msgIdReq, buf, (size_t)n,
329  msgIdRsp, buf, sizeof(buf));
330 
331  // check transaction return code
332  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
333 
334  //
335  // Unpack response. No response body.
336  //
337 
338  //
339  // Set return values from response. No response values.
340  //
341 
342  return BS_OK;
343 }
#define BSCLIENT_TRY_ECODE(pClient, ecode, efmt,...)
Check if <b><i>BotSense</i></b> return value is not an error ( &lt; 0).
Definition: libBotSense.h:214
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
Definition: BotSense.h:140
#define BS_OK
not an error, success
Definition: BotSense.h:66
INLINE_IN_H int BsProxyPackReqSetLogging(BsProxyReqSetLogging_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsProxyReqSetLogging ITV message in big-endian byte order into the output buffer.
Definition: bsProxyMsgs.h:474
BsProxyMsgId_T
Definition: bsProxyMsgs.h:35
#define BSPROXY_BUF_BODY(buf)
Convenience macro to produce a buffer (offset, size) 2-tuple.
Definition: BotSense.h:272
#define BSCLIENT_TRY_NM_ECODE(pClient, nmecode, efmt,...)
Check if NetMsgs (un)packing return value is not an error ( &lt; 0).
Definition: libBotSense.h:236
#define BSPROXY_MSG_MAX_LEN
total message maximum length
Definition: BotSense.h:259