CAN FD transmission on non CAN FD hardware now fails as would be expected

This commit is contained in:
Paul Hollinsky
2018-10-19 17:00:40 -04:00
parent 80bccb59a5
commit 0f703f494f
7 changed files with 18 additions and 11 deletions
+3
View File
@@ -15,6 +15,9 @@ bool Encoder::encode(std::vector<uint8_t>& result, const std::shared_ptr<Message
if(!canmsg)
return false; // The message was not a properly formed CANMessage
if(!supportCANFD && canmsg->isCANFD)
return false; // This device does not support CAN FD
if(canmsg->isCANFD && canmsg->isRemote)
return false; // RTR frames can not be used with CAN FD
+2 -1
View File
@@ -21,7 +21,8 @@ public:
bool encode(std::vector<uint8_t>& result, const std::shared_ptr<Message>& message);
bool encode(std::vector<uint8_t>& result, Command cmd, bool boolean) { return encode(result, cmd, std::vector<uint8_t>({ (uint8_t)boolean })); }
bool encode(std::vector<uint8_t>& result, Command cmd, std::vector<uint8_t> arguments = {});
bool supportCANFD = false;
private:
std::shared_ptr<Packetizer> packetizer;
};