13 #ifndef CARMA_BIMA_TELEMETRYCLIENT_H
14 #define CARMA_BIMA_TELEMETRYCLIENT_H
23 #include <xercesc/parsers/SAXParser.hpp>
24 #include <xercesc/validators/DTD/DTDValidator.hpp>
31 #include "carma/util/ScopedPthreadMutexLock.h"
34 #include "carma/util/Logger.h"
40 #define VOLTS15 4.516129/32768.*3.608
41 #define VOLTS10 4.516129/32768.*2.697
42 #define VOLTS10P 4.516129/32768.*2.758
43 #define VOLTS5 4.516129/32768.*1.347
44 #define VOLTS4 4.516129/32768.
45 #define VOLTS1P2 4.516129/32768.*.280
46 #define VOLTS1 4.516129/32768.*.250
47 #define VOLTSP4 4.516129/32768.*.100
49 #define MVOLTS 4.516129/32768.*5.
51 #define UAMPS 4.516129/32768.*124.38
53 #define TVOLTS 4.516129/32768./2.5
54 #define THERMI 4.516129/32768.
56 #define BIMASTATUSINFO(T,S) \
58 std::ostringstream bsioss; \
60 T.setStatusInfo( bsioss.str() ); \
69 class TelemetryClient :
public SharedMemory
72 TelemetryClient( Configuration& config,
bool checkTelemHost =
true );
78 void tpoke(
const char *ccname,
unsigned char value = 1);
79 void tpoke(
const char *ccname,
unsigned short value = 1 );
80 void tpoke(
const char *ccname,
unsigned long value = 1 );
82 void tpeekWriteSpace(
const char *ccname,
unsigned short *value );
83 void tpeek(
const char *ccname,
unsigned short *value );
84 void tpeek(
const char *ccname,
unsigned long *value );
86 int atodin (
const char *ccname );
87 int atodin (
int value )
94 double thermistor(
double volts );
95 double psi(
int value );
96 void limit(
double& value,
double min,
double max );
100 void setbits(
const char *bitsin,
unsigned char value,
unsigned char mask );
102 void cpoke(
unsigned short msgId, std::vector<carma::canbus::byteType> data );
104 void enableToggleBit(
const char *name,
int mask,
int update );
105 void disableToggleBit(
void );
106 void enableMonitorPackets(
void );
107 void disableMonitorPackets(
void );
108 void serialEnable(
void );
109 void serialDisable(
void );
111 Configuration& getConfig() {
return _config; }
113 unsigned char getStatusByteA();
114 unsigned char getStatusByteB();
115 unsigned char getStatusByteC();
123 bool isWtrPrssrNotNorm();
124 bool isCollisionDectOff();
126 bool isAzDrvTempNorm();
127 bool isElDrvTempNorm();
129 bool isCabTempNorm();
130 bool isSpareTempNorm();
132 bool isComputerCtl();
133 bool isCamFlapOpen();
134 bool isCamFlapBypass();
137 int getNumByteAErrs();
138 int getNumByteBErrs();
139 int getNumByteCErrs();
143 void setStatusInfo( std::string msg );
144 std::string getStatusInfo();
146 std::string getFirmwareVersion();
147 std::string getTelemetryVersion();
148 void setTelemetryVersion( std::string ver );
151 Configuration &_config;
154 static TelemetryConfigHandler *_tmConfig;
155 static SemaphoreOperator *_semOp;
156 static ::carma::util::PthreadMutex mConfigGuard;
157 static std::map<std::string, unsigned short> _nameMap;
167 #endif // CARMA_BIMA_TELEMETRYCLIENT_H
Class definition for TelemetryCommand on the BIMA antennas.
Exception class for errors.
SAX Handler for parsing BIMA Telemetry configuration file.
Interface file for the carma::util::Trace class and related macros.
Class definition for SharedMemory on the BIMA antennas.