blmc_drivers
os_interface.hpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <net/if.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <linux/can.h>
#include <linux/can/raw.h>
#include <limits.h>
#include <real_time_tools/timer.hpp>
#include <iostream>
#include <sstream>
#include <mutex>
#include <condition_variable>
#include <sys/mman.h>
Include dependency graph for os_interface.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 osi
 Common include.
 

Macros

#define rt_fprintf   fprintf
 Create a common type_def to wrap xenomai and posix.
 
#define rt_printf   printf
 Create a common type_def to wrap xenomai and posix.
 
#define rt_dev_socket   socket
 Create a common type_def to wrap xenomai and posix.
 
#define rt_dev_ioctl   ioctl
 Create a common type_def to wrap xenomai and posix.
 
#define rt_dev_close   close
 Create a common type_def to wrap xenomai and posix.
 
#define rt_dev_setsockopt   setsockopt
 Create a common type_def to wrap xenomai and posix.
 
#define rt_dev_bind   bind
 Create a common type_def to wrap xenomai and posix.
 
#define rt_dev_recvmsg   recvmsg
 Create a common type_def to wrap xenomai and posix.
 
#define rt_dev_sendto   sendto
 Create a common type_def to wrap xenomai and posix.
 

Typedefs

typedef struct can_frame can_frame_t
 xeno specific include More...
 
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.
 
typedef std::mutex osi::Mutex
 Wrapper around the posix specific Mutex implementation.
 
typedef std::condition_variable osi::ConditionVariable
 Wrapper around the posix specific ConditionVariable implementation.
 

Functions

void osi::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 osi::close_can_device (int socket)
 This function is closing a socket on the Can device. More...
 
void osi::receive_message_from_can_device (int fd, struct msghdr *msg, int flags)
 Poll? a message from the CAN device. More...
 
void osi::initialize_realtime_printing ()
 This function is needed in xenomai to initialize the real time console display of text.
 
void osi::sleep_ms (const double &sleep_time_ms)
 This function uses eather the xenomai API or the posix one. More...
 
double osi::get_current_time_ms ()
 Get the current time in millisecond. More...
 
void osi::make_this_thread_realtime ()
 This methd is requiered in xenomai to create a real time thread.
 

Detailed Description

Author
Manuel Wuthrich (manue.nosp@m.l.wu.nosp@m.thric.nosp@m.h@gm.nosp@m.ail.c.nosp@m.om)
Maximilien Naveau (maxim.nosp@m.ilie.nosp@m.n.nav.nosp@m.eau@.nosp@m.gmail.nosp@m..com)
Version
0.1
Date
2018-11-27

Typedef Documentation

◆ can_frame_t

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.