allow different dlc (#1294)

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2020-04-13 14:05:52 -07:00 committed by GitHub
parent b6e0113320
commit 89736f85f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -23,11 +23,11 @@ extern LoggingWithStorage sharedLogger;
s_device = device; s_device = device;
} }
CanTxMessage::CanTxMessage(uint32_t eid) { CanTxMessage::CanTxMessage(uint32_t eid, uint8_t dlc) {
m_frame.IDE = CAN_IDE_STD; m_frame.IDE = 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 = 8; m_frame.DLC = dlc;
memset(m_frame.data8, 0, sizeof(m_frame.data8)); memset(m_frame.data8, 0, sizeof(m_frame.data8));
} }

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.
*/ */
CanTxMessage(uint32_t eid); CanTxMessage(uint32_t eid, uint8_t dlc = 8);
/** /**
* 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.