21 #include "rnr/rnrconfig.h" 23 #include "rnr/netmsgs.h" 29 #define EOFDEF {NULL, 0, NMFTypeNone, 0, } 63 .m_sFName =
"baudrate",
65 .m_eFType = NMFTypeU32,
67 .m_this.m_u32.m_bits = (byte_t)(0),
68 .m_this.m_u32.m_valMin = (uint_t)(0),
69 .m_this.m_u32.m_valMax = (uint_t)(0),
70 .m_this.m_u32.m_valConst = (uint_t)(0),
73 .m_sFName =
"bytesize",
75 .m_eFType = NMFTypeU8,
77 .m_this.m_u8.m_bits = (byte_t)(0),
78 .m_this.m_u8.m_valMin = (byte_t)(0),
79 .m_this.m_u8.m_valMax = (byte_t)(0),
80 .m_this.m_u8.m_valConst = (byte_t)(0),
85 .m_eFType = NMFTypeChar,
89 .m_sFName =
"stopbits",
91 .m_eFType = NMFTypeU8,
93 .m_this.m_u8.m_bits = (byte_t)(0),
94 .m_this.m_u8.m_valMin = (byte_t)(0),
95 .m_this.m_u8.m_valMax = (byte_t)(0),
96 .m_this.m_u8.m_valConst = (byte_t)(0),
101 .m_eFType = NMFTypeBool,
105 .m_sFName =
"xonxoff",
107 .m_eFType = NMFTypeBool,
118 .m_sMsgName =
"BsSerialReqOpenArgs",
120 .m_uCount = (size_t)(6),
145 .m_sFName =
"readlen",
147 .m_eFType = NMFTypeU8,
149 .m_this.m_u8.m_bits = (byte_t)(NMBITS_HAS_MIN|NMBITS_HAS_MAX),
150 .m_this.m_u8.m_valMin = (byte_t)(1),
151 .m_this.m_u8.m_valMax = (byte_t)(NMFVAL_LEN_MAX_VECTOR),
152 .m_this.m_u8.m_valConst = (byte_t)(0),
162 .m_sMsgName =
"BsSerialReqRead",
164 .m_uCount = (size_t)(1),
179 .m_sFName =
"writebuf",
181 .m_eFType = NMFTypeU8,
182 .m_uOffset = (size_t)0,
183 .m_this.m_u8.m_bits = (byte_t)(0),
184 .m_this.m_u8.m_valMin = (byte_t)(0),
185 .m_this.m_u8.m_valMax = (byte_t)(0),
186 .m_this.m_u8.m_valConst = (byte_t)(0),
208 .m_sFName =
"writebuf",
210 .m_eFType = NMFTypeVector,
212 .m_this.m_vector.m_uMaxCount
214 .m_this.m_vector.m_uElemSize
216 .m_this.m_vector.m_pThisElem
220 .m_sFName =
"readlen",
222 .m_eFType = NMFTypeU8,
224 .m_this.m_u8.m_bits = (byte_t)(NMBITS_HAS_MIN|NMBITS_HAS_MAX),
225 .m_this.m_u8.m_valMin = (byte_t)(1),
226 .m_this.m_u8.m_valMax = (byte_t)(NMFVAL_LEN_MAX_VECTOR),
227 .m_this.m_u8.m_valConst = (byte_t)(0),
237 .m_sMsgName =
"BsSerialReqTrans",
239 .m_uCount = (size_t)(2),
254 .m_sFName =
"readbuf",
256 .m_eFType = NMFTypeU8,
257 .m_uOffset = (size_t)0,
258 .m_this.m_u8.m_bits = (byte_t)(0),
259 .m_this.m_u8.m_valMin = (byte_t)(0),
260 .m_this.m_u8.m_valMax = (byte_t)(0),
261 .m_this.m_u8.m_valConst = (byte_t)(0),
282 .m_sFName =
"readbuf",
284 .m_eFType = NMFTypeVector,
286 .m_this.m_vector.m_uMaxCount
288 .m_this.m_vector.m_uElemSize
290 .m_this.m_vector.m_pThisElem
301 .m_sMsgName =
"BsSerialRspRead",
303 .m_uCount = (size_t)(1),
318 .m_sFName =
"writebuf",
320 .m_eFType = NMFTypeU8,
321 .m_uOffset = (size_t)0,
322 .m_this.m_u8.m_bits = (byte_t)(0),
323 .m_this.m_u8.m_valMin = (byte_t)(0),
324 .m_this.m_u8.m_valMax = (byte_t)(0),
325 .m_this.m_u8.m_valConst = (byte_t)(0),
346 .m_sFName =
"writebuf",
348 .m_eFType = NMFTypeVector,
350 .m_this.m_vector.m_uMaxCount
352 .m_this.m_vector.m_uElemSize
354 .m_this.m_vector.m_pThisElem
365 .m_sMsgName =
"BsSerialReqWrite",
367 .m_uCount = (size_t)(1),
392 .m_sFName =
"byteswritten",
394 .m_eFType = NMFTypeU8,
396 .m_this.m_u8.m_bits = (byte_t)(0),
397 .m_this.m_u8.m_valMin = (byte_t)(0),
398 .m_this.m_u8.m_valMax = (byte_t)(0),
399 .m_this.m_u8.m_valConst = (byte_t)(0),
409 .m_sMsgName =
"BsSerialRspWrite",
411 .m_uCount = (size_t)(1),
520 const NMMsgDef_T *pMsgDef;
524 LOGERROR(
"%s(ecode=%d): msgid=%u.",
525 nmStrError(NM_ECODE_MSGID), NM_ECODE_MSGID, eMsgId);
526 return -NM_ECODE_MSGID;
531 return nmPackITVMsgDebug(pMsgDef, pStruct, buf, bufSize, NMEndianBig);
535 return nmPackITVMsg(pMsgDef, pStruct, buf, bufSize, NMEndianBig);
558 const NMMsgDef_T *pMsgDef;
562 LOGERROR(
"%s(ecode=%d): msgid=%u.",
563 nmStrError(NM_ECODE_MSGID), NM_ECODE_MSGID, eMsgId);
564 return -NM_ECODE_MSGID;
569 return nmUnpackITVMsgDebug(pMsgDef, buf, uMsgLen, pStruct, NMEndianBig);
573 return nmUnpackITVMsg(pMsgDef, buf, uMsgLen, pStruct, NMEndianBig);
const NMMsgDef_T * BsSerialMsgDefLookupTbl[]
static const NMFieldDef_T BsSerialRspReadFieldDefs[]
int BsSerialUnpackMsg(BsSerialMsgId_T eMsgId, byte_t buf[], size_t uMsgLen, void *pStruct, bool_t bTrace)
Unpack a ITV message in big-endian byte order.
static const NMMsgDef_T BsSerialRspReadMsgDef
size_t BsSerialLookupMsgMaxLen(BsSerialMsgId_T eMsgId)
Look up the message maximum length associated with the message id.
static const NMFieldDef_T BsSerialReqWriteFieldDefs[]
static const NMMsgDef_T BsSerialReqTransMsgDef
#define BSSERIAL_REQTRANS_WRITEBUF_LEN
static const NMFieldDef_T BsSerialReqReadFieldDefs[]
BotSense bsProxy server - client raw serial NetMsgs XML Definition.
#define BSSERIAL_REQWRITE_WRITEBUF_LEN
static const NMFieldDef_T BsSerialRspWriteFieldDefs[]
static const NMFieldDef_T BsSerialReqTranswritebufFieldDef[]
static const NMFieldDef_T BsSerialReqWritewritebufFieldDef[]
int BsSerialPackMsg(BsSerialMsgId_T eMsgId, void *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a ITV message in big-endian byte order.
static const NMFieldDef_T BsSerialReqOpenArgsFieldDefs[]
static const NMFieldDef_T BsSerialRspReadreadbufFieldDef[]
static const NMMsgDef_T BsSerialReqOpenArgsMsgDef
static const NMFieldDef_T BsSerialReqTransFieldDefs[]
size_t BsSerialMsgMaxLenLookupTbl[]
static const NMMsgDef_T BsSerialReqReadMsgDef
const NMMsgDef_T * BsSerialLookupMsgDef(BsSerialMsgId_T eMsgId)
Look up the message definition associated with the message id.
static const NMMsgDef_T BsSerialRspWriteMsgDef
static const NMMsgDef_T BsSerialReqWriteMsgDef
#define BSSERIAL_RSPREAD_READBUF_LEN