Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
cISDataMappings Class Reference

#include <ISDataMappings.h>

Public Member Functions

virtual ~cISDataMappings ()
 

Static Public Member Functions

static bool CanGetFieldData (const data_info_t &info, const p_data_hdr_t *hdr, const uint8_t *buf, const uint8_t *&ptr)
 
static bool DataToString (const data_info_t &info, const p_data_hdr_t *hdr, const uint8_t *dataBuffer, data_mapping_string_t stringBuffer, bool json=false)
 
static const char * GetDataSetName (uint32_t dataId)
 
static const map_name_to_info_tGetMapInfo (uint32_t dataId)
 
static uint32_t GetSize (uint32_t dataId)
 
static double GetTimestamp (const p_data_hdr_t *hdr, const uint8_t *buf)
 
static bool StringToData (const char *stringBuffer, int stringLength, const p_data_hdr_t *hdr, uint8_t *dataBuffer, const data_info_t &info, int radix=10, bool json=false)
 

Private Member Functions

 cISDataMappings ()
 

Private Attributes

map_name_to_info_t m_lookupInfo [DID_COUNT]
 
uint32_t m_lookupSize [DID_COUNT]
 
const data_info_tm_timestampFields [DID_COUNT]
 

Static Private Attributes

static cISDataMappings s_map
 

Detailed Description

Definition at line 138 of file ISDataMappings.h.

Constructor & Destructor Documentation

◆ ~cISDataMappings()

cISDataMappings::~cISDataMappings ( )
virtual

Destructor

Definition at line 1796 of file ISDataMappings.cpp.

◆ cISDataMappings()

cISDataMappings::cISDataMappings ( )
private

Definition at line 1725 of file ISDataMappings.cpp.

Member Function Documentation

◆ CanGetFieldData()

bool cISDataMappings::CanGetFieldData ( const data_info_t info,
const p_data_hdr_t hdr,
const uint8_t *  buf,
const uint8_t *&  ptr 
)
static

Check whether field data can be retrieved given a data packet

Parameters
infometadata for the field to get
hdrpacket header
bufpacket buffer
ptrreceives the offset to get data at if the return value is true
Returns
true if the data can be retrieved, false otherwise

Definition at line 2262 of file ISDataMappings.cpp.

◆ DataToString()

bool cISDataMappings::DataToString ( const data_info_t info,
const p_data_hdr_t hdr,
const uint8_t *  dataBuffer,
data_mapping_string_t  stringBuffer,
bool  json = false 
)
static

Convert data to a string

Parameters
infometadata about the field to convert
hdrpacket header, NULL means dataBuffer is the entire data structure
dataBufferpacket buffer
stringBufferthe buffer to hold the converted string
jsontrue if json, false if csv
Returns
true if success, false if error

Definition at line 2071 of file ISDataMappings.cpp.

◆ GetDataSetName()

const char * cISDataMappings::GetDataSetName ( uint32_t  dataId)
static

Get a data set name from an id

Parameters
dataIdthe data id to get a data set name from
Returns
data set name or NULL if not found

Definition at line 1801 of file ISDataMappings.cpp.

◆ GetMapInfo()

const map_name_to_info_t * cISDataMappings::GetMapInfo ( uint32_t  dataId)
static

Get the info for a data id

Returns
the info for the data id, or NULL if none found

Definition at line 1913 of file ISDataMappings.cpp.

◆ GetSize()

uint32_t cISDataMappings::GetSize ( uint32_t  dataId)
static

Get the size of a given data id

Parameters
dataIdthe data id
Returns
the data id size or 0 if not found or unknown

Definition at line 1943 of file ISDataMappings.cpp.

◆ GetTimestamp()

double cISDataMappings::GetTimestamp ( const p_data_hdr_t hdr,
const uint8_t *  buf 
)
static

Get a timestamp from data if available

Parameters
hdrdata header
bufdata buffer
Returns
timestamp, or 0.0 if no timestamp available

Definition at line 2202 of file ISDataMappings.cpp.

◆ StringToData()

bool cISDataMappings::StringToData ( const char *  stringBuffer,
int  stringLength,
const p_data_hdr_t hdr,
uint8_t *  dataBuffer,
const data_info_t info,
int  radix = 10,
bool  json = false 
)
static

Convert a string to a data field

Parameters
stringBufferthe null terminated string to convert, must not be NULL
stringLengththe number of chars in stringBuffer
hdrpacket header, NULL means dataBuffer is the entire data structure
dataBufferpacket buffer
infometadata about the field to convert
radix(base 10, base 16, etc.) to use if the field is a number field, ignored otherwise
jsontrue if json, false if csv
Returns
true if success, false if error

Definition at line 1968 of file ISDataMappings.cpp.

Member Data Documentation

◆ m_lookupInfo

map_name_to_info_t cISDataMappings::m_lookupInfo[DID_COUNT]
private

Definition at line 213 of file ISDataMappings.h.

◆ m_lookupSize

uint32_t cISDataMappings::m_lookupSize[DID_COUNT]
private

Definition at line 211 of file ISDataMappings.h.

◆ m_timestampFields

const data_info_t* cISDataMappings::m_timestampFields[DID_COUNT]
private

Definition at line 212 of file ISDataMappings.h.

◆ s_map

cISDataMappings cISDataMappings::s_map
staticprivate

Definition at line 222 of file ISDataMappings.h.


The documentation for this class was generated from the following files:


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:02