Classes | Functions | Variables
shm_driver.cpp File Reference
#include <ros/ros.h>
#include <ros/console.h>
#include <sensor_msgs/TimeReference.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <signal.h>
#include <cstring>
#include <cerrno>
#include <Poco/Process.h>
#include <Poco/Pipe.h>
#include <Poco/PipeStream.h>
#include <Poco/Format.h>
#include <Poco/StreamCopier.h>
Include dependency graph for shm_driver.cpp:

Go to the source code of this file.

Classes

struct  shmTime
 

Functions

static volatile struct shmTimeget_shmTime (int unit)
 
int main (int argc, char *argv[])
 
static void memory_barrier (void)
 
static void put_shmTime (volatile struct shmTime **shm)
 
static void sig_handler (int sig)
 
static void time_ref_cb (const sensor_msgs::TimeReference::ConstPtr &time_ref)
 

Variables

static bool g_set_date = false
 
volatile struct shmTimeg_shm = NULL
 
const long int NTPD_SHM_BASE = 0x4e545030
 

Detailed Description

ROS ntpd driver (via shm)

This node will subscribe to any TimeReference message and sends it's data to ntpd.

Author
Vladimir Ermakov vooon.nosp@m.341@.nosp@m.gmail.nosp@m..com BSD

Copyright 2014 Vladimir Ermakov. Based on ntpshm.c from gpsd.

Definition in file shm_driver.cpp.

Function Documentation

static volatile struct shmTime* get_shmTime ( int  unit)
static

Map SHM page

NOTE: this function did not create SHM like gpsd/ntpshm.c

Definition at line 66 of file shm_driver.cpp.

int main ( int  argc,
char *  argv[] 
)

Definition at line 203 of file shm_driver.cpp.

static void memory_barrier ( void  )
inlinestatic

Memory barrier. unfortunatly we can't use C stdatomic.h So only one option: asm magick

from gpsd compiler.h

Definition at line 122 of file shm_driver.cpp.

static void put_shmTime ( volatile struct shmTime **  shm)
static

Definition at line 93 of file shm_driver.cpp.

static void sig_handler ( int  sig)
static

Definition at line 110 of file shm_driver.cpp.

static void time_ref_cb ( const sensor_msgs::TimeReference::ConstPtr &  time_ref)
static

Definition at line 127 of file shm_driver.cpp.

Variable Documentation

bool g_set_date = false
static

Definition at line 108 of file shm_driver.cpp.

volatile struct shmTime* g_shm = NULL

global SHM time handle

Definition at line 107 of file shm_driver.cpp.

const long int NTPD_SHM_BASE = 0x4e545030

Definition at line 60 of file shm_driver.cpp.



ntpd_driver
Author(s): Vladimir Ermakov
autogenerated on Thu Feb 25 2021 03:06:49