botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
bsI2CMsgs.py
Go to the documentation of this file.
1 ##############################################################################
2 #
3 # File: bsI2CMsgs.py
4 #
5 
6 """
7 bsI2CMsgs.py
8 """
9 
10 ## \file
11 ##
12 ## \brief BotSense bsProxy server - client raw I2C NetMsgs XML Definition
13 ##
14 ## \warning This file was auto-generated on 2018.08.10 13:54:23 from the NetMsgs
15 ## XML specification bsI2CMsgs.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 # BsI2C Message Id Enumeration
34 # -----------------------------------------------------------------------------
35 
36 class BsI2CMsgId:
37  """ BsI2C Message Id Enumeration class. """
38  NoId = 0 # no message id
39  ReqRead = 1 # ReqRead
40  ReqTrans = 2 # ReqTrans
41  RspRead = 3 # RspRead
42  ReqWrite = 4 # ReqWrite
43  RspWrite = 5 # RspWrite
44  ReqScan = 6 # ReqScan
45  RspScan = 7 # RspScan
46  NumOf = 8 # number of message ids
47 ##
48 
49 
50 # -----------------------------------------------------------------------------
51 # Message Definition Set
52 # -----------------------------------------------------------------------------
53 
54 ## ReqRead Message Definition
55 BsI2CMsgDefReqRead = {
56  'fielddef': [
57  {'fid':1, 'ftype':'H', 'max_count':1, 'name':'addr', },
58  {
59  'fid': 2,
60  'ftype': 'B',
61  'max': NMFVAL_LEN_MAX_VECTOR,
62  'max_count': 1,
63  'min': 1,
64  'name': 'readlen',
65  },
66  ],
67  'ftype': '{',
68  'max_count': 2,
69  'msgid': BsI2CMsgId.ReqRead,
70  'name': 'ReqRead',
71 }
72 ##
73 
74 ## ReqTrans Message Definition
75 BsI2CMsgDefReqTrans = {
76  'fielddef': [
77  {'fid':1, 'ftype':'H', 'max_count':1, 'name':'addr', },
78  {
79  'fid': 2,
80  'ftype': '[',
81  'max_count': nmBase.NMVectorMaxCount,
82  'name': 'writebuf',
83  'vdef': {
84  'fid': nmBase.NMFIdNone,
85  'ftype': 'B',
86  'max_count': 1,
87  'name': 'writebuf_item',
88  },
89  },
90  {
91  'fid': 3,
92  'ftype': 'B',
93  'max': NMFVAL_LEN_MAX_VECTOR,
94  'max_count': 1,
95  'min': 1,
96  'name': 'readlen',
97  },
98  ],
99  'ftype': '{',
100  'max_count': 3,
101  'msgid': BsI2CMsgId.ReqTrans,
102  'name': 'ReqTrans',
103 }
104 ##
105 
106 ## RspRead Message Definition
107 BsI2CMsgDefRspRead = {
108  'fielddef': [
109  {
110  'fid': 1,
111  'ftype': '[',
112  'max_count': nmBase.NMVectorMaxCount,
113  'name': 'readbuf',
114  'vdef': {
115  'fid': nmBase.NMFIdNone,
116  'ftype': 'B',
117  'max_count': 1,
118  'name': 'readbuf_item',
119  },
120  },
121  ],
122  'ftype': '{',
123  'max_count': 1,
124  'msgid': BsI2CMsgId.RspRead,
125  'name': 'RspRead',
126 }
127 ##
128 
129 ## ReqWrite Message Definition
130 BsI2CMsgDefReqWrite = {
131  'fielddef': [
132  {'fid':1, 'ftype':'H', 'max_count':1, 'name':'addr', },
133  {
134  'fid': 2,
135  'ftype': '[',
136  'max_count': nmBase.NMVectorMaxCount,
137  'name': 'writebuf',
138  'vdef': {
139  'fid': nmBase.NMFIdNone,
140  'ftype': 'B',
141  'max_count': 1,
142  'name': 'writebuf_item',
143  },
144  },
145  ],
146  'ftype': '{',
147  'max_count': 2,
148  'msgid': BsI2CMsgId.ReqWrite,
149  'name': 'ReqWrite',
150 }
151 ##
152 
153 ## RspWrite Message Definition
154 BsI2CMsgDefRspWrite = {
155  'fielddef': [
156  {'fid':1, 'ftype':'B', 'max_count':1, 'name':'byteswritten', },
157  ],
158  'ftype': '{',
159  'max_count': 1,
160  'msgid': BsI2CMsgId.RspWrite,
161  'name': 'RspWrite',
162 }
163 ##
164 
165 ## ReqScan Message Definition
166 BsI2CMsgDefReqScan = {
167  'fielddef': [ ],
168  'ftype': '{',
169  'max_count': 0,
170  'msgid': BsI2CMsgId.ReqScan,
171  'name': 'ReqScan',
172 }
173 ##
174 
175 ## RspScan Message Definition
176 BsI2CMsgDefRspScan = {
177  'fielddef': [
178  {
179  'fid': 1,
180  'ftype': '[',
181  'max_count': nmBase.NMVectorMaxCount,
182  'name': 'scan',
183  'vdef': {
184  'fid': nmBase.NMFIdNone,
185  'ftype': 'H',
186  'max_count': 1,
187  'name': 'scan_item',
188  },
189  },
190  ],
191  'ftype': '{',
192  'max_count': 1,
193  'msgid': BsI2CMsgId.RspScan,
194  'name': 'RspScan',
195 }
196 ##
197 
198 ## BsI2C Message Definition Set Dictionary
199 BsI2CSetMsgDef = {
200  BsI2CMsgId.ReqRead: BsI2CMsgDefReqRead,
201  BsI2CMsgId.ReqScan: BsI2CMsgDefReqScan,
202  BsI2CMsgId.ReqTrans: BsI2CMsgDefReqTrans,
203  BsI2CMsgId.ReqWrite: BsI2CMsgDefReqWrite,
204  BsI2CMsgId.RspRead: BsI2CMsgDefRspRead,
205  BsI2CMsgId.RspScan: BsI2CMsgDefRspScan,
206  BsI2CMsgId.RspWrite: BsI2CMsgDefRspWrite,
207 }
208 ##
209 
210 
211 # -----------------------------------------------------------------------------
212 # CLASS: BsI2CNetMsgs
213 # -----------------------------------------------------------------------------
214 
215 class BsI2CNetMsgs(NetMsgsITV):
216  """ BsI2C NetMsgs Class. """
217 
218  #--
219  def __init__(self, **kwargs):
220  """ BsI2C NetMsgs initialization. """
221  kwargs['msgsetname'] = 'BsI2CMsgSet'
222  NetMsgsITV.__init__(self, BsI2CSetMsgDef, **kwargs)
223  ##
224 ##
def __init__(self, kwargs)
Definition: bsI2CMsgs.py:219