botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
BsModProxyCb_T Struct Reference

Interface Module callbacks to bsProxy services type. More...

#include <bsProxyModIF.h>

Public Attributes

void(* m_cbSendRsp )(BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufRsp[], size_t uRspLen)
 Send module-specific repsonse callback function. More...
 
void(* m_cbSendOkRsp )(BsVConnHnd_T hndVConn, BsTid_T uTid)
 Send generic ok repsonse callback function. More...
 
void(* m_cbSendErrorRsp )(BsVConnHnd_T hndVConn, BsTid_T uTid, int nECode, const char *sErrFmt,...)
 Send generic error repsonse callback function. More...
 
BsModRsrcTbl_T *(* m_cbModRsrcTblNew )(int nMaxResources)
 Allocatae a new module resource table of fixed size. More...
 
void(* m_cbModRsrcTblDelete )(BsModRsrcTbl_T *pRsrcTbl)
 Delete an allocated resource table. More...
 
int(* m_cbModRsrcAdd )(BsModRsrcTbl_T *pRsrcTbl, BsVConnHnd_T hndVConn, void *pRsrc)
 Add a new resource to the resource table. More...
 
void *(* m_cbModRsrcRemove )(BsModRsrcTbl_T *pRsrcTbl, BsVConnHnd_T hndVConn)
 Remove a resource from the resource table. More...
 
const char *(* m_fnGetDevUri )(BsVConnHnd_T hndVConn, char dest[], size_t n)
 Copy the device URI associated with the virtual connection. More...
 
BsModIter_T *(* m_cbModIterFirst )(BsModIterOver_T eOver, const char *sPattern)
 Start an iterator over the virtual connections matching the given pattern. More...
 
BsModIter_T *(* m_cbModIterNext )(BsModIter_T *pIter)
 Get the next set of information given the iterator state. More...
 
void(* m_cbModIterDelete )(BsModIter_T *pIter)
 Delete the module iterator. More...
 

Detailed Description

Interface Module callbacks to bsProxy services type.

Definition at line 235 of file bsProxyModIF.h.

Member Data Documentation

void(* BsModProxyCb_T::m_cbModIterDelete) (BsModIter_T *pIter)

Delete the module iterator.

Parameters
pIterModule iterator.

Definition at line 372 of file bsProxyModIF.h.

BsModIter_T*(* BsModProxyCb_T::m_cbModIterFirst) (BsModIterOver_T eOver, const char *sPattern)

Start an iterator over the virtual connections matching the given pattern.

If a virtual connection match is found, an iterator is allocated and its data is filled with the first set of information.

The caller must delete the iterator by calling m_cbModIterNext() until there are no more matches (auto-delete) or by calling m_cbModIterDelete().

Parameters
eOverWhat pattern to iterator over (see BsModIterOver_T).
sPatternDevice or module URI pattern string.
Returns
On success, returns the pointer to the allocacted module iterator.
On failure, NULL is returned.

Definition at line 351 of file bsProxyModIF.h.

BsModIter_T*(* BsModProxyCb_T::m_cbModIterNext) (BsModIter_T *pIter)

Get the next set of information given the iterator state.

If a virtual connection match is found, an iterator data is updated.

If no match is found, the iterator is auto-deleted.

Parameters
pIterInitialized, allocated iterator.
Returns
On success, returns the pointer to the iterator.
On failure, NULL is returned.

Definition at line 365 of file bsProxyModIF.h.

int(* BsModProxyCb_T::m_cbModRsrcAdd) (BsModRsrcTbl_T *pRsrcTbl, BsVConnHnd_T hndVConn, void *pRsrc)

Add a new resource to the resource table.

Parameters
pRsrcTblPointer to resource table.
hndVConnVirtual connection handle.
pRsrcPointer to allocated resource associated with handle.
Returns
On success, BS_OK is returned.
On error, the appropriate < 0 negated BotSense Error Code is returned.

Definition at line 305 of file bsProxyModIF.h.

Referenced by bsModOpen().

void*(* BsModProxyCb_T::m_cbModRsrcRemove) (BsModRsrcTbl_T *pRsrcTbl, BsVConnHnd_T hndVConn)

Remove a resource from the resource table.

The resource is not deleted.

Parameters
pRsrcTblPointer to resource table.
hndVConnVirtual connection handle.
Returns
On success, returns pointer to removed resource. On failure, NULL is returned.

Definition at line 320 of file bsProxyModIF.h.

Referenced by bsModClose().

void(* BsModProxyCb_T::m_cbModRsrcTblDelete) (BsModRsrcTbl_T *pRsrcTbl)

Delete an allocated resource table.

Warning
Module-specific resources should be freed up prior to calling this function.
Parameters
pRsrcTblPointer to resource table.

Definition at line 294 of file bsProxyModIF.h.

Referenced by bsModExit().

BsModRsrcTbl_T*(* BsModProxyCb_T::m_cbModRsrcTblNew) (int nMaxResources)

Allocatae a new module resource table of fixed size.

The resource table is indexed by the virtual connection handle.

Parameters
nMaxResourcesMaximum number of simultaneous resources supported.
Returns
Pointer to allocated resource block.

Definition at line 284 of file bsProxyModIF.h.

Referenced by bsModInit().

void(* BsModProxyCb_T::m_cbSendErrorRsp) (BsVConnHnd_T hndVConn, BsTid_T uTid, int nECode, const char *sErrFmt,...)

Send generic error repsonse callback function.

Parameters
hndVConnVirtual connection handle.
uTidRequest-Response transaction id.
nECodeOne of BotSense Error Codes.
sErrFmtError format string.
...Variable arguments to format string.

Definition at line 269 of file bsProxyModIF.h.

void(* BsModProxyCb_T::m_cbSendOkRsp) (BsVConnHnd_T hndVConn, BsTid_T uTid)

Send generic ok repsonse callback function.

Parameters
hndVConnVirtual connection handle.
uTidRequest-Response transaction id.

Definition at line 258 of file bsProxyModIF.h.

void(* BsModProxyCb_T::m_cbSendRsp) (BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufRsp[], size_t uRspLen)

Send module-specific repsonse callback function.

Parameters
hndVConnVirtual connection handle.
uTidRequest-Response transaction id.
uMsgIdResponse message id.
bufRspPacked repsonse message body.
uRspLenLength of response in buffer (number of bytes).

Definition at line 246 of file bsProxyModIF.h.

Referenced by bsModI2CReqRead(), bsModI2CReqScan(), bsModI2CReqTrans(), bsModI2CReqWrite(), bsModNullReqWrite(), bsModSerialReqRead(), bsModSerialReqTrans(), and bsModSerialReqWrite().

const char*(* BsModProxyCb_T::m_fnGetDevUri) (BsVConnHnd_T hndVConn, char dest[], size_t n)

Copy the device URI associated with the virtual connection.

Parameters
hndVConnVirtual connection handle.
[out]destDestination buffer.
nSize of buffer.
Returns
Pointer to destination buffer dest.

Definition at line 331 of file bsProxyModIF.h.


The documentation for this struct was generated from the following file: