File os_interface.hpp¶
- Author
Manuel Wuthrich (manuel.wuthrich@gmail.com)
- Author
Maximilien Naveau (maximilien.naveau@gmail.com)
- Version
0.1
- Date
2018-11-27
- Copyright
Copyright (c) 2018
Defines
-
rt_fprintf¶
Create a common type_def to wrap xenomai and posix.
-
rt_printf¶
Create a common type_def to wrap xenomai and posix.
-
rt_dev_socket¶
Create a common type_def to wrap xenomai and posix.
-
rt_dev_ioctl¶
Create a common type_def to wrap xenomai and posix.
-
rt_dev_close¶
Create a common type_def to wrap xenomai and posix.
-
rt_dev_setsockopt¶
Create a common type_def to wrap xenomai and posix.
-
rt_dev_bind¶
Create a common type_def to wrap xenomai and posix.
-
rt_dev_recvmsg¶
Create a common type_def to wrap xenomai and posix.
-
rt_dev_sendto¶
Create a common type_def to wrap xenomai and posix.
Typedefs
-
typedef struct can_frame can_frame_t¶
xeno specific include
Define typedefs to make code compatible with Xenomai code.
Create a common type_def to wrap xenomai and posix.
-
typedef canid_t can_id_t¶
Create a common type_def to wrap xenomai and posix.
-
typedef uint64_t nanosecs_abs_t¶
Create a common type_def to wrap xenomai and posix.
-
namespace osi¶
Common include.
osi stands for Operating System Interface.
- Todo:
This workspace should be replaced eventually by the real_time_tools package.
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
-
inline 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.
/todo Manuel can you describe the argument of this function?
- Parameters
fd –
buf –
len –
flags –
to –
tolen –
-
inline void close_can_device(int socket)¶
This function is closing a socket on the Can device.
It is os independent.
- Parameters
socket –
-
inline void receive_message_from_can_device(int fd, struct msghdr *msg, int flags)¶
Poll? a message from the CAN device.
- Todo:
Manuel can you confrim this? And precise the arguments of the function?
- Parameters
fd –
msg –
flags –
-
inline void initialize_realtime_printing()¶
This function is needed in xenomai to initialize the real time console display of text.
-
inline void sleep_ms(const double &sleep_time_ms)¶
This function uses eather the xenomai API or the posix one.
- Parameters
sleep_time_ms – is the sleeping time in milli seconds.
-
inline double get_current_time_ms()¶
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
-
inline void make_this_thread_realtime()¶
This methd is requiered in xenomai to create a real time thread.