allow different dlc (#1294)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
b6e0113320
commit
89736f85f7
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue