STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
CalibratedPTMessage.hpp
Go to the documentation of this file.
1#ifndef CALIBRATED_PT_MESSAGE_HPP
2#define CALIBRATED_PT_MESSAGE_HPP
3
4#include <array>
5#include <cstdint>
6
8
9namespace comms {
10namespace messages {
11namespace sensor {
12
13/**
14 * @brief Calibrated Pressure Transducer message for Elodin
15 *
16 * Contains both raw ADC counts and calibrated pressure in PSI.
17 * This message is published alongside RawPTMessage for calibrated sensors.
18 *
19 * Layout: uint64_t (8) + uint8_t (1) + padding[3] (3) + float (4) + uint32_t (4) + uint8_t (1) = 21
20 * bytes
21 */
23 CommsMessage<uint64_t, // (0) timestamp_ns - monotonic timestamp in nanoseconds
24 uint8_t, // (1) channel_id - sensor channel identifier
25 std::array<uint8_t, 3>, // (2) padding - 3 bytes to align float to 4-byte boundary
26 float, // (3) calibrated_pressure_psi - calibrated pressure in PSI
27 uint32_t, // (4) raw_adc_counts - raw ADC reading (for reference)
28 uint8_t // (5) calibration_status - 0=uncalibrated, 1=calibrated
29 >;
30
31} // namespace sensor
32} // namespace messages
33} // namespace comms
34
35#endif // CALIBRATED_PT_MESSAGE_HPP
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, float, uint32_t, uint8_t > CalibratedPTMessage
Calibrated Pressure Transducer message for Elodin.
Central message header for all communication messages.
CommsMessage - Template-based message serialization.