10 #ifndef CARMA_ANTENNA_BIMA_TELEMETRYINFO_H
11 #define CARMA_ANTENNA_BIMA_TELEMETRYINFO_H
31 for (
int i = 0; i < 7; i++ )
33 _name[i] =
new std::string(
"(unknown)" );
35 new std::string(
"This sub-telemetry id has no definition" );
40 _sem_num[i] = _global_sem_num++;
41 CPTRACE( carma::util::Trace::TRACE7,
"Created TelemetryInfo instance: "
42 <<
"_name[" << i <<
"]: " << _name[i]->c_str()
43 <<
" _comment[" << i <<
"]: " << _comment[i]->c_str()
44 <<
" _msgId: 0x" << std::hex << _msgId
45 <<
" _addr[" << i <<
"]: " << _addr[i]
46 <<
" _size[" << i <<
"]: " << _size[i]
48 <<
" _sem_num: " << _sem_num[i] );
63 int getSize(
int seq )
68 const char *getName(
int seq )
70 return _name[seq]->c_str();
73 unsigned short getAddr(
int seq )
78 unsigned short getSemNum(
int seq )
88 void setPacketName(
char *theName )
90 _packetName =
new std::string( theName );
93 std::string getPacketName()
95 return std::string( *_packetName );
103 void set(
int sequenceNum,
char *name,
char *comment,
short addr,
int size )
105 CPTRACE( carma::util::Trace::TRACE7,
"TelemetryInfo.set("
106 << sequenceNum <<
", " << name <<
", " << comment <<
", "
107 << addr <<
", " << size <<
")" );
109 if ( sequenceNum > -1 && sequenceNum < 8 )
111 CPTRACE( carma::util::Trace::TRACE7,
112 "_name[" << sequenceNum <<
"]"
113 <<
": " << (
char *)_name[sequenceNum]->c_str() );
115 if ( _name[sequenceNum] != (std::string *)NULL )
116 delete _name[sequenceNum];
118 _name[sequenceNum] =
new std::string(name);
120 CPTRACE( carma::util::Trace::TRACE7,
121 "_comment[" << sequenceNum <<
"]"
122 <<
": " << (
char *)_comment[sequenceNum]->c_str() );
124 if ( _comment[sequenceNum] != (std::string *)NULL )
125 delete _comment[sequenceNum];
127 _comment[sequenceNum] =
new std::string(comment);
129 _addr[sequenceNum] = addr;
130 _size[sequenceNum] = size;
132 if ( (sequenceNum+1) > _len )
133 _len = (sequenceNum+1);
139 std::string *_packetName;
140 std::string *_name[8];
141 std::string *_comment[8];
143 unsigned short _addr[8];
146 unsigned short _sem_num[8];
147 static unsigned short _global_sem_num;
156 #endif // CARMA_ANTENNA_BIMA_TELEMETRYINFO_H
#define CPTRACE(priorityLevel, message)
Old deprecated macro name for CARMA_CPTRACE.
Interface file for the carma::util::Trace class and related macros.
Declarations of carma::canbus utility functions.
unsigned short msgType
Carma Message id type.