STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
SensorMessages.hpp
Go to the documentation of this file.
1#ifndef DAQ_SENSOR_MESSAGES_HPP
2#define DAQ_SENSOR_MESSAGES_HPP
3
4#include <cstdint>
5
7
8namespace comms {
9namespace messages {
10namespace sensor {
11
12/**
13 * @brief Raw Pressure Transducer sample message for Elodin
14 *
15 * Simplified schema focused on raw sensor data.
16 * Calibrated values will be added in a separate table later.
17 *
18 * CRITICAL: Includes padding bytes to ensure uint32_t fields are 4-byte aligned
19 * Layout: uint64_t (8) + uint8_t (1) + padding[3] (3) + uint32_t (4) + uint32_t (4) + uint8_t (1) =
20 * 21 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 uint32_t to 4-byte
26 // boundary
27 uint32_t, // (3) raw_adc_counts - raw ADC reading
28 uint32_t, // (4) sample_timestamp_ms - embedded timestamp in milliseconds
29 uint8_t // (5) status_flags - status/health flags
30 >;
31
32/**
33 * @brief Raw Thermocouple sample message for Elodin
34 * CRITICAL: Includes padding bytes to ensure uint32_t fields are 4-byte aligned
35 */
37 CommsMessage<uint64_t, // (0) timestamp_ns - monotonic timestamp in nanoseconds
38 uint8_t, // (1) channel_id - sensor channel identifier
39 std::array<uint8_t, 3>, // (2) padding - 3 bytes to align uint32_t to 4-byte
40 // boundary
41 uint32_t, // (3) raw_adc_counts - raw ADC reading
42 uint32_t, // (4) sample_timestamp_ms - embedded timestamp in milliseconds
43 uint8_t // (5) status_flags - status/health flags
44 >;
45
46/**
47 * @brief Raw RTD sample message for Elodin
48 * CRITICAL: Includes padding bytes to ensure uint32_t fields are 4-byte aligned
49 */
51 CommsMessage<uint64_t, // (0) timestamp_ns - monotonic timestamp in nanoseconds
52 uint8_t, // (1) channel_id - sensor channel identifier
53 std::array<uint8_t, 3>, // (2) padding - 3 bytes to align uint32_t to 4-byte
54 // boundary
55 uint32_t, // (3) raw_resistance_counts - ADC counts representing resistance
56 uint32_t, // (4) sample_timestamp_ms - embedded timestamp in milliseconds
57 uint8_t // (5) status_flags - status/health flags
58 >;
59
60/**
61 * @brief Raw Load Cell sample message for Elodin
62 * CRITICAL: Includes padding bytes to ensure uint32_t fields are 4-byte aligned
63 */
65 CommsMessage<uint64_t, // (0) timestamp_ns - monotonic timestamp in nanoseconds
66 uint8_t, // (1) channel_id - sensor channel identifier
67 std::array<uint8_t, 3>, // (2) padding - 3 bytes to align uint32_t to 4-byte
68 // boundary
69 uint32_t, // (3) raw_adc_counts - raw ADC reading
70 uint32_t, // (4) sample_timestamp_ms - embedded timestamp in milliseconds
71 uint8_t // (5) status_flags - status/health flags
72 >;
73
74/** Actuator state (0=closed, 1=open) from current-sense ADC threshold. Packet ID [0x31, ch]. */
75using ActuatorStateMessage = CommsMessage<uint64_t, // (0) timestamp_ns
76 uint8_t, // (1) channel_id - 1-based
77 uint8_t // (2) actuator_state - 0=closed, 1=open
78 >;
79
80} // namespace sensor
81} // namespace messages
83} // namespace comms
84
85#endif // DAQ_SENSOR_MESSAGES_HPP
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawTCMessage
Raw Thermocouple sample message for Elodin CRITICAL: Includes padding bytes to ensure uint32_t fields...
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawRTDMessage
Raw RTD sample message for Elodin CRITICAL: Includes padding bytes to ensure uint32_t fields are 4-by...
CommsMessage< uint64_t, uint8_t, uint8_t > ActuatorStateMessage
Actuator state (0=closed, 1=open) from current-sense ADC threshold.
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawLCMessage
Raw Load Cell sample message for Elodin CRITICAL: Includes padding bytes to ensure uint32_t fields ar...
CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, uint32_t, uint32_t, uint8_t > RawPTMessage
Raw Pressure Transducer sample message for Elodin.
Central message header for all communication messages.
CommsMessage - Template-based message serialization.