mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
CAN FD transmission on non CAN FD hardware now fails as would be expected
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user