27 #include <sys/ioctl.h> 28 #include <sys/socket.h> 29 #include <sys/types.h> 31 #include <linux/can.h> 32 #include <linux/can/raw.h> 40 #include "modules/common/proto/error_code.pb.h" 41 #include "modules/drivers/canbus/proto/can_card_parameter.pb.h" 43 #include "gflags/gflags.h" 67 bool Init(
const CANCardParameter ¶meter)
override;
79 apollo::common::ErrorCode
Start()
override;
93 apollo::common::ErrorCode
Send(
const std::vector<CanFrame> &frames,
94 int32_t *
const frame_num)
override;
103 apollo::common::ErrorCode
Receive(std::vector<CanFrame> *
const frames,
104 int32_t *
const frame_num)
override;
113 int dev_handler_ = 0;
114 CANCardParameter::CANChannelId port_;
115 CANCardParameter::CANInterface interface_;
const int32_t MAX_CAN_RECV_FRAME_LEN
Definition: canbus_consts.h:35
std::string GetErrorString(const int32_t status) override
Get the error string.
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Defines the CanFrame struct and CanClient interface.
The class which defines the CAN client to send and receive message.
Definition: can_client.h:92
void Stop() override
Stop the ESD CAN client.
virtual ~SocketCanClientRaw()
Destructor.
const int32_t MAX_CAN_SEND_FRAME_LEN
Definition: canbus_consts.h:34
bool Init(const CANCardParameter ¶meter) override
Initialize the ESD CAN client by specified CAN card parameters.
apollo::common::ErrorCode Start() override
Start the ESD CAN client.
apollo::common::ErrorCode Receive(std::vector< CanFrame > *const frames, int32_t *const frame_num) override
Receive messages.
apollo::common::ErrorCode Send(const std::vector< CanFrame > &frames, int32_t *const frame_num) override
Send messages.
The class which defines an ESD CAN client which inherites CanClient.
Definition: socket_can_client_raw.h:60