Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

IEEE 1588-2008 PTPv2 Client for NodeJS

License

NotificationsYou must be signed in to change notification settings

philhartung/node-ptpv2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IEEE 1588-2008 PTPv2 Client for NodeJS. Tested with ptp4l and in an AES67 Network. Needs to be executed with priviliges, because the PTP client has to bind to ports below 1024. ImplementsDelay_req andDelay_resp syncing only.

Install

npm install ptpv2

Usage

Example usage:

varptpv2=require('ptpv2');ptpv2.init('192.168.1.100',0,function(){varsynced=ptpv2.is_synced();varptpMaster=ptpv2.ptp_master();vartime=ptpv2.ptp_time();console.log(synced,ptpMaster,time);});

This should outputtrue '08-00-27-ff-fe-26-55-1f:0' [ 1591294070, 112285378 ] when synced to a master.

ptpv2.init(address, domain, callback)

Initialize the PTP system. Needs the address of the interface on which the multicast group binds to. Also takes the PTP domain number (0 - 3) and a callback that is executed, when the client synced to the master.

ptpv2.is_synced()

Returnsfalse when not synced to a PTP Master andtrue when it is synced.

ptpv2.ptp_master()

Returns the current PTP Master

ptpv2.ptp_time()

Returns the current synced up time in an array format as follows: [seconds, nanoseconds].

About

IEEE 1588-2008 PTPv2 Client for NodeJS

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp