Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
apollo::drivers::canbus::can::FakeCanClient Class Reference

The class which defines a fake CAN client which inherits CanClient. This fake CAN client is used for testing. More...

#include <fake_can_client.h>

Inheritance diagram for apollo::drivers::canbus::can::FakeCanClient:
Inheritance graph
Collaboration diagram for apollo::drivers::canbus::can::FakeCanClient:
Collaboration graph

Public Member Functions

bool Init (const CANCardParameter &param) override
 Initialize the fake CAN client by specified CAN card parameters. More...
 
virtual ~FakeCanClient ()=default
 Destructor. More...
 
apollo::common::ErrorCode Start () override
 Start the fake CAN client. More...
 
void Stop () override
 Stop the fake CAN client. More...
 
apollo::common::ErrorCode Send (const std::vector< CanFrame > &frames, int32_t *const frame_num) override
 Send messages. More...
 
apollo::common::ErrorCode Receive (std::vector< CanFrame > *frames, int32_t *const frame_num) override
 Receive messages. More...
 
std::string GetErrorString (const int32_t status) override
 Get the error string. More...
 
- Public Member Functions inherited from apollo::drivers::canbus::CanClient
 CanClient ()=default
 Constructor. More...
 
virtual ~CanClient ()=default
 Destructor. More...
 
virtual apollo::common::ErrorCode SendSingleFrame (const std::vector< CanFrame > &frames)
 Send a single message. More...
 

Additional Inherited Members

- Protected Attributes inherited from apollo::drivers::canbus::CanClient
bool is_started_ = false
 The CAN client is started. More...
 

Detailed Description

The class which defines a fake CAN client which inherits CanClient. This fake CAN client is used for testing.

Constructor & Destructor Documentation

◆ ~FakeCanClient()

virtual apollo::drivers::canbus::can::FakeCanClient::~FakeCanClient ( )
virtualdefault

Destructor.

Member Function Documentation

◆ GetErrorString()

std::string apollo::drivers::canbus::can::FakeCanClient::GetErrorString ( const int32_t  status)
overridevirtual

Get the error string.

Parameters
statusThe status to get the error string.

Implements apollo::drivers::canbus::CanClient.

◆ Init()

bool apollo::drivers::canbus::can::FakeCanClient::Init ( const CANCardParameter &  param)
overridevirtual

Initialize the fake CAN client by specified CAN card parameters.

Parameters
parameterCAN card parameters to initialize the CAN client.
Returns
If the initialization is successful.

Implements apollo::drivers::canbus::CanClient.

◆ Receive()

apollo::common::ErrorCode apollo::drivers::canbus::can::FakeCanClient::Receive ( std::vector< CanFrame > *  frames,
int32_t *const  frame_num 
)
overridevirtual

Receive messages.

Parameters
framesThe messages to receive.
frame_numThe amount of messages to receive.
Returns
The status of the receiving action which is defined by apollo::common::ErrorCode.

Implements apollo::drivers::canbus::CanClient.

◆ Send()

apollo::common::ErrorCode apollo::drivers::canbus::can::FakeCanClient::Send ( const std::vector< CanFrame > &  frames,
int32_t *const  frame_num 
)
overridevirtual

Send messages.

Parameters
framesThe messages to send.
frame_numThe amount of messages to send.
Returns
The status of the sending action which is defined by apollo::common::ErrorCode.

Implements apollo::drivers::canbus::CanClient.

◆ Start()

apollo::common::ErrorCode apollo::drivers::canbus::can::FakeCanClient::Start ( )
overridevirtual

Start the fake CAN client.

Returns
The status of the start action which is defined by apollo::common::ErrorCode.

Implements apollo::drivers::canbus::CanClient.

◆ Stop()

void apollo::drivers::canbus::can::FakeCanClient::Stop ( )
overridevirtual

Stop the fake CAN client.

Implements apollo::drivers::canbus::CanClient.


The documentation for this class was generated from the following file: