Apollo
6.0
Open source self driving car software
|
The class which defines the CAN client to send and receive message. More...
#include <can_client.h>
Public Member Functions | |
CanClient ()=default | |
Constructor. More... | |
virtual | ~CanClient ()=default |
Destructor. More... | |
virtual bool | Init (const CANCardParameter ¶meter)=0 |
Initialize the CAN client by specified CAN card parameters. More... | |
virtual apollo::common::ErrorCode | Start ()=0 |
Start the CAN client. More... | |
virtual void | Stop ()=0 |
Stop the CAN client. More... | |
virtual apollo::common::ErrorCode | Send (const std::vector< CanFrame > &frames, int32_t *const frame_num)=0 |
Send messages. More... | |
virtual apollo::common::ErrorCode | SendSingleFrame (const std::vector< CanFrame > &frames) |
Send a single message. More... | |
virtual apollo::common::ErrorCode | Receive (std::vector< CanFrame > *const frames, int32_t *const frame_num)=0 |
Receive messages. More... | |
virtual std::string | GetErrorString (const int32_t status)=0 |
Get the error string. More... | |
Protected Attributes | |
bool | is_started_ = false |
The CAN client is started. More... | |
The class which defines the CAN client to send and receive message.
|
default |
Constructor.
|
virtualdefault |
Destructor.
|
pure virtual |
Get the error string.
status | The status to get the error string. |
Implemented in apollo::drivers::canbus::can::SocketCanClientRaw, apollo::drivers::canbus::can::HermesCanClient, apollo::drivers::canbus::can::EsdCanClient, and apollo::drivers::canbus::can::FakeCanClient.
|
pure virtual |
Initialize the CAN client by specified CAN card parameters.
parameter | CAN card parameters to initialize the CAN client. |
Implemented in apollo::drivers::canbus::can::SocketCanClientRaw, apollo::drivers::canbus::can::HermesCanClient, apollo::drivers::canbus::can::EsdCanClient, and apollo::drivers::canbus::can::FakeCanClient.
|
pure virtual |
Receive messages.
frames | The messages to receive. |
frame_num | The amount of messages to receive. |
Implemented in apollo::drivers::canbus::can::SocketCanClientRaw, apollo::drivers::canbus::can::HermesCanClient, apollo::drivers::canbus::can::EsdCanClient, and apollo::drivers::canbus::can::FakeCanClient.
|
pure virtual |
Send messages.
frames | The messages to send. |
frame_num | The amount of messages to send. |
Implemented in apollo::drivers::canbus::can::SocketCanClientRaw, apollo::drivers::canbus::can::HermesCanClient, apollo::drivers::canbus::can::EsdCanClient, and apollo::drivers::canbus::can::FakeCanClient.
|
inlinevirtual |
Send a single message.
frames | A single-element vector containing only one message. |
|
pure virtual |
Start the CAN client.
Implemented in apollo::drivers::canbus::can::SocketCanClientRaw, apollo::drivers::canbus::can::HermesCanClient, apollo::drivers::canbus::can::EsdCanClient, and apollo::drivers::canbus::can::FakeCanClient.
|
pure virtual |
Stop the CAN client.
Implemented in apollo::drivers::canbus::can::SocketCanClientRaw, apollo::drivers::canbus::can::HermesCanClient, apollo::drivers::canbus::can::EsdCanClient, and apollo::drivers::canbus::can::FakeCanClient.
|
protected |
The CAN client is started.