botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
bsSerialMsgs.py
Go to the documentation of this file.
1 ##############################################################################
2 #
3 # File: bsSerialMsgs.py
4 #
5 
6 """
7 bsSerialMsgs.py
8 """
9 
10 ## \file
11 ##
12 ## \brief BotSense bsProxy server - client raw serial NetMsgs XML Definition
13 ##
14 ## \warning This file was auto-generated on 2018.08.10 13:54:23 from the NetMsgs
15 ## XML specification bsSerialMsgs.xml.
16 ##
17 ## \par Copyright:
18 ## (C) 2018. RoadNarrows LLC
19 ## (http://www.roadnarrows.com)
20 ## All Rights Reserved
21 ##
22 ##############################################################################
23 
24 
25 import NetMsgs.NetMsgsBase as nmBase
26 from NetMsgs.NetMsgsLibITV import NetMsgsITV
27 
28 ## maximum vector length
29 NMFVAL_LEN_MAX_VECTOR = nmBase.NMVectorMaxCount
30 
31 
32 # -----------------------------------------------------------------------------
33 # BsSerial Message Id Enumeration
34 # -----------------------------------------------------------------------------
35 
37  """ BsSerial Message Id Enumeration class. """
38  NoId = 0 # no message id
39  ReqOpenArgs = 1 # ReqOpenArgs
40  ReqRead = 2 # ReqRead
41  ReqTrans = 3 # ReqTrans
42  RspRead = 4 # RspRead
43  ReqWrite = 5 # ReqWrite
44  RspWrite = 6 # RspWrite
45  NumOf = 7 # number of message ids
46 ##
47 
48 
49 # -----------------------------------------------------------------------------
50 # Message Definition Set
51 # -----------------------------------------------------------------------------
52 
53 ## ReqOpenArgs Message Definition
54 BsSerialMsgDefReqOpenArgs = {
55  'fielddef': [
56  {'fid':1, 'ftype':'I', 'max_count':1, 'name':'baudrate', },
57  {'fid':2, 'ftype':'B', 'max_count':1, 'name':'bytesize', },
58  {'fid':3, 'ftype':'c', 'max_count':1, 'name':'parity', },
59  {'fid':4, 'ftype':'B', 'max_count':1, 'name':'stopbits', },
60  {'fid':5, 'ftype':'?', 'max_count':1, 'name':'rtscts', },
61  {'fid':6, 'ftype':'?', 'max_count':1, 'name':'xonxoff', },
62  ],
63  'ftype': '{',
64  'max_count': 6,
65  'msgid': BsSerialMsgId.ReqOpenArgs,
66  'name': 'ReqOpenArgs',
67 }
68 ##
69 
70 ## ReqRead Message Definition
71 BsSerialMsgDefReqRead = {
72  'fielddef': [
73  {
74  'fid': 1,
75  'ftype': 'B',
76  'max': NMFVAL_LEN_MAX_VECTOR,
77  'max_count': 1,
78  'min': 1,
79  'name': 'readlen',
80  },
81  ],
82  'ftype': '{',
83  'max_count': 1,
84  'msgid': BsSerialMsgId.ReqRead,
85  'name': 'ReqRead',
86 }
87 ##
88 
89 ## ReqTrans Message Definition
90 BsSerialMsgDefReqTrans = {
91  'fielddef': [
92  {
93  'fid': 1,
94  'ftype': '[',
95  'max_count': nmBase.NMVectorMaxCount,
96  'name': 'writebuf',
97  'vdef': {
98  'fid': nmBase.NMFIdNone,
99  'ftype': 'B',
100  'max_count': 1,
101  'name': 'writebuf_item',
102  },
103  },
104  {
105  'fid': 2,
106  'ftype': 'B',
107  'max': NMFVAL_LEN_MAX_VECTOR,
108  'max_count': 1,
109  'min': 1,
110  'name': 'readlen',
111  },
112  ],
113  'ftype': '{',
114  'max_count': 2,
115  'msgid': BsSerialMsgId.ReqTrans,
116  'name': 'ReqTrans',
117 }
118 ##
119 
120 ## RspRead Message Definition
121 BsSerialMsgDefRspRead = {
122  'fielddef': [
123  {
124  'fid': 1,
125  'ftype': '[',
126  'max_count': nmBase.NMVectorMaxCount,
127  'name': 'readbuf',
128  'vdef': {
129  'fid': nmBase.NMFIdNone,
130  'ftype': 'B',
131  'max_count': 1,
132  'name': 'readbuf_item',
133  },
134  },
135  ],
136  'ftype': '{',
137  'max_count': 1,
138  'msgid': BsSerialMsgId.RspRead,
139  'name': 'RspRead',
140 }
141 ##
142 
143 ## ReqWrite Message Definition
144 BsSerialMsgDefReqWrite = {
145  'fielddef': [
146  {
147  'fid': 1,
148  'ftype': '[',
149  'max_count': nmBase.NMVectorMaxCount,
150  'name': 'writebuf',
151  'vdef': {
152  'fid': nmBase.NMFIdNone,
153  'ftype': 'B',
154  'max_count': 1,
155  'name': 'writebuf_item',
156  },
157  },
158  ],
159  'ftype': '{',
160  'max_count': 1,
161  'msgid': BsSerialMsgId.ReqWrite,
162  'name': 'ReqWrite',
163 }
164 ##
165 
166 ## RspWrite Message Definition
167 BsSerialMsgDefRspWrite = {
168  'fielddef': [
169  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'byteswritten', },
170  ],
171  'ftype': '{',
172  'max_count': 1,
173  'msgid': BsSerialMsgId.RspWrite,
174  'name': 'RspWrite',
175 }
176 ##
177 
178 ## BsSerial Message Definition Set Dictionary
179 BsSerialSetMsgDef = {
180  BsSerialMsgId.ReqOpenArgs: BsSerialMsgDefReqOpenArgs,
181  BsSerialMsgId.ReqRead: BsSerialMsgDefReqRead,
182  BsSerialMsgId.ReqTrans: BsSerialMsgDefReqTrans,
183  BsSerialMsgId.ReqWrite: BsSerialMsgDefReqWrite,
184  BsSerialMsgId.RspRead: BsSerialMsgDefRspRead,
185  BsSerialMsgId.RspWrite: BsSerialMsgDefRspWrite,
186 }
187 ##
188 
189 
190 # -----------------------------------------------------------------------------
191 # CLASS: BsSerialNetMsgs
192 # -----------------------------------------------------------------------------
193 
194 class BsSerialNetMsgs(NetMsgsITV):
195  """ BsSerial NetMsgs Class. """
196 
197  #--
198  def __init__(self, **kwargs):
199  """ BsSerial NetMsgs initialization. """
200  kwargs['msgsetname'] = 'BsSerialMsgSet'
201  NetMsgsITV.__init__(self, BsSerialSetMsgDef, **kwargs)
202  ##
203 ##