blmc_drivers
osi Namespace Reference

Common include. More...

Typedefs

typedef std::mutex Mutex
 Wrapper around the posix specific Mutex implementation.
 
typedef std::condition_variable ConditionVariable
 Wrapper around the posix specific ConditionVariable implementation.
 

Functions

void send_to_can_device (int fd, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen)
 Use the osi workspace API to communicate with the can bus. More...
 
void close_can_device (int socket)
 This function is closing a socket on the Can device. More...
 
void receive_message_from_can_device (int fd, struct msghdr *msg, int flags)
 Poll? a message from the CAN device. More...
 
void initialize_realtime_printing ()
 This function is needed in xenomai to initialize the real time console display of text.
 
void sleep_ms (const double &sleep_time_ms)
 This function uses eather the xenomai API or the posix one. More...
 
double get_current_time_ms ()
 Get the current time in millisecond. More...
 
void make_this_thread_realtime ()
 This methd is requiered in xenomai to create a real time thread.
 

Detailed Description

Common include.

osi stands for Operating System Interface.

Todo:
This workspace should be replaced eventually by the real_time_tools package.

Function Documentation

◆ close_can_device()

void osi::close_can_device ( int  socket)
inline

This function is closing a socket on the Can device.

It is os independent.

Parameters
socket

◆ get_current_time_ms()

double osi::get_current_time_ms ( )
inline

Get the current time in millisecond.

Todo:
remove as the one form the Timer class is much better embeded.
Returns
double which is the time in milli second

◆ receive_message_from_can_device()

void osi::receive_message_from_can_device ( int  fd,
struct msghdr *  msg,
int  flags 
)
inline

Poll? a message from the CAN device.

Todo:
Manuel can you confrim this? And precise the arguments of the function?
Parameters
fd
msg
flags

◆ send_to_can_device()

void osi::send_to_can_device ( int  fd,
const void *  buf,
size_t  len,
int  flags,
const struct sockaddr *  to,
socklen_t  tolen 
)
inline

Use the osi workspace API to communicate with the can bus.

/todo Manuel can you describe the argument of this function?

Parameters
fd
buf
len
flags
to
tolen

◆ sleep_ms()

void osi::sleep_ms ( const double &  sleep_time_ms)
inline

This function uses eather the xenomai API or the posix one.

Parameters
sleep_time_msis the sleeping time in milli seconds.