botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
bsI2CMsgs.h File Reference

BotSense bsProxy server - client raw I2C NetMsgs XML Definition. More...

#include "rnr/rnrconfig.h"
#include "rnr/netmsgs.h"
#include "rnr/i2c-dev.h"
#include "botsense/BotSense.h"

Go to the source code of this file.

Classes

struct  BsI2CReqRead_T
 
struct  BsI2CReqTrans_T
 
struct  BsI2CRspRead_T
 
struct  BsI2CReqWrite_T
 
struct  BsI2CRspWrite_T
 
struct  BsI2CRspScan_T
 

Macros

#define BSI2C_REQTRANS_WRITEBUF_LEN   (NMFVAL_LEN_MAX_VECTOR)
 
#define BSI2C_RSPREAD_READBUF_LEN   (NMFVAL_LEN_MAX_VECTOR)
 
#define BSI2C_REQWRITE_WRITEBUF_LEN   (NMFVAL_LEN_MAX_VECTOR)
 
#define BSI2C_RSPSCAN_SCAN_LEN   (NMFVAL_LEN_MAX_VECTOR)
 

Enumerations

enum  BsI2CMsgId_T {
  BsI2CMsgIdNone = 0,
  BsI2CMsgIdReqRead = 1,
  BsI2CMsgIdReqTrans = 2,
  BsI2CMsgIdRspRead = 3,
  BsI2CMsgIdReqWrite = 4,
  BsI2CMsgIdRspWrite = 5,
  BsI2CMsgIdReqScan = 6,
  BsI2CMsgIdRspScan = 7,
  BsI2CMsgIdNumOf = 8
}
 

Functions

const NMMsgDef_T * BsI2CLookupMsgDef (BsI2CMsgId_T eMsgId)
 Look up the message definition associated with the message id. More...
 
size_t BsI2CLookupMsgMaxLen (BsI2CMsgId_T eMsgId)
 Look up the message maximum length associated with the message id. More...
 
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. More...
 
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. More...
 
INLINE_IN_H int BsI2CPackReqRead (BsI2CReqRead_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
 Pack a BsI2CReqRead ITV message in big-endian byte order into the output buffer. More...
 
INLINE_IN_H int BsI2CUnpackReqRead (byte_t buf[], size_t uMsgLen, BsI2CReqRead_T *pStruct, bool_t bTrace)
 Unpack a BsI2CReqRead ITV message in big-endian byte order from the input buffer. More...
 
INLINE_IN_H int BsI2CPackReqTrans (BsI2CReqTrans_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
 Pack a BsI2CReqTrans ITV message in big-endian byte order into the output buffer. More...
 
INLINE_IN_H int BsI2CUnpackReqTrans (byte_t buf[], size_t uMsgLen, BsI2CReqTrans_T *pStruct, bool_t bTrace)
 Unpack a BsI2CReqTrans ITV message in big-endian byte order from the input buffer. More...
 
INLINE_IN_H int BsI2CPackRspRead (BsI2CRspRead_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
 Pack a BsI2CRspRead ITV message in big-endian byte order into the output buffer. More...
 
INLINE_IN_H int BsI2CUnpackRspRead (byte_t buf[], size_t uMsgLen, BsI2CRspRead_T *pStruct, bool_t bTrace)
 Unpack a BsI2CRspRead ITV message in big-endian byte order from the input buffer. More...
 
INLINE_IN_H int BsI2CPackReqWrite (BsI2CReqWrite_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
 Pack a BsI2CReqWrite ITV message in big-endian byte order into the output buffer. More...
 
INLINE_IN_H int BsI2CUnpackReqWrite (byte_t buf[], size_t uMsgLen, BsI2CReqWrite_T *pStruct, bool_t bTrace)
 Unpack a BsI2CReqWrite ITV message in big-endian byte order from the input buffer. More...
 
INLINE_IN_H int BsI2CPackRspWrite (BsI2CRspWrite_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
 Pack a BsI2CRspWrite ITV message in big-endian byte order into the output buffer. More...
 
INLINE_IN_H int BsI2CUnpackRspWrite (byte_t buf[], size_t uMsgLen, BsI2CRspWrite_T *pStruct, bool_t bTrace)
 Unpack a BsI2CRspWrite ITV message in big-endian byte order from the input buffer. More...
 
INLINE_IN_H int BsI2CPackRspScan (BsI2CRspScan_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
 Pack a BsI2CRspScan ITV message in big-endian byte order into the output buffer. More...
 
INLINE_IN_H int BsI2CUnpackRspScan (byte_t buf[], size_t uMsgLen, BsI2CRspScan_T *pStruct, bool_t bTrace)
 Unpack a BsI2CRspScan ITV message in big-endian byte order from the input buffer. More...
 

Variables

const NMMsgDef_T * BsI2CMsgDefLookupTbl []
 
size_t BsI2CMsgMaxLenLookupTbl []
 

Detailed Description

BotSense bsProxy server - client raw I2C NetMsgs XML Definition.

Warning
This file was auto-generated on 2018.08.10 13:54:23 from the NetMsgs XML specification bsI2CMsgs.xml.
Copyright:
(C) 2018. RoadNarrows LLC (http://www.roadnarrows.com) All Rights Reserved

Definition in file bsI2CMsgs.h.

Macro Definition Documentation

#define BSI2C_REQTRANS_WRITEBUF_LEN   (NMFVAL_LEN_MAX_VECTOR)

ReqTrans writebuf maximum vector length

Definition at line 75 of file bsI2CMsgs.h.

Referenced by bsI2CReqTrans().

#define BSI2C_REQWRITE_WRITEBUF_LEN   (NMFVAL_LEN_MAX_VECTOR)

ReqWrite writebuf maximum vector length

Definition at line 127 of file bsI2CMsgs.h.

Referenced by bsI2CReqWrite().

#define BSI2C_RSPREAD_READBUF_LEN   (NMFVAL_LEN_MAX_VECTOR)

RspRead readbuf maximum vector length

Definition at line 102 of file bsI2CMsgs.h.

Referenced by bsI2CReqRead(), and bsI2CReqTrans().

#define BSI2C_RSPSCAN_SCAN_LEN   (NMFVAL_LEN_MAX_VECTOR)

RspScan scan maximum vector length

Definition at line 166 of file bsI2CMsgs.h.

Referenced by bsModI2CScanCallback().

Enumeration Type Documentation

BsI2C Message Id Enumeration

Enumerator
BsI2CMsgIdNone 

no message

BsI2CMsgIdReqRead 

ReqRead.

BsI2CMsgIdReqTrans 

ReqTrans.

BsI2CMsgIdRspRead 

RspRead.

BsI2CMsgIdReqWrite 

ReqWrite.

BsI2CMsgIdRspWrite 

RspWrite.

BsI2CMsgIdReqScan 

ReqScan.

BsI2CMsgIdRspScan 

RspScan.

BsI2CMsgIdNumOf 

number of message ids

Definition at line 37 of file bsI2CMsgs.h.

38 {
39  BsI2CMsgIdNone = 0, ///< no message
40  BsI2CMsgIdReqRead = 1, ///< ReqRead
41  BsI2CMsgIdReqTrans = 2, ///< ReqTrans
42  BsI2CMsgIdRspRead = 3, ///< RspRead
43  BsI2CMsgIdReqWrite = 4, ///< ReqWrite
44  BsI2CMsgIdRspWrite = 5, ///< RspWrite
45  BsI2CMsgIdReqScan = 6, ///< ReqScan
46  BsI2CMsgIdRspScan = 7, ///< RspScan
47  BsI2CMsgIdNumOf = 8 ///< number of message ids
48 } BsI2CMsgId_T;
RspRead.
Definition: bsI2CMsgs.h:42
RspScan.
Definition: bsI2CMsgs.h:46
ReqRead.
Definition: bsI2CMsgs.h:40
number of message ids
Definition: bsI2CMsgs.h:47
BsI2CMsgId_T
Definition: bsI2CMsgs.h:37
ReqTrans.
Definition: bsI2CMsgs.h:41
RspWrite.
Definition: bsI2CMsgs.h:44
ReqScan.
Definition: bsI2CMsgs.h:45
ReqWrite.
Definition: bsI2CMsgs.h:43
no message
Definition: bsI2CMsgs.h:39

Function Documentation

const NMMsgDef_T* BsI2CLookupMsgDef ( BsI2CMsgId_T  eMsgId)

Look up the message definition associated with the message id.

Parameters
eMsgIdMessage Id.
Returns
On success, returns the pointer to the NMMsgDef_T. On error, NULL is returned.

Definition at line 509 of file bsI2CMsgs.c.

References BsI2CMsgDefLookupTbl, and BsI2CMsgIdNumOf.

Referenced by bsI2CGetMsgName(), BsI2CPackMsg(), and BsI2CUnpackMsg().

510 {
511  if( (uint_t)eMsgId >= (uint_t)BsI2CMsgIdNumOf )
512  {
513  return NULL;
514  }
515  else
516  {
517  return BsI2CMsgDefLookupTbl[(uint_t)eMsgId];
518  }
519 }
const NMMsgDef_T * BsI2CMsgDefLookupTbl[]
Definition: bsI2CMsgs.c:466
number of message ids
Definition: bsI2CMsgs.h:47
size_t BsI2CLookupMsgMaxLen ( BsI2CMsgId_T  eMsgId)

Look up the message maximum length associated with the message id.

The maximum length is the total number of packed bytes possible for the given message. The message may be much shorter.

Parameters
eMsgIdMessage Id.
Returns
On success, returns the number of bytes. On error, 0 is returned.

Definition at line 533 of file bsI2CMsgs.c.

References BsI2CMsgIdNumOf, and BsI2CMsgMaxLenLookupTbl.

534 {
535  if( (uint_t)eMsgId >= (uint_t)BsI2CMsgIdNumOf )
536  {
537  return (size_t)0;
538  }
539  else
540  {
541  return BsI2CMsgMaxLenLookupTbl[(uint_t)eMsgId];
542  }
543 }
number of message ids
Definition: bsI2CMsgs.h:47
size_t BsI2CMsgMaxLenLookupTbl[]
Definition: bsI2CMsgs.c:482
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.

Parameters
eMsgIdMessage Id.
[in]pStructPointer to the associated, populated message structure.
[out]bufOutput message buffer.
bufSizeSize of output buffer.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes packed. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 559 of file bsI2CMsgs.c.

References BsI2CLookupMsgDef().

Referenced by BsI2CPackReqRead(), BsI2CPackReqTrans(), BsI2CPackReqWrite(), BsI2CPackRspRead(), BsI2CPackRspScan(), and BsI2CPackRspWrite().

564 {
565  const NMMsgDef_T *pMsgDef;
566 
567  if( (pMsgDef = BsI2CLookupMsgDef(eMsgId)) == NULL )
568  {
569  LOGERROR("%s(ecode=%d): msgid=%u.",
570  nmStrError(NM_ECODE_MSGID), NM_ECODE_MSGID, eMsgId);
571  return -NM_ECODE_MSGID;
572  }
573 
574  if( bTrace )
575  {
576  return nmPackITVMsgDebug(pMsgDef, pStruct, buf, bufSize, NMEndianBig);
577  }
578  else
579  {
580  return nmPackITVMsg(pMsgDef, pStruct, buf, bufSize, NMEndianBig);
581  }
582 }
const NMMsgDef_T * BsI2CLookupMsgDef(BsI2CMsgId_T eMsgId)
Look up the message definition associated with the message id.
Definition: bsI2CMsgs.c:509
INLINE_IN_H int BsI2CPackReqRead ( BsI2CReqRead_T pStruct,
byte_t  buf[],
size_t  bufSize,
bool_t  bTrace 
)

Pack a BsI2CReqRead ITV message in big-endian byte order into the output buffer.

Parameters
[in]pStructPointer to the associated, populated message structure.
[out]bufOutput message buffer.
bufSizeSize of output buffer.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes packed. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 237 of file bsI2CMsgs.h.

References BsI2CMsgIdReqRead, and BsI2CPackMsg().

Referenced by bsI2CReqRead().

241 {
242  return BsI2CPackMsg(BsI2CMsgIdReqRead, pStruct, buf, bufSize, bTrace);
243 }
ReqRead.
Definition: bsI2CMsgs.h:40
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.
Definition: bsI2CMsgs.c:559
INLINE_IN_H int BsI2CPackReqTrans ( BsI2CReqTrans_T pStruct,
byte_t  buf[],
size_t  bufSize,
bool_t  bTrace 
)

Pack a BsI2CReqTrans ITV message in big-endian byte order into the output buffer.

Parameters
[in]pStructPointer to the associated, populated message structure.
[out]bufOutput message buffer.
bufSizeSize of output buffer.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes packed. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 280 of file bsI2CMsgs.h.

References BsI2CMsgIdReqTrans, and BsI2CPackMsg().

Referenced by bsI2CReqTrans().

284 {
285  return BsI2CPackMsg(BsI2CMsgIdReqTrans, pStruct, buf, bufSize, bTrace);
286 }
ReqTrans.
Definition: bsI2CMsgs.h:41
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.
Definition: bsI2CMsgs.c:559
INLINE_IN_H int BsI2CPackReqWrite ( BsI2CReqWrite_T pStruct,
byte_t  buf[],
size_t  bufSize,
bool_t  bTrace 
)

Pack a BsI2CReqWrite ITV message in big-endian byte order into the output buffer.

Parameters
[in]pStructPointer to the associated, populated message structure.
[out]bufOutput message buffer.
bufSizeSize of output buffer.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes packed. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 366 of file bsI2CMsgs.h.

References BsI2CMsgIdReqWrite, and BsI2CPackMsg().

Referenced by bsI2CReqWrite().

370 {
371  return BsI2CPackMsg(BsI2CMsgIdReqWrite, pStruct, buf, bufSize, bTrace);
372 }
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.
Definition: bsI2CMsgs.c:559
ReqWrite.
Definition: bsI2CMsgs.h:43
INLINE_IN_H int BsI2CPackRspRead ( BsI2CRspRead_T pStruct,
byte_t  buf[],
size_t  bufSize,
bool_t  bTrace 
)

Pack a BsI2CRspRead ITV message in big-endian byte order into the output buffer.

Parameters
[in]pStructPointer to the associated, populated message structure.
[out]bufOutput message buffer.
bufSizeSize of output buffer.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes packed. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 323 of file bsI2CMsgs.h.

References BsI2CMsgIdRspRead, and BsI2CPackMsg().

Referenced by bsModI2CReqRead(), and bsModI2CReqTrans().

327 {
328  return BsI2CPackMsg(BsI2CMsgIdRspRead, pStruct, buf, bufSize, bTrace);
329 }
RspRead.
Definition: bsI2CMsgs.h:42
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.
Definition: bsI2CMsgs.c:559
INLINE_IN_H int BsI2CPackRspScan ( BsI2CRspScan_T pStruct,
byte_t  buf[],
size_t  bufSize,
bool_t  bTrace 
)

Pack a BsI2CRspScan ITV message in big-endian byte order into the output buffer.

Parameters
[in]pStructPointer to the associated, populated message structure.
[out]bufOutput message buffer.
bufSizeSize of output buffer.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes packed. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 452 of file bsI2CMsgs.h.

References BsI2CMsgIdRspScan, and BsI2CPackMsg().

Referenced by bsModI2CReqScan().

456 {
457  return BsI2CPackMsg(BsI2CMsgIdRspScan, pStruct, buf, bufSize, bTrace);
458 }
RspScan.
Definition: bsI2CMsgs.h:46
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.
Definition: bsI2CMsgs.c:559
INLINE_IN_H int BsI2CPackRspWrite ( BsI2CRspWrite_T pStruct,
byte_t  buf[],
size_t  bufSize,
bool_t  bTrace 
)

Pack a BsI2CRspWrite ITV message in big-endian byte order into the output buffer.

Parameters
[in]pStructPointer to the associated, populated message structure.
[out]bufOutput message buffer.
bufSizeSize of output buffer.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes packed. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 409 of file bsI2CMsgs.h.

References BsI2CMsgIdRspWrite, and BsI2CPackMsg().

Referenced by bsModI2CReqWrite().

413 {
414  return BsI2CPackMsg(BsI2CMsgIdRspWrite, pStruct, buf, bufSize, bTrace);
415 }
RspWrite.
Definition: bsI2CMsgs.h:44
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.
Definition: bsI2CMsgs.c:559
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.

Parameters
eMsgIdMessage Id.
[in]bufInput message buffer.
uMsgLenLength of message (bytes) in input buffer.
[out]pStructPointer to the associated message structure.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes unpacked. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 597 of file bsI2CMsgs.c.

References BsI2CLookupMsgDef().

Referenced by BsI2CUnpackReqRead(), BsI2CUnpackReqTrans(), BsI2CUnpackReqWrite(), BsI2CUnpackRspRead(), BsI2CUnpackRspScan(), and BsI2CUnpackRspWrite().

602 {
603  const NMMsgDef_T *pMsgDef;
604 
605  if( (pMsgDef = BsI2CLookupMsgDef(eMsgId)) == NULL )
606  {
607  LOGERROR("%s(ecode=%d): msgid=%u.",
608  nmStrError(NM_ECODE_MSGID), NM_ECODE_MSGID, eMsgId);
609  return -NM_ECODE_MSGID;
610  }
611 
612  if( bTrace )
613  {
614  return nmUnpackITVMsgDebug(pMsgDef, buf, uMsgLen, pStruct, NMEndianBig);
615  }
616  else
617  {
618  return nmUnpackITVMsg(pMsgDef, buf, uMsgLen, pStruct, NMEndianBig);
619  }
620 }
const NMMsgDef_T * BsI2CLookupMsgDef(BsI2CMsgId_T eMsgId)
Look up the message definition associated with the message id.
Definition: bsI2CMsgs.c:509
INLINE_IN_H int BsI2CUnpackReqRead ( byte_t  buf[],
size_t  uMsgLen,
BsI2CReqRead_T pStruct,
bool_t  bTrace 
)

Unpack a BsI2CReqRead ITV message in big-endian byte order from the input buffer.

Parameters
[in]bufOutput message buffer.
uMsgLenLength of message (bytes) in input buffer.
[out]pStructPointer to the associated message structure.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes unpacked. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 258 of file bsI2CMsgs.h.

References BsI2CMsgIdReqRead, and BsI2CUnpackMsg().

Referenced by bsModI2CReqRead().

262 {
263  return BsI2CUnpackMsg(BsI2CMsgIdReqRead, buf, uMsgLen, pStruct, bTrace);
264 }
ReqRead.
Definition: bsI2CMsgs.h:40
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.
Definition: bsI2CMsgs.c:597
INLINE_IN_H int BsI2CUnpackReqTrans ( byte_t  buf[],
size_t  uMsgLen,
BsI2CReqTrans_T pStruct,
bool_t  bTrace 
)

Unpack a BsI2CReqTrans ITV message in big-endian byte order from the input buffer.

Parameters
[in]bufOutput message buffer.
uMsgLenLength of message (bytes) in input buffer.
[out]pStructPointer to the associated message structure.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes unpacked. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 301 of file bsI2CMsgs.h.

References BsI2CMsgIdReqTrans, and BsI2CUnpackMsg().

Referenced by bsModI2CReqTrans().

305 {
306  return BsI2CUnpackMsg(BsI2CMsgIdReqTrans, buf, uMsgLen, pStruct, bTrace);
307 }
ReqTrans.
Definition: bsI2CMsgs.h:41
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.
Definition: bsI2CMsgs.c:597
INLINE_IN_H int BsI2CUnpackReqWrite ( byte_t  buf[],
size_t  uMsgLen,
BsI2CReqWrite_T pStruct,
bool_t  bTrace 
)

Unpack a BsI2CReqWrite ITV message in big-endian byte order from the input buffer.

Parameters
[in]bufOutput message buffer.
uMsgLenLength of message (bytes) in input buffer.
[out]pStructPointer to the associated message structure.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes unpacked. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 387 of file bsI2CMsgs.h.

References BsI2CMsgIdReqWrite, and BsI2CUnpackMsg().

Referenced by bsModI2CReqWrite().

391 {
392  return BsI2CUnpackMsg(BsI2CMsgIdReqWrite, buf, uMsgLen, pStruct, bTrace);
393 }
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.
Definition: bsI2CMsgs.c:597
ReqWrite.
Definition: bsI2CMsgs.h:43
INLINE_IN_H int BsI2CUnpackRspRead ( byte_t  buf[],
size_t  uMsgLen,
BsI2CRspRead_T pStruct,
bool_t  bTrace 
)

Unpack a BsI2CRspRead ITV message in big-endian byte order from the input buffer.

Parameters
[in]bufOutput message buffer.
uMsgLenLength of message (bytes) in input buffer.
[out]pStructPointer to the associated message structure.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes unpacked. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 344 of file bsI2CMsgs.h.

References BsI2CMsgIdRspRead, and BsI2CUnpackMsg().

Referenced by bsI2CReqRead(), and bsI2CReqTrans().

348 {
349  return BsI2CUnpackMsg(BsI2CMsgIdRspRead, buf, uMsgLen, pStruct, bTrace);
350 }
RspRead.
Definition: bsI2CMsgs.h:42
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.
Definition: bsI2CMsgs.c:597
INLINE_IN_H int BsI2CUnpackRspScan ( byte_t  buf[],
size_t  uMsgLen,
BsI2CRspScan_T pStruct,
bool_t  bTrace 
)

Unpack a BsI2CRspScan ITV message in big-endian byte order from the input buffer.

Parameters
[in]bufOutput message buffer.
uMsgLenLength of message (bytes) in input buffer.
[out]pStructPointer to the associated message structure.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes unpacked. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 473 of file bsI2CMsgs.h.

References BsI2CMsgIdRspScan, and BsI2CUnpackMsg().

Referenced by bsI2CReqScan().

477 {
478  return BsI2CUnpackMsg(BsI2CMsgIdRspScan, buf, uMsgLen, pStruct, bTrace);
479 }
RspScan.
Definition: bsI2CMsgs.h:46
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.
Definition: bsI2CMsgs.c:597
INLINE_IN_H int BsI2CUnpackRspWrite ( byte_t  buf[],
size_t  uMsgLen,
BsI2CRspWrite_T pStruct,
bool_t  bTrace 
)

Unpack a BsI2CRspWrite ITV message in big-endian byte order from the input buffer.

Parameters
[in]bufOutput message buffer.
uMsgLenLength of message (bytes) in input buffer.
[out]pStructPointer to the associated message structure.
bTraceDo [not] trace packing.
Returns
On success, returns the number of bytes unpacked. On error, returns the appropriate < 0 negated NM_ECODE.

Definition at line 430 of file bsI2CMsgs.h.

References BsI2CMsgIdRspWrite, and BsI2CUnpackMsg().

Referenced by bsI2CReqWrite().

434 {
435  return BsI2CUnpackMsg(BsI2CMsgIdRspWrite, buf, uMsgLen, pStruct, bTrace);
436 }
RspWrite.
Definition: bsI2CMsgs.h:44
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.
Definition: bsI2CMsgs.c:597

Variable Documentation

const NMMsgDef_T* BsI2CMsgDefLookupTbl[]

BsI2C Message Definition Look-Up Table. Indexed by BsI2CMsgId_T enum.

Definition at line 466 of file bsI2CMsgs.c.

Referenced by BsI2CLookupMsgDef().

size_t BsI2CMsgMaxLenLookupTbl[]

BsI2C Message Maximum Size Look-Up Table. Indexed by BsI2CMsgId_T enum.

Definition at line 482 of file bsI2CMsgs.c.

Referenced by BsI2CLookupMsgMaxLen().