botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
bsNull.doxy
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: BotSense
4 //
5 // File: bsNull.doxy
6 //
7 // Description:
8 // This file contains the doxygen directives to document the BotSense Standard
9 // /dev/null Module. This module comes standard with the BotSense package.
10 //
11 ////////////////////////////////////////////////////////////////////////////////
12 
13 /*! \file */
14 
15 /* ---------------------------------------------------------------------------
16  * Null
17  * --------------------------------------------------------------------------*/
18 
19 /*!
20  * \ingroup bsmod
21  * \defgroup bsmod_null Null
22  *
23  * BotSense standanrd raw /dev/null module.
24  *
25  * The primary purpose of this module is for testing and connection validation
26  * (although if you need a proxied /dev/null...).
27  *
28  * \section bsmod_intro Introduction
29  * The client side C/C++ interfaces are provided by the header file
30  * \ref include/botsense/bsNull.h "botsense/bsNull.h" in conjunction with
31  * the libraries libbsclient_null.a or libbsclient_null.so.
32  * For python clients, the python module
33  * \ref bsPython/modules/BotSense/bsNull.py "BotSense.bsNull"
34  * provides wrapper functions for the C libraries.
35  *
36  * The server side \ref man_bsproxy "bsProxy" plug-in is the Dynamic Link
37  * Library (DLL) libbsserver_null.so.
38  *
39  * \par Source Subdirectory:
40  * bsModules/bsNull
41  * \{
42  */
43 
44 /*! \} */ /* end bsmod_null */
45 
46 
47 /* ---------------------------------------------------------------------------
48  * Null Client
49  * --------------------------------------------------------------------------*/
50 
51 /*!
52  * \ingroup bsmod_null
53  * \defgroup bsmod_null_cli Client Interfaces
54  *
55  * The BotSense standard /dev/null client side interfaces provide APIs for C/C++
56  * and python applications.
57  *
58  * \{
59  */
60 
61 /*! \} */ /* end bsmod_null_cli */
62 
63 /*!
64  * \ingroup bsmod_null_cli
65  * \defgroup man_libbsclient_null libbsclient_null Man Pages
66  *
67  * The libbsclient_null library provides the functional API between
68  * client applications on one side and request-response messages to/from
69  * the \ref man_bsproxy "bsProxy" server on the other side.
70  * The \ref man_libbotsense "libbotsense" client library mediates the
71  * client-server session.
72  *
73  * \{
74  */
75 
76 /*!
77 \ingroup man_libbsclient_null
78 \defgroup man_bsNullGetMsgName bsNullGetMsgName
79 \par Synopsis:
80 <tt>
81 \#include "rnr/rnrconfig.h"\n
82 \#include "botsense/BotSense.h"\n
83 \#include "botsense/libBotSense.h"\n
84 \#include "botsense/bsNull.h"\n\n
85 const char * \ref bsNullGetMsgName(\ref BsClient_P pClient,
86  \ref BsVConnHnd_T hndVConn,
87  uint_t uMsgId);
88 </tt>
89 
90 <b>Description:</b>\n
91 \copydoc bsNullGetMsgName
92  */
93 
94 /*!
95 \ingroup man_libbsclient_null
96 \defgroup man_bsNullReqClose bsNullReqClose
97 \par Synopsis:
98 <tt>
99 \#include "rnr/rnrconfig.h"\n
100 \#include "botsense/BotSense.h"\n
101 \#include "botsense/libBotSense.h"\n
102 \#include "botsense/bsNull.h"\n\n
103 int \ref bsNullReqClose(\ref BsClient_P pClient,
104  \ref BsVConnHnd_T hndVConn);
105 </tt>
106 
107 <b>Description:</b>\n
108 \copydoc bsNullReqClose
109  */
110 
111 /*!
112 \ingroup man_libbsclient_null
113 \defgroup man_bsNullReqOpen bsNullReqOpen
114 \par Synopsis:
115 <tt>
116 \#include "rnr/rnrconfig.h"\n
117 \#include "botsense/BotSense.h"\n
118 \#include "botsense/libBotSense.h"\n
119 \#include "botsense/bsNull.h"\n\n
120 int \ref bsNullReqOpen(\ref BsClient_P pClient,
121  const char *sDevName,
122  bool_t bInitTrace);
123 </tt>
124 
125 <b>Description:</b>\n
126 \copydoc bsNullReqOpen
127  */
128 
129 /*!
130 \ingroup man_libbsclient_null
131 \defgroup man_bsNullReqWrite bsNullReqWrite
132 \par Synopsis:
133 <tt>
134 \#include "rnr/rnrconfig.h"\n
135 \#include "botsense/BotSense.h"\n
136 \#include "botsense/libBotSense.h"\n
137 \#include "botsense/bsNull.h"\n\n
138 int \ref bsNullReqWrite(\ref BsClient_P pClient,
139  \ref BsVConnHnd_T hndVConn,
140  byte_t wbuf[],
141  size_t uWriteLen);
142 </tt>
143 
144 <b>Description:</b>\n
145 \copydoc bsNullReqWrite
146  */
147 
148 /*! \} */ /* end bsmod_libbsclient_null */
149 
150 
151 /*!
152  * \ingroup bsmod_null_cli
153  * \defgroup bsNull_py BotSense.bsNull Python Module
154  *
155  * \{
156 The bsNull module under the BotSense python package provides python
157 applications an interface to communicate with proxied /dev/null devices.
158 The underlining compiled extension module _bsNull.so library provides the
159 provides the shim between python calling conventions and the C
160 libbsclient_null.[a,so] library.
161 
162 \sa \ref BotSense.bsNull
163 
164 \par Example:
165 \code
166 #
167 # Example use of BotSense.bsNull Module
168 #
169 
170 import sys
171 
172 import BotSense.BotSenseTypes as bsTypes
173 import BotSense.BotSenseError as bsError
174 import BotSense.BotSenseServer as bsServer
175 import BotSense.bsNull as bsNull
176 
177 # create a BotSense client
178 cli = bsTypes.BsClient('nullandvoid')
179 
180 # connect to the bsProxy server using default IP address and port
181 try:
182  bsServer.ServerConnect(cli)
183 except bsError.BotSenseError, inst:
184  print inst
185  sys.exit(8)
186 
187 # open a virtual connection to a proxied serial device
188 try:
189  hndVConn = bsNull.NullReqOpen(cli)
190 except bsError.BotSenseError, inst:
191  print inst
192  sys.exit(8)
193 print "Example: established virtual connection %d" % (hndVConn)
194 
195 bitbucket = [
196  'into the bit bucket',
197  ['a', 'b', 'c', 'd'],
198  'wheeee',
199  '\x01\x02\x03'
200 ]
201 
202 # write some data
203 for i in xrange(10):
204  j = i % len(bitbucket)
205  try:
206  n = bsNull.NullReqWrite(cli, hndVConn, bitbucket[j])
207  except bsError.BotSenseError, inst:
208  print inst
209  sys.exit(8)
210  print "Example: %d: %s written" % (i, repr(bitbucket[j][:n]))
211 
212 # close the virtual connection
213 try:
214  bsNull.NullReqClose(cli, hndVConn)
215 except bsError.BotSenseError, inst:
216  print inst
217  sys.exit(8)
218 
219 # close the connection to the bsProxy server
220 try:
221  bsServer.ServerDisconnect(cli)
222 except bsError.BotSenseError, inst:
223  print inst
224  sys.exit(8)
225 
226 # delete the client
227 del cli
228 \endcode
229  */
230 
231 /*! \} */ /* end bsNull_py */
232 
233 
234 /* ---------------------------------------------------------------------------
235  * Null Server
236  * --------------------------------------------------------------------------*/
237 
238 /*!
239  * \ingroup bsmod_null
240  * \defgroup bsmod_null_srv Server Plug-In
241  *
242  * BotSense \ref man_bsproxy "bsProxy" server plug-in DLL for proxied raw
243  * /dev/null devices.
244  *
245  * See \ref bsModules/bsNull/bsNullServer.c
246  *
247  * \{
248  */
249 
250 /*! \} */ /* end bsmod_null_srv */
251 
252 /*!
253  * \ingroup bsmod_null_srv
254  * \defgroup bsmod_null_srv_cfg Null Configuration
255  *
256  * The /dev/null plug-in XML configuration will be supported in BotSense v3.1.0.
257  * \{
258  */
259 
260 /*! \} */ /* end bsmod_null_srv_cfg */
261 
262 
263 /* ---------------------------------------------------------------------------
264  * Null XML
265  * --------------------------------------------------------------------------*/
266 
267 /*!
268  * \ingroup bsmod_null
269  * \defgroup bsmod_null_xml XML Message Set
270 
271 The bsNullMsgs.xml specification defines the set of messages
272 for BotSense virtual connections exstablished
273 between BotSense clients and raw /dev/null devices proxied by
274 the \ref bsserver "bsProxy" server.
275 
276 The /dev/null messages are terminated between the BotSense client
277 libbsclient_null.so shared library or libbsclient_null.a static library
278 and the bsProxy plug-in libbsserver_null.so interface module DLL.
279 
280 The message encoding is 8-bit Id-Type-Value (itv). All message fields are
281 packed in big-endian order.
282 
283 \include bsModules/bsNull/bsNullMsgs.xml
284 
285  */