21 #include "rnr/rnrconfig.h" 23 #include "rnr/netmsgs.h" 29 #define EOFDEF {NULL, 0, NMFTypeNone, 0, } 61 .m_eFType = NMFTypeU16,
63 .m_this.m_u16.m_bits = (byte_t)(0),
64 .m_this.m_u16.m_valMin = (ushort_t)(0),
65 .m_this.m_u16.m_valMax = (ushort_t)(0),
66 .m_this.m_u16.m_valConst = (ushort_t)(0),
69 .m_sFName =
"readlen",
71 .m_eFType = NMFTypeU8,
73 .m_this.m_u8.m_bits = (byte_t)(NMBITS_HAS_MIN|NMBITS_HAS_MAX),
74 .m_this.m_u8.m_valMin = (byte_t)(1),
75 .m_this.m_u8.m_valMax = (byte_t)(NMFVAL_LEN_MAX_VECTOR),
76 .m_this.m_u8.m_valConst = (byte_t)(0),
86 .m_sMsgName =
"BsI2CReqRead",
88 .m_uCount = (size_t)(2),
103 .m_sFName =
"writebuf",
105 .m_eFType = NMFTypeU8,
106 .m_uOffset = (size_t)0,
107 .m_this.m_u8.m_bits = (byte_t)(0),
108 .m_this.m_u8.m_valMin = (byte_t)(0),
109 .m_this.m_u8.m_valMax = (byte_t)(0),
110 .m_this.m_u8.m_valConst = (byte_t)(0),
135 .m_eFType = NMFTypeU16,
137 .m_this.m_u16.m_bits = (byte_t)(0),
138 .m_this.m_u16.m_valMin = (ushort_t)(0),
139 .m_this.m_u16.m_valMax = (ushort_t)(0),
140 .m_this.m_u16.m_valConst = (ushort_t)(0),
143 .m_sFName =
"writebuf",
145 .m_eFType = NMFTypeVector,
147 .m_this.m_vector.m_uMaxCount
149 .m_this.m_vector.m_uElemSize
151 .m_this.m_vector.m_pThisElem
155 .m_sFName =
"readlen",
157 .m_eFType = NMFTypeU8,
159 .m_this.m_u8.m_bits = (byte_t)(NMBITS_HAS_MIN|NMBITS_HAS_MAX),
160 .m_this.m_u8.m_valMin = (byte_t)(1),
161 .m_this.m_u8.m_valMax = (byte_t)(NMFVAL_LEN_MAX_VECTOR),
162 .m_this.m_u8.m_valConst = (byte_t)(0),
172 .m_sMsgName =
"BsI2CReqTrans",
174 .m_uCount = (size_t)(3),
189 .m_sFName =
"readbuf",
191 .m_eFType = NMFTypeU8,
192 .m_uOffset = (size_t)0,
193 .m_this.m_u8.m_bits = (byte_t)(0),
194 .m_this.m_u8.m_valMin = (byte_t)(0),
195 .m_this.m_u8.m_valMax = (byte_t)(0),
196 .m_this.m_u8.m_valConst = (byte_t)(0),
217 .m_sFName =
"readbuf",
219 .m_eFType = NMFTypeVector,
221 .m_this.m_vector.m_uMaxCount
223 .m_this.m_vector.m_uElemSize
225 .m_this.m_vector.m_pThisElem
236 .m_sMsgName =
"BsI2CRspRead",
238 .m_uCount = (size_t)(1),
253 .m_sFName =
"writebuf",
255 .m_eFType = NMFTypeU8,
256 .m_uOffset = (size_t)0,
257 .m_this.m_u8.m_bits = (byte_t)(0),
258 .m_this.m_u8.m_valMin = (byte_t)(0),
259 .m_this.m_u8.m_valMax = (byte_t)(0),
260 .m_this.m_u8.m_valConst = (byte_t)(0),
284 .m_eFType = NMFTypeU16,
286 .m_this.m_u16.m_bits = (byte_t)(0),
287 .m_this.m_u16.m_valMin = (ushort_t)(0),
288 .m_this.m_u16.m_valMax = (ushort_t)(0),
289 .m_this.m_u16.m_valConst = (ushort_t)(0),
292 .m_sFName =
"writebuf",
294 .m_eFType = NMFTypeVector,
296 .m_this.m_vector.m_uMaxCount
298 .m_this.m_vector.m_uElemSize
300 .m_this.m_vector.m_pThisElem
311 .m_sMsgName =
"BsI2CReqWrite",
313 .m_uCount = (size_t)(2),
338 .m_sFName =
"byteswritten",
340 .m_eFType = NMFTypeU8,
342 .m_this.m_u8.m_bits = (byte_t)(0),
343 .m_this.m_u8.m_valMin = (byte_t)(0),
344 .m_this.m_u8.m_valMax = (byte_t)(0),
345 .m_this.m_u8.m_valConst = (byte_t)(0),
355 .m_sMsgName =
"BsI2CRspWrite",
357 .m_uCount = (size_t)(1),
388 .m_sMsgName =
"BsI2CReqScan",
390 .m_uCount = (size_t)(0),
407 .m_eFType = NMFTypeU16,
408 .m_uOffset = (size_t)0,
409 .m_this.m_u16.m_bits = (byte_t)(0),
410 .m_this.m_u16.m_valMin = (ushort_t)(0),
411 .m_this.m_u16.m_valMax = (ushort_t)(0),
412 .m_this.m_u16.m_valConst = (ushort_t)(0),
435 .m_eFType = NMFTypeVector,
437 .m_this.m_vector.m_uMaxCount
439 .m_this.m_vector.m_uElemSize
441 .m_this.m_vector.m_pThisElem
452 .m_sMsgName =
"BsI2CRspScan",
454 .m_uCount = (size_t)(1),
565 const NMMsgDef_T *pMsgDef;
569 LOGERROR(
"%s(ecode=%d): msgid=%u.",
570 nmStrError(NM_ECODE_MSGID), NM_ECODE_MSGID, eMsgId);
571 return -NM_ECODE_MSGID;
576 return nmPackITVMsgDebug(pMsgDef, pStruct, buf, bufSize, NMEndianBig);
580 return nmPackITVMsg(pMsgDef, pStruct, buf, bufSize, NMEndianBig);
603 const NMMsgDef_T *pMsgDef;
607 LOGERROR(
"%s(ecode=%d): msgid=%u.",
608 nmStrError(NM_ECODE_MSGID), NM_ECODE_MSGID, eMsgId);
609 return -NM_ECODE_MSGID;
614 return nmUnpackITVMsgDebug(pMsgDef, buf, uMsgLen, pStruct, NMEndianBig);
618 return nmUnpackITVMsg(pMsgDef, buf, uMsgLen, pStruct, NMEndianBig);
static const NMMsgDef_T BsI2CReqReadMsgDef
static const NMFieldDef_T BsI2CReqScanFieldDefs[]
#define BSI2C_RSPSCAN_SCAN_LEN
static const NMFieldDef_T BsI2CReqWriteFieldDefs[]
static const NMMsgDef_T BsI2CReqWriteMsgDef
const NMMsgDef_T * BsI2CLookupMsgDef(BsI2CMsgId_T eMsgId)
Look up the message definition associated with the message id.
const NMMsgDef_T * BsI2CMsgDefLookupTbl[]
static const NMFieldDef_T BsI2CReqReadFieldDefs[]
static const NMFieldDef_T BsI2CRspScanscanFieldDef[]
static const NMFieldDef_T BsI2CRspReadreadbufFieldDef[]
int BsI2CUnpackMsg(BsI2CMsgId_T eMsgId, byte_t buf[], size_t uMsgLen, void *pStruct, bool_t bTrace)
Unpack a ITV message in big-endian byte order.
static const NMFieldDef_T BsI2CReqWritewritebufFieldDef[]
static const NMFieldDef_T BsI2CRspWriteFieldDefs[]
BotSense bsProxy server - client raw I2C NetMsgs XML Definition.
static const NMMsgDef_T BsI2CRspReadMsgDef
static const NMMsgDef_T BsI2CRspWriteMsgDef
static const NMMsgDef_T BsI2CReqScanMsgDef
size_t BsI2CLookupMsgMaxLen(BsI2CMsgId_T eMsgId)
Look up the message maximum length associated with the message id.
static const NMFieldDef_T BsI2CRspScanFieldDefs[]
int BsI2CPackMsg(BsI2CMsgId_T eMsgId, void *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a ITV message in big-endian byte order.
#define BSI2C_REQTRANS_WRITEBUF_LEN
static const NMMsgDef_T BsI2CReqTransMsgDef
static const NMFieldDef_T BsI2CRspReadFieldDefs[]
#define BSI2C_RSPREAD_READBUF_LEN
#define BSI2C_REQWRITE_WRITEBUF_LEN
static const NMFieldDef_T BsI2CReqTranswritebufFieldDef[]
static const NMMsgDef_T BsI2CRspScanMsgDef
size_t BsI2CMsgMaxLenLookupTbl[]
static const NMFieldDef_T BsI2CReqTransFieldDefs[]