Coder Social home page Coder Social logo

whyengineer / excelfore-gptp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xl4-shiro/excelfore-gptp

2.0 1.0 3.0 676 KB

gPTP, IEEE 802.1AS-REV implementation

License: GNU General Public License v2.0

Makefile 1.55% Shell 1.15% M4 0.30% Python 9.34% C 85.00% C++ 2.65%

excelfore-gptp's Introduction

Excelfore gPTP - IEEE 802.1AS

  • Implementation of 802.1AS (including 802.1AS-REV part)
  • Endpoint mode / Bridge mode
  • Single domain mode / Multiple domains mode

Prerequisites

  • C99 standard level library functions and C compiler functions must be supported to build.
  • POSIX library is basically needed.
  • Excelfore unibase([email protected]:xl4-shiro/xl4unibase.git), Excelfore combase([email protected]:xl4-shiro/xl4combase.git)
  • cmocka library is needed to run the unit tests.
    Skipping the unit tests is possible by adding '--disable-unittest' parameter on 'configure'.

To run 'gptp2d' on a Linux platform, the kernel must support HW timestamping on PTP event messages.
'ethtool' command can check it as follows:
(the information is provided by the kernel driver, and it is most likely correct but not 100%.)

 $ ethtool -T eth0
 Time stamping parameters for eth0:
 Capabilities:
 	hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
 	software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
 	hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
 	software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
 	software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
 	hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
 PTP Hardware Clock: 0
 ...

Build

When xl4unibase and xl4combase are not installed, install them first.

$ git clone [email protected]:xl4-shiro/xl4unibase.git
$ cd xl4unibase
$ ./autogetn.sh; cd buid; ../configure; make install

$ git clone [email protected]:xl4-shiro/xl4combase.git
$ cd xl4combase
$ ./autogetn.sh; cd buid; ../configure; make install

Then, in this gptp2 directory,

$ ./autogetn.sh
$ mkdir build
$ cd build
$ ../configure
$ make

To run unit tests,

$ make check

Some of the unit tests do timing checks which possibly fail under some conditions;
e.g. if the build machine runs a heavy task in the background, the timing measurement
can't be accurate and the result may be out of the criterion.
Such fails won't affect on the performance of 'gptp2d'.

Run gptp2d daemon process

Run simply from a console as follows:

$ sudo gptp2d -d eth0

For multiple ethernet devices(bridge mode):

$ sudo gptp2d -d eth0,eth1,eth2,...

In the slave mode, the console will show the frequency adjustment rate in ppb as follows:

INF:domainNumber=0, clock_master_sync_receive:the master clock rate to 21344ppb

get gptp time in application

Any applications which use the gPTP clock values need to link to 'libx4gptp2'.
'gptpmasterclock.h' shows what functions are available in the library.
To get gptp clock value, 'gptpmasterclock_getts64()' can be called.

To check the status of 'gptp2d', use IPC functions.
'gptpipc.h' shows such functions and data structures.
To understand IPC functions, check 'gptpipcmon.c' as a reference.

Configurations

'gptp2.conf' is generated by the build.
All the configuration items are commented out in the file.
You can un-comment and set values on any items you want to configure.

Set an option in the gptp2d command line to use the config file as follows:

$ sudo gptp2d -c gptp2.conf -d eth0

License

All files in this project are released under 'GNU General Public License Version 2'.
If you want to use the files under a different license, please contact to Excelfore
sales representatives.

Contact Us

Excelfore Corporation
[email protected] / [email protected]
3155 Kerney Street
Freemont, California 94538 USA
+1-510-868-2500

excelfore-gptp's People

Contributors

xl4-shiro avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.