Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
rusefillc 2020-12-12 16:42:02 -05:00
commit 73fc4e4f8b
2 changed files with 3 additions and 3 deletions

View File

@ -26,8 +26,8 @@ extern int canWriteNotOk;
s_device = device; s_device = device;
} }
CanTxMessage::CanTxMessage(uint32_t eid, uint8_t dlc) { CanTxMessage::CanTxMessage(uint32_t eid, uint8_t dlc, bool isExtended) {
m_frame.IDE = CAN_IDE_STD; m_frame.IDE = isExtended ? CAN_IDE_EXT : CAN_IDE_STD;
m_frame.EID = eid; m_frame.EID = eid;
m_frame.RTR = CAN_RTR_DATA; m_frame.RTR = CAN_RTR_DATA;
m_frame.DLC = dlc; m_frame.DLC = dlc;

View File

@ -28,7 +28,7 @@ public:
/** /**
* Create a new CAN message, with the specified extended ID. * Create a new CAN message, with the specified extended ID.
*/ */
explicit CanTxMessage(uint32_t eid, uint8_t dlc = 8); explicit CanTxMessage(uint32_t eid, uint8_t dlc = 8, bool isExtended = false);
/** /**
* Destruction of an instance of CanTxMessage will transmit the message over the wire. * Destruction of an instance of CanTxMessage will transmit the message over the wire.