Woman, Life, Freedom |
OBD-II Emulator
Linux ODB-II Emulator public and protected interfaces documentation
|
CAN bus controller driver helper. More...
#include <can_driver.h>
Public Member Functions | |
CanDriver (CanBusSpeed speed, bool supportExtended) | |
Constructor. More... | |
std::vector< uint8_t > | GetConfiguration () const |
Get CAN bus communication configuration packet. More... | |
std::vector< uint8_t > | Serialize (const CanFrame &frame) const |
Serialize a CAN frame to a variable length byte array. More... | |
CanFrame | Deserialize (const std::vector< uint8_t > &packet) const |
Deserialize a packet to a CAN frame. More... | |
Static Public Attributes | |
static constexpr size_t | cFixedFrameSize {20} |
Fixed CAN frame data packet size. | |
CAN bus controller driver helper.
ObdEmulator::CanDriver::CanDriver | ( | CanBusSpeed | speed, |
bool | supportExtended | ||
) |
Constructor.
speed | CAN bus communication speed |
supportExtended | Indicates whether extended frame is supported or not |
CanFrame ObdEmulator::CanDriver::Deserialize | ( | const std::vector< uint8_t > & | packet | ) | const |
Deserialize a packet to a CAN frame.
packet | Packet data array to be deserialized |
std::invalid_argument | Throws if the input packet is invalid |
std::vector< uint8_t > ObdEmulator::CanDriver::GetConfiguration | ( | ) | const |
Get CAN bus communication configuration packet.
std::vector< uint8_t > ObdEmulator::CanDriver::Serialize | ( | const CanFrame & | frame | ) | const |
Serialize a CAN frame to a variable length byte array.
frame | Frame to be serialized |
std::invalid_argument | Throws if the input frame is invalid |