Communication: Add EthernetStatusMessage

This commit is contained in:
Kyle Schwarz
2025-01-06 14:12:19 -05:00
parent 87baa97c3f
commit f18aa00322
11 changed files with 210 additions and 23 deletions
+9 -9
View File
@@ -1729,15 +1729,6 @@ void Device::handleInternalMessage(std::shared_ptr<Message> message) {
case Message::Type::RawMessage: {
auto rawMessage = std::static_pointer_cast<RawMessage>(message);
switch(rawMessage->network.getNetID()) {
case Network::NetID::Device: {
// Device is not guaranteed to be a CANMessage, it might be a RawMessage
// if it couldn't be decoded to a CANMessage. We only care about the
// CANMessage decoding right now.
auto canmsg = std::dynamic_pointer_cast<CANMessage>(message);
if(canmsg)
handleNeoVIMessage(std::move(canmsg));
break;
}
case Network::NetID::DeviceStatus:
// Device Status format is unique per device, so the devices need to decode it themselves
handleDeviceStatus(rawMessage);
@@ -1747,6 +1738,15 @@ void Device::handleInternalMessage(std::shared_ptr<Message> message) {
}
break;
}
case Message::Type::Frame: {
// Device is not guaranteed to be a CANMessage, it might be a RawMessage
// if it couldn't be decoded to a CANMessage. We only care about the
// CANMessage decoding right now.
auto canmsg = std::dynamic_pointer_cast<CANMessage>(message);
if(canmsg)
handleNeoVIMessage(std::move(canmsg));
break;
}
default: break;
}
forEachExtension([&](const std::shared_ptr<DeviceExtension>& ext) {