CanBus is the implementation of the CanBusInterface.
More...
#include <can_bus.hpp>
|
static THREAD_FUNCTION_RETURN_TYPE | loop (void *instance_pointer) |
| private attributes and methods More...
|
|
|
real_time_tools::SingletypeThreadsafeObject< CanBusConnection, 1 > | can_connection_ |
| Attributes. More...
|
|
std::shared_ptr< real_time_tools::ThreadsafeTimeseries< CanBusFrame > > | input_ |
| input_ is a list of time stamped frame to be send to the can network.
|
|
std::shared_ptr< real_time_tools::ThreadsafeTimeseries< CanBusFrame > > | sent_input_ |
| sent_inupt_ is the list of the input already sent to the network.
|
|
std::shared_ptr< real_time_tools::ThreadsafeTimeseries< CanBusFrame > > | output_ |
| output_ is the list of the frames received from the can network.
|
|
bool | is_loop_active_ |
| This boolean makes sure that the loop is not active upon destruction of the current object.
|
|
real_time_tools::RealTimeThread | rt_thread_ |
| rt_thread_ is the thread object allowing us to spawn real-time threads.
|
|
std::string | log_dir_ |
| Log directory.
|
|
std::string | name_ |
| time_log_name is the name of the loggin
|
|
CanBus is the implementation of the CanBusInterface.
◆ CanBus()
blmc_drivers::CanBus::CanBus |
( |
const std::string & |
can_interface_name, |
|
|
const size_t & |
history_length = 1000 |
|
) |
| |
Construct a new CanBus object.
- Parameters
-
can_interface_name | |
history_length | |
◆ get_input_frame()
virtual std::shared_ptr<const CanframeTimeseries> blmc_drivers::CanBus::get_input_frame |
( |
| ) |
|
|
inlinevirtual |
◆ get_output_frame()
std::shared_ptr<const CanframeTimeseries> blmc_drivers::CanBus::get_output_frame |
( |
| ) |
const |
|
inlinevirtual |
◆ get_sent_input_frame()
virtual std::shared_ptr<const CanframeTimeseries> blmc_drivers::CanBus::get_sent_input_frame |
( |
| ) |
|
|
inlinevirtual |
◆ loop()
static THREAD_FUNCTION_RETURN_TYPE blmc_drivers::CanBus::loop |
( |
void * |
instance_pointer | ) |
|
|
inlinestaticprivate |
private attributes and methods
This function is an helper that allows us to launch real-time thread in xenaomai, ubunt, or rt-preempt seemlessly.
- Parameters
-
- Returns
- THREAD_FUNCTION_RETURN_TYPE (is void or void* depending on the OS.
◆ receive_frame()
Get the output frame from the bus.
- Returns
- CanBusFrame is the output frame data.
◆ send_frame()
void blmc_drivers::CanBus::send_frame |
( |
const CanBusFrame & |
unstamped_can_frame | ) |
|
|
private |
Send input data.
- Parameters
-
unstamped_can_frame | is a frame without id nor time. |
◆ send_if_input_changed()
void blmc_drivers::CanBus::send_if_input_changed |
( |
| ) |
|
|
virtual |
◆ set_input_frame()
virtual void blmc_drivers::CanBus::set_input_frame |
( |
const CanBusFrame & |
input_frame | ) |
|
|
inlinevirtual |
◆ setup_can()
CanBusConnection blmc_drivers::CanBus::setup_can |
( |
std::string |
name, |
|
|
uint32_t |
err_mask |
|
) |
| |
|
private |
Setup and initialize the CanBus object.
It connects to the can bus. This method is used once in the constructor.
- Parameters
-
name | is the can card name. |
err_mask,always | used with "0" so far (TODO: Manuel explain) |
- Returns
- CanBusConnection
◆ can_connection_
real_time_tools::SingletypeThreadsafeObject<CanBusConnection, 1> blmc_drivers::CanBus::can_connection_ |
|
private |
Attributes.
can_connection_ is the communication object allowing to send or receive can frames.
The documentation for this class was generated from the following files: