![]() |
netmsgs
1.2.2
RoadNarrows Robotics Network Messaging Package
|
NetMsgs library utilities. More...
#include <stdio.h>#include <stdlib.h>#include "rnr/rnrconfig.h"#include "rnr/log.h"#include "rnr/netmsgs.h"#include "nmLibInternal.h"Go to the source code of this file.
Functions | |
| const char * | nmStrError (int ecode) |
| Get the error string describing the BotSense error code. More... | |
| void | nmPrintBuf (FILE *fp, const char *sPreface, byte_t buf[], size_t uCount, size_t uNLFreq, uint_t uCol) |
| Pretty print buffer to opened file stream. More... | |
| void | nmPrintBits (FILE *fp, const char *sPreface, ulonglong_t uVal, uint_t uMsb, uint_t uCnt) |
| Pretty print bits in value. More... | |
| size_t | nmGetFieldValSize (NMFType_T eFType) |
| Get the field value byte size. More... | |
| const NMFieldDef_T * | nmFindFieldDef (const NMMsgDef_T *pMsgDef, byte_t byFId) |
| Find the field definition in the message definition, given the field id. More... | |
Variables | |
| static const char * | nmEcodeStrTbl [] |
| NetMsgs Error Code String Table. More... | |
| static size_t | NMFValLenLookupTbl [] |
NetMsgs library utilities.
Definition in file nmLibUtils.c.
| const NMFieldDef_T* nmFindFieldDef | ( | const NMMsgDef_T * | pMsgDef, |
| byte_t | byFId | ||
| ) |
Find the field definition in the message definition, given the field id.
| pMsgDef | Pointer to message definition. |
| byFId | Field Id. |
Definition at line 235 of file nmLibUtils.c.
References _nm_field_def_struct::m_eFId, _nm_msg_def_struct::m_pFields, and _nm_msg_def_struct::m_uCount.
Referenced by nmUnpackITVStream().
| size_t nmGetFieldValSize | ( | NMFType_T | eFType | ) |
Get the field value byte size.
| eFType | Field type. |
Definition at line 209 of file nmLibUtils.c.
References NMFValLenLookupTbl, NMHashFType(), and NMHashNoIdx.
| void nmPrintBits | ( | FILE * | fp, |
| const char * | sPreface, | ||
| ulonglong_t | uVal, | ||
| uint_t | uMsb, | ||
| uint_t | uCnt | ||
| ) |
Pretty print bits in value.
| fp | File pointer. |
| sPreface | Optional bit preface string (set to NULL for no preface). |
| uVal | Bits to print. |
| uMsb | Starting most significant bit. |
| uCnt | Number of bits. |
Definition at line 174 of file nmLibUtils.c.
| void nmPrintBuf | ( | FILE * | fp, |
| const char * | sPreface, | ||
| byte_t | buf[], | ||
| size_t | uCount, | ||
| size_t | uNLFreq, | ||
| uint_t | uCol | ||
| ) |
Pretty print buffer to opened file stream.
| fp | File pointer. |
| sPreface | Optional buffer preface string (set to NULL for no preface). |
| buf | Buffer to print. |
| uCount | Number of bytes to print. |
| uNLFreq | Newline frequency (set to 0 for no newlines). |
| uCol | Column alignment number. |
Definition at line 138 of file nmLibUtils.c.
Referenced by nmPackFlatMsgDebug(), nmPackITVMsgDebug(), nmTraceField(), nmUnpackFlatMsgDebug(), and nmUnpackITVMsgDebug().
| const char* nmStrError | ( | int | ecode | ) |
Get the error string describing the BotSense error code.
The absolute value of the error code is taken prior retrieving the string. An unknown or out-of-range error code will be mapped to NM_ECODE_BADEC.
| ecode | BotSense error code. |
Definition at line 114 of file nmLibUtils.c.
References NM_ECODE_BADEC, and nmEcodeStrTbl.
|
static |
NetMsgs Error Code String Table.
Table is indexed by NetMsgs error codes (see NetMsgs Error Codes). Keep in sync.
Definition at line 69 of file nmLibUtils.c.
Referenced by nmStrError().
|
static |
Field Value Byte Size Lookup Table
Definition at line 90 of file nmLibUtils.c.
Referenced by nmGetFieldValSize().