Device: Add setValueLiveData()

* Adds the ability to set a CoreMini signal value via the live data interface
* Adds definition for the Manual Trigger and DAQ Enable signals
This commit is contained in:
Ben Kleinheksel
2025-06-18 21:51:32 +00:00
committed by Kyle Schwarz
parent f37b88d616
commit c91db6355c
11 changed files with 210 additions and 1 deletions
+2
View File
@@ -51,6 +51,8 @@ public:
WiVINotSupported = 0x1015,
RestrictedEntryFlag = 0x1016,
NotSupported = 0x1017,
FixedPointOverflow = 0x1018,
FixedPointPrecision = 0x1019,
// Device Events
PollingMessageOverflow = 0x2000,
+19
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_ENABLE = 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_ENABLE: return os << "DAQ Enable";
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 numSetValues;
LiveDataSetValueEntry values[1];
};
struct ExtResponseHeader {
ExtendedCommand command;
uint16_t length;
@@ -138,6 +156,7 @@ namespace LiveDataUtil
LiveDataHandle getNewHandle();
double liveDataValueToDouble(const LiveDataValue& val);
bool liveDataDoubleToValue(const double& dFloat, LiveDataValue& value);
static constexpr uint32_t LiveDataVersion = 1;
} // namespace LiveDataUtil
@@ -38,6 +38,14 @@ public:
LiveDataStatus status;
};
class LiveDataSetValueMessage : public LiveDataMessage {
public:
LiveDataSetValueMessage() {}
std::vector<std::shared_ptr<LiveDataArgument>> args;
std::vector<std::shared_ptr<LiveDataValue>> values;
void appendSetValue(LiveDataValueType valueType, const LiveDataValue& value);
};
} // namespace icsneo
#endif // __cplusplus
+1
View File
@@ -636,6 +636,7 @@ public:
bool subscribeLiveData(std::shared_ptr<LiveDataCommandMessage> message);
bool unsubscribeLiveData(const LiveDataHandle& handle);
bool clearAllLiveData();
bool setValueLiveData(std::shared_ptr<LiveDataSetValueMessage> message);
// VSA Read functions