Add set value to live data

Print new commands and signals
This commit is contained in:
Ben Kleinheksel
2025-06-16 11:04:38 -04:00
parent f37b88d616
commit 5bfd7e3300
6 changed files with 162 additions and 0 deletions
+18
View File
@@ -19,6 +19,7 @@ enum class LiveDataCommand : uint32_t {
UNSUBSCRIBE,
RESPONSE,
CLEAR_ALL,
SET_VALUE,
};
enum class LiveDataStatus : uint32_t {
@@ -41,10 +42,13 @@ enum class LiveDataValueType : uint32_t {
GPS_SPEED,
GPS_VALID,
GPS_ENABLE = 62,
MANUAL_TRIGGER = 108,
TIME_SINCE_MSG = 111,
GPS_ACCURACY = 120,
GPS_BEARING = 121,
GPS_TIME = 122,
GPS_TIME_VALID = 123,
DAQ_OVERRIDE = 124,
};
inline std::ostream& operator<<(std::ostream& os, const LiveDataCommand cmd) {
@@ -54,6 +58,7 @@ inline std::ostream& operator<<(std::ostream& os, const LiveDataCommand cmd) {
case LiveDataCommand::UNSUBSCRIBE: return os << "Unsubscribe";
case LiveDataCommand::RESPONSE: return os << "Response";
case LiveDataCommand::CLEAR_ALL: return os << "Clear All";
case LiveDataCommand::SET_VALUE: return os << "Set Value";
}
return os;
}
@@ -81,6 +86,8 @@ inline std::ostream& operator<<(std::ostream& os, const LiveDataValueType cmd) {
case LiveDataValueType::GPS_BEARING: return os << "GPS Bearing";
case LiveDataValueType::GPS_TIME: return os << "GPS Time";
case LiveDataValueType::GPS_TIME_VALID: return os << "GPS Time Valid";
case LiveDataValueType::DAQ_OVERRIDE: return os << "DAQ Override";
case LiveDataValueType::MANUAL_TRIGGER: return os << "Manual Trigger";
}
return os;
}
@@ -127,6 +134,17 @@ struct LiveDataSubscribe : public LiveDataHeader {
LiveDataArgument args[1];
};
struct LiveDataSetValueEntry
{
LiveDataArgument arg;
LiveDataValue value;
};
struct LiveDataSetValue : public LiveDataHeader {
uint32_t numArgs;
LiveDataSetValueEntry values[1];
};
struct ExtResponseHeader {
ExtendedCommand command;
uint16_t length;
@@ -38,6 +38,13 @@ public:
LiveDataStatus status;
};
class LiveDataSetValueMessage : public LiveDataMessage {
public:
LiveDataSetValueMessage() {}
std::vector<std::shared_ptr<LiveDataArgument>> args;
std::vector<std::shared_ptr<LiveDataValue>> values;
};
} // namespace icsneo
#endif // __cplusplus