| |
- BotSense.BotSenseCore.BsClientAppInfo_T(__builtin__.object)
-
- BsClientAppInfo
- BotSense.BotSenseCore.BsProxyMsgHdr_T(__builtin__.object)
-
- BsProxyMsgHdr
- BotSense.BotSenseCore.BsVConnInfo_T(__builtin__.object)
-
- BsVConnInfo
- BsClient
- ByteBuf
class BsClient |
|
BotSense Client Wrapper Class.
The BsClient class provides a safe wrapper around the BsClient_T *
opaque object. |
|
Methods defined here:
- AttrGetConnState(self)
- Get the client's connection state.
Return:
Dictionary specifying connection state.
- AttrGetDevName(self, hndVConn)
- Get the proxied device name associated with the given handle.
Parameters:
hndVConn - Virtual connection handle.
Return:
On success, returns the device URI string. If no device is found,
then '#nodev#' is returned.
On parameter check failure, a BotSenseError exception is raised.
- AttrGetModName(self, hndVConn)
- Get the proxied interface module name associated with the given
handle.
Parameters:
hndVConn - Virtual connection handle.
Return:
On success, returns the I/F module URI string. If no module is
found, then '#nomod#' is returned.
On parameter check failure, a BotSenseError exception is raised.
- AttrGetName(self)
- Get the client's name.
Return:
On success, returns client string name.
On parameter check failure, a BotSenseError exception is raised.
- AttrGetTimeouts(self)
- Get the client's request and response timeouts in seconds.
- AttrGetTraceState(self, hndVConn)
- Get a client's virtual connection trace state.
Parameters:
hndVConn - Virtual connection handle.
Return:
On success, returns True (enabled) or False (disabled).
On parameter check failure, a BotSenseError exception is raised.
- AttrGetVConnCount(self)
- Get a client's virtual connection trace state.
Return:
On success, returns client's virtual connection count.
On parameter check failure, a BotSenseError exception is raised.
- AttrHasVConn(self, hndVConn)
- Check if the client has a virtual connection associated with the
given handle.
Parameters:
hndVConn - Virtual connection handle.
Return:
On success, returns True or False.
On parameter check failure, a BotSenseError exception is raised.
- AttrSetLogging(self, nLevel)
- Set the client's diagnostic logging threshold.
Parameters:
nLevel - New logging threshold level.
- AttrSetTimeouts(self, reqTimeout, rspTimeout)
- Set the client's request and response timeouts in seconds.
Parameters:
reqTimeout - Request (write) timeout.
rspTimeout - Response (read) timeout.
- GetMsgName(self, hndVConn, msgId)
- Get the message name string.
For each (virtual connection, message id) 2-tuple, the message
name can be determinied (provided the msgid is valid and an
application provides the information).
Parameters:
hndVConn - Virtual connection handle.
msgId - Message id.
Return:
On success, returns the message name string. If the name cannot
be determined, then 'unknown' is returned.
On parameter check failure, a BotSenseError exception is raised.
- Trans(self, hndVConn, reqMsgId, reqBuf, rspMsgId, rspMaxSize=2048)
- Execute a request - response transaction with the server.
The request message header is automatically generated. The response
message header is stripped off from the received response.
Raises a BotSenseError exception on failure.
Parameters:
hndVConn - Virtual connection handle.
reqMsgId - Virtual connection unique request message id.
reqBuf - Packed request message body.
rspMsgId - Virtual connection expected response message id.
rspMaxSize - Maximum expected response body size.
Return:
Packed response message body buffer.
- __del__(self)
- Delete BotSense client instance.
- __init__(self, clientName='bsclient')
- Create and initialize BotSense client instance.
Parameters:
clientName - Proxied client name string.
- __sizeof__(self)
- x.__sizeof__() -- size of swig object, in bytes.
Static methods defined here:
- ChkClient(obj)
- Static check if object is a valid BsClient object.
Parameters:
obj - Object instance.
|
class BsClientAppInfo(BotSense.BotSenseCore.BsClientAppInfo_T) |
|
BotSense Client Application Info and Callback Wrapper Class.
When an application (library) establishes an application-specific
virtual connection, this static information and callbacks are passed
to the BotSense client library.
The information and callbacks are optional. The BotSense library will
ignore any member value that is set to None or if the class instance
is None (everything is ignored). |
|
- Method resolution order:
- BsClientAppInfo
- BotSense.BotSenseCore.BsClientAppInfo_T
- __builtin__.object
Methods defined here:
- ListAttrs(self)
- Return list of class variable attribute names.
- __getitem__(self, y)
- x.__getitem__(y) <==> x[y]
- __init__(self)
- Initialize BotSense Proxy Message Header instance.
- __iter__(self)
- x.__iter__() <==> iter(x)
- __setitem__(self, y, v)
- x.__setitem__(y, v) <==> x[y]=v
- __sizeof__(self)
- x.__sizeof__() -- size of swig object, in bytes.
- __str__(self)
- x.__str__() <==> str(x) <==> print x
Methods inherited from BotSense.BotSenseCore.BsClientAppInfo_T:
- __del__ lambda self
- __getattr__ lambda self, name
- __repr__ = _swig_repr(self)
- __setattr__ lambda self, name, value
Data descriptors inherited from BotSense.BotSenseCore.BsClientAppInfo_T:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- app_name
- brief
- date
- fnGetMsgName
- license
- maintainer
- version
Data and other attributes inherited from BotSense.BotSenseCore.BsClientAppInfo_T:
- __swig_destroy__ = <built-in function delete_BsClientAppInfo_T>
- __swig_getmethods__ = {'app_name': <built-in function BsClientAppInfo_T_app_name_get>, 'brief': <built-in function BsClientAppInfo_T_brief_get>, 'date': <built-in function BsClientAppInfo_T_date_get>, 'fnGetMsgName': <built-in function BsClientAppInfo_T_fnGetMsgName_get>, 'license': <built-in function BsClientAppInfo_T_license_get>, 'maintainer': <built-in function BsClientAppInfo_T_maintainer_get>, 'version': <built-in function BsClientAppInfo_T_version_get>}
- __swig_setmethods__ = {'app_name': <built-in function BsClientAppInfo_T_app_name_set>, 'brief': <built-in function BsClientAppInfo_T_brief_set>, 'date': <built-in function BsClientAppInfo_T_date_set>, 'fnGetMsgName': <built-in function BsClientAppInfo_T_fnGetMsgName_set>, 'license': <built-in function BsClientAppInfo_T_license_set>, 'maintainer': <built-in function BsClientAppInfo_T_maintainer_set>, 'version': <built-in function BsClientAppInfo_T_version_set>}
|
class BsProxyMsgHdr(BotSense.BotSenseCore.BsProxyMsgHdr_T) |
|
BotSense bsProxy Message Header Wrapper Class. |
|
- Method resolution order:
- BsProxyMsgHdr
- BotSense.BotSenseCore.BsProxyMsgHdr_T
- __builtin__.object
Methods defined here:
- ListAttrs(self)
- Return list of class variable attribute names.
- PackMsgHdr(self, buf)
- Pack BotSense bsProxy message header
Raises a BotSenseError exception on failure.
Parameters:
buf [out] - BotSenseTypes.ByteBuf output buffer instance.
Return:
On success, returns the number of bytes packed.
On failure, a BotSenseError exception is raised.
- UnpackMsgHdr(self, buf)
- Unpack BotSense bsProxy message header
Raises a BotSenseError exception on failure.
Parameters:
buf [in] - BotSenseTypes.ByteBuf input buffer instance.
Return:
On success, returns the number of bytes unpacked.
On failure, a BotSenseError exception is raised.
- __getitem__(self, y)
- x.__getitem__(y) <==> x[y]
- __init__(self, tid=0, vconn=254, msgid=0, bodylen=0)
- Initialize BotSense Proxy Message Header instance.
Parameters:
tid - Transaction id.
vconn - Virtual connection handle.
msgid - Message id.
bodylen - Message body length, in bytes.
- __iter__(self)
- x.__iter__() <==> iter(x)
- __setitem__(self, y, v)
- x.__setitem__(y, v) <==> x[y]=v
- __sizeof__(self)
- x.__sizeof__() -- size of header, in bytes.
- __str__(self)
- x.__str__() <==> str(x) <==> print x
Methods inherited from BotSense.BotSenseCore.BsProxyMsgHdr_T:
- __del__ lambda self
- __getattr__ lambda self, name
- __repr__ = _swig_repr(self)
- __setattr__ lambda self, name, value
Data descriptors inherited from BotSense.BotSenseCore.BsProxyMsgHdr_T:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- m_hdrBodyLen
- m_hdrMagic
- m_hdrMsgId
- m_hdrTid
- m_hdrVConn
Data and other attributes inherited from BotSense.BotSenseCore.BsProxyMsgHdr_T:
- __swig_destroy__ = <built-in function delete_BsProxyMsgHdr_T>
- __swig_getmethods__ = {'m_hdrBodyLen': <built-in function BsProxyMsgHdr_T_m_hdrBodyLen_get>, 'm_hdrMagic': <built-in function BsProxyMsgHdr_T_m_hdrMagic_get>, 'm_hdrMsgId': <built-in function BsProxyMsgHdr_T_m_hdrMsgId_get>, 'm_hdrTid': <built-in function BsProxyMsgHdr_T_m_hdrTid_get>, 'm_hdrVConn': <built-in function BsProxyMsgHdr_T_m_hdrVConn_get>}
- __swig_setmethods__ = {'m_hdrBodyLen': <built-in function BsProxyMsgHdr_T_m_hdrBodyLen_set>, 'm_hdrMagic': <built-in function BsProxyMsgHdr_T_m_hdrMagic_set>, 'm_hdrMsgId': <built-in function BsProxyMsgHdr_T_m_hdrMsgId_set>, 'm_hdrTid': <built-in function BsProxyMsgHdr_T_m_hdrTid_set>, 'm_hdrVConn': <built-in function BsProxyMsgHdr_T_m_hdrVConn_set>}
|
class BsVConnInfo(BotSense.BotSenseCore.BsVConnInfo_T) |
|
BotSense Virtual Connection Information Wrapper Class. |
|
- Method resolution order:
- BsVConnInfo
- BotSense.BotSenseCore.BsVConnInfo_T
- __builtin__.object
Methods defined here:
- ListAttrs(self)
- Return list of class variable attribute names.
- __getitem__(self, y)
- x.__getitem__(y) <==> x[y]
- __init__(self)
- Initialize Virtual Connection Info instance.
- __iter__(self)
- x.__iter__() <==> iter(x)
- __setitem__(self, y, v)
- x.__setitem__(y, v) <==> x[y]=v
- __sizeof__(self)
- x.__sizeof__() -- size of swig object, in bytes.
- __str__(self)
- x.__str__() <==> str(x) <==> print x
Methods inherited from BotSense.BotSenseCore.BsVConnInfo_T:
- __del__ lambda self
- __getattr__ lambda self, name
- __repr__ = _swig_repr(self)
- __setattr__ lambda self, name, value
Data descriptors inherited from BotSense.BotSenseCore.BsVConnInfo_T:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- m_client
- m_devuri
- m_moddate
- m_moduri
- m_modver
- m_rd
- m_vconn
Data and other attributes inherited from BotSense.BotSenseCore.BsVConnInfo_T:
- __swig_destroy__ = <built-in function delete_BsVConnInfo_T>
- __swig_getmethods__ = {'m_client': <built-in function BsVConnInfo_T_m_client_get>, 'm_devuri': <built-in function BsVConnInfo_T_m_devuri_get>, 'm_moddate': <built-in function BsVConnInfo_T_m_moddate_get>, 'm_moduri': <built-in function BsVConnInfo_T_m_moduri_get>, 'm_modver': <built-in function BsVConnInfo_T_m_modver_get>, 'm_rd': <built-in function BsVConnInfo_T_m_rd_get>, 'm_vconn': <built-in function BsVConnInfo_T_m_vconn_get>}
- __swig_setmethods__ = {'m_client': <built-in function BsVConnInfo_T_m_client_set>, 'm_devuri': <built-in function BsVConnInfo_T_m_devuri_set>, 'm_moddate': <built-in function BsVConnInfo_T_m_moddate_set>, 'm_moduri': <built-in function BsVConnInfo_T_m_moduri_set>, 'm_modver': <built-in function BsVConnInfo_T_m_modver_set>, 'm_rd': <built-in function BsVConnInfo_T_m_rd_set>, 'm_vconn': <built-in function BsVConnInfo_T_m_vconn_set>}
|
class ByteBuf |
|
BotSense Byte Buffer Class.
The ByteBuf class provides a wrapper around the byte_t* SWIG object.
The byte_t is typedef'ed in C as an unsigned char. Byte buffers are used
in packing and unpacking messages and in communication between the
client and server.
Note: There does not seem to be any way to advance the pointer of the
underlining byte_t* SWIG object, so a copy from/to a python byte
list (buffer) is required. |
|
Methods defined here:
- __del__(self)
- Delete byte buffer instance.
- __getitem__(self, i)
- x.__getitem__(i) <==> x[i]
- __getslice__(self, i, j)
- x.__getslice__(i, j) <==> x[i:j]
- __iadd__(self, y)
- x.__iadd__(y) <==> x+=y
- __imul__(self, y)
- x.__imul__(y) <==> x*=y
- __init__(self, size=2048)
- Initialize byte buffer instance.
Parameters:
size - Number of bytes of the underlining fixed sized SWIG
object.
- __iter__(self)
- x.__iter__() <==> iter(x)
- __len__(self)
- x.__len__() <==> len(x)
Number of bytes used in buffer.
- __setitem__(self, i, y)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(self, i, j, y)
- x.__setslice__(i, j, y) <==> x[i:j]=y
- __sizeof__(self)
- x.__sizeof__() -- size of swig object byte buffer, in bytes.
- __str__(self)
- x.__str__() <==> str(x) <==> print x
- avail(self)
- Available bytes in fixed swig object buffer.
- copyFromSwigObj(self, n, i=0, j=0)
- Copy swig object buffer to python buffer.
Parameters:
n - Number of bytes to copy.
i - Starting source index in swig object buffer.
j - Starting destination index in python buffer.
- copyToSwigObj(self, n, i=0, j=0)
- Copy python buffer to instance swig object buffer.
Parameters:
n - Number of bytes to copy.
i - Starting source index in python buffer.
j - Starting destination index in swig object buffer.
- getBuffer(self)
- Return python buffer.
- getSwigObj(self)
- Return raw swig object.
- sizeof(self)
- Size of fixed swig object byte buffer, in bytes.
Static methods defined here:
- Clone(buf)
- Smart clone constructor.
If buf is a ByteBuf instance, then simply return buf.
Otherwise convert buf to a ByteBuf instance.
The underlining swig object contents are not touched, so swig copies
will need to be done prior to or after calling a byte_t* core routine.
Parameters:
buf - Either a ByteBuf instance or a sequence of values to convert.
Sequence type can be an integer [0,255], a string, or a list
of elements of type integer, string, list.
Return:
Existing or new ByteBuf().
- Constructor(seq)
- Conversion constructor.
Parameters:
seq - Sequence of values to convert. Sequence type can be an
integer [0,255], a string, or a list of elements of
type integer, string, list.
Return:
New initialized ByteBuf().
- byte(val)
- Static method to convert a value into a byte.
Parameters:
val - Value to convert. Value type can be an integer [0,255],
a string of length 1, or a list of length 1 of element
type of integer, string, list.
Return:
On success, returns converted byte value.
On failure, a BotSenseError exception is raised.
- bytec(val)
- Static method to convert a value into a byte character string.
Parameters:
val - Value to convert. Value type can be an integer [0,255],
a string of length 1, or a list of length 1 of element
type of integer, string, list.
Return:
On success, returns converted byte value.
On failure, a BotSenseError exception is raised.
- bytelist(seq)
- Static method to convert a value sequence into a byte list.
Parameters:
seq - Sequence of values to convert. Sequence type can be an
integer [0,255], a string, or a list of elements of
type integer, string, list.
Return:
On success, returns converted byte value list.
On failure, a BotSenseError exception is raised.
- bytestring(seq)
- Static method to convert a value sequence into a byte string.
Parameters:
seq - Sequence of values to convert. Sequence type can be an
integer [0,255], a string, or a list of elements of
type integer, string, list.
Return:
On success, returns converted byte value list.
On failure, a BotSenseError exception is raised.
| |