mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Message: Create a type system so non-frame data can be represented
This change breaks existing code, hence the version bump, but it's going to be much less error prone going forward.
This commit is contained in:
@@ -104,11 +104,12 @@ protected:
|
||||
// The supported TX networks are the same as the supported RX networks for this device
|
||||
virtual void setupSupportedTXNetworks(std::vector<Network>& txNetworks) override { setupSupportedRXNetworks(txNetworks); }
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<Message>& message) override {
|
||||
if(!message || message->data.size() < sizeof(neovifire2_status_t))
|
||||
void handleDeviceStatus(const std::shared_ptr<RawMessage>& message) override {
|
||||
const auto& data = message->data;
|
||||
if(data.size() < sizeof(neovifire2_status_t))
|
||||
return;
|
||||
std::lock_guard<std::mutex> lk(ioMutex);
|
||||
const neovifire2_status_t* status = reinterpret_cast<const neovifire2_status_t*>(message->data.data());
|
||||
const neovifire2_status_t* status = reinterpret_cast<const neovifire2_status_t*>(data.data());
|
||||
backupPowerEnabled = status->backupPowerEnabled;
|
||||
backupPowerGood = status->backupPowerGood;
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
if (!fakedev->com->decoder->decode(msg, packet))
|
||||
continue; // We failed to decode this packet
|
||||
|
||||
if(!msg || msg->network.getNetID() != Network::NetID::Main51)
|
||||
if(!msg || msg->type != Message::Type::Main51)
|
||||
continue; // Not a message we care about
|
||||
auto sn = std::dynamic_pointer_cast<SerialNumberMessage>(msg);
|
||||
if(!sn)
|
||||
|
||||
Reference in New Issue
Block a user