StatusResponseMessage.h
Go to the documentation of this file.
1 
40 #ifndef LibMultiSense_StatusResponseMessage
41 #define LibMultiSense_StatusResponseMessage
42 
44 
45 namespace crl {
46 namespace multisense {
47 namespace details {
48 namespace wire {
49 
51 public:
54  static float INVALID_TEMPERATURE() { return -99999.0f; };
55 
56  //
57  // Subsytem status
58 
59  static CRL_CONSTEXPR uint32_t STATUS_GENERAL_OK = (1<<0);
60  static CRL_CONSTEXPR uint32_t STATUS_LASER_OK = (1<<1);
61  static CRL_CONSTEXPR uint32_t STATUS_LASER_MOTOR_OK = (1<<2);
62  static CRL_CONSTEXPR uint32_t STATUS_CAMERAS_OK = (1<<3);
63  static CRL_CONSTEXPR uint32_t STATUS_IMU_OK = (1<<4);
64  static CRL_CONSTEXPR uint32_t STATUS_EXTERNAL_LED_OK = (1<<5);
65  static CRL_CONSTEXPR uint32_t STATUS_PIPELINE_OK = (1<<6);
66 
67  //
68  // The reported uptime for the system
69  //
70 
72  uint32_t status;
73  float temperature0; // celsius
74  float temperature1;
75 
76  //
77  // Version 2 additions
78 
79  float temperature2; // celsius
80  float temperature3;
81 
82  float inputVolts; // volts
83  float inputCurrent; // amps
84  float fpgaPower; // watts
85  float logicPower;
86  float imagerPower;
87 
88  //
89  // Constructors
90 
92  StatusResponse() : uptime(),
93  status(0),
94  temperature0(INVALID_TEMPERATURE()),
95  temperature1(INVALID_TEMPERATURE()),
96  temperature2(INVALID_TEMPERATURE()),
97  temperature3(INVALID_TEMPERATURE()),
98  inputVolts(-1.0),
99  inputCurrent(-1.0),
100  fpgaPower(-1.0),
101  logicPower(-1.0),
102  imagerPower(-1.0) {};
103 
104  //
105  // Serialization routine
106 
107  template<class Archive>
108  void serialize(Archive& message,
109  const VersionType version)
110  {
111  message & uptime;
112  message & status;
113  message & temperature0;
114  message & temperature1;
115 
116  if (version >= 2) {
117  message & temperature2;
118  message & temperature3;
119  message & inputVolts;
120  message & inputCurrent;
121  message & fpgaPower;
122  message & logicPower;
123  message & imagerPower;
124  }
125 
126  //
127  // Enable the LED OK and pipeline OK status for older messages
128  if (version < 3) {
129  status |= STATUS_EXTERNAL_LED_OK;
130  status |= STATUS_PIPELINE_OK;
131  }
132  }
133 };
134 
135 }}}} // namespaces
136 
137 #endif
static CRL_CONSTEXPR IdType ID_DATA_STATUS
Definition: Protocol.h:194
StatusResponse(utility::BufferStreamReader &r, VersionType v)
Definition: channel.cc:56
static CRL_CONSTEXPR uint32_t STATUS_EXTERNAL_LED_OK
void serialize(Archive &message, const VersionType version)
#define CRL_CONSTEXPR
Definition: Portability.hh:51


multisense_lib
Author(s):
autogenerated on Sun Mar 14 2021 02:34:50