libptpmgmt
1.4
libptpmgmt library that provides the functionality of linuxptp pmc
|
POSIX dynamic clock id generator. More...
#include <ptp.h>
Public Member Functions | |
bool | initUsingDevice (const std::string &device, bool readonly=false) |
bool | initUsingIndex (int ptpIndex, bool readonly=false) |
bool | isInit () const |
clockid_t | clkId () const |
int | getFd () const |
int | fileno () const |
int | ptpIndex () const |
const std::string & | device () const |
const char * | device_c () const |
bool | setTimeFromSys () const |
bool | setTimeToSys () const |
bool | fetchCaps (PtpCaps_t &caps) const |
bool | readPin (unsigned int index, PtpPin_t &pin) const |
bool | writePin (PtpPin_t &pin) const |
bool | ExternTSEbable (unsigned int index, uint8_t flags) const |
bool | ExternTSDisable (unsigned int index) const |
bool | MaskClearAll () const |
bool | MaskEnable (unsigned int index) const |
bool | readEvent (PtpEvent_t &event) const |
bool | readEvents (std::vector< PtpEvent_t > &events, size_t max=0) const |
bool | setPinPeriod (unsigned int index, PtpPinPeriodDef_t times, uint8_t flags=0) const |
bool | setPtpPpsEvent (bool enable) const |
bool | samplePtpSys (size_t count, std::vector< PtpSample_t > &samples) const |
bool | extSamplePtpSys (size_t count, std::vector< PtpSampleExt_t > &samples) const |
bool | preciseSamplePtpSys (PtpSamplePrecise_t &sample) const |
Public Member Functions inherited from BaseClock | |
Timestamp_t | getTime () const |
bool | setTime (const Timestamp_t &ts) const |
bool | offsetClock (int64_t offset) const |
float_freq | getFreq () const |
bool | setFreq (float_freq freq) const |
bool | setPhase (int64_t offset) const |
Static Public Member Functions | |
static bool | isCharFile (const std::string &file) |
POSIX dynamic clock id generator.
Create a dynamic clock id for a POSIX clock, that the application can use to fetch the PTP clock time and perform actions on PHC hardware.
|
inline |
Get dynamic clock id
|
inline |
Get POSIX device name
|
inline |
Get POSIX device name
bool PtpClock::ExternTSDisable | ( | unsigned int | index | ) | const |
Disable PHC pin external events
[in] | index | pin index to enable |
bool PtpClock::ExternTSEbable | ( | unsigned int | index, |
uint8_t | flags | ||
) | const |
Enable PHC pin external events
[in] | index | pin index to enable |
[in] | flags | using the PTP_EXTERN_TS_xxx flags |
bool PtpClock::extSamplePtpSys | ( | size_t | count, |
std::vector< PtpSampleExt_t > & | samples | ||
) | const |
Extended sample the PHC and system clock So caller can compare offset and frequancy
[in] | count | number of sample to measure |
[out] | samples | taken by kernel |
bool PtpClock::fetchCaps | ( | PtpCaps_t & | caps | ) | const |
Get PTP clock capabilities
[out] | caps | capabilities |
|
inline |
Get file description
|
inline |
Get file description
bool PtpClock::initUsingDevice | ( | const std::string & | device, |
bool | readonly = false |
||
) |
Initialize a POSIX clock based on its device name
[in] | device | name |
[in] | readonly | open clock to read only |
bool PtpClock::initUsingIndex | ( | int | ptpIndex, |
bool | readonly = false |
||
) |
Initialize a PTP clock based on its index
[in] | ptpIndex | clock PTP index |
[in] | readonly | open clock to read only |
|
static |
Check file is a char file
[in] | file | name to check |
|
inline |
Is object initialized
bool PtpClock::MaskClearAll | ( | ) | const |
PHC clear all mask
bool PtpClock::MaskEnable | ( | unsigned int | index | ) | const |
PHC ebable single pin mask
[in] | index | pin index in mask to enable |
bool PtpClock::preciseSamplePtpSys | ( | PtpSamplePrecise_t & | sample | ) | const |
Precise sample the PHC using PCI cross time stamp
[out] | sample | taken by kernel |
|
inline |
Get PTP index
bool PtpClock::readEvent | ( | PtpEvent_t & | event | ) | const |
Read single external event
[out] | event | retrieved event |
bool PtpClock::readEvents | ( | std::vector< PtpEvent_t > & | events, |
size_t | max = 0 |
||
) | const |
Read external events
[out] | events | retrieved events |
[in] | max | maximum number of events to read |
bool PtpClock::readPin | ( | unsigned int | index, |
PtpPin_t & | pin | ||
) | const |
Read PHC clock pin current functional state
[in] | index | pin index to read |
[out] | pin | hardware functional state |
bool PtpClock::samplePtpSys | ( | size_t | count, |
std::vector< PtpSample_t > & | samples | ||
) | const |
Sample the PHC and system clock So caller can compare offset and frequancy
[in] | count | number of sample to measure |
[out] | samples | taken by kernel |
bool PtpClock::setPinPeriod | ( | unsigned int | index, |
PtpPinPeriodDef_t | times, | ||
uint8_t | flags = 0 |
||
) | const |
Set PHC pin period signal
[in] | index | pin index |
[in] | times | provides the times used for the period |
[in] | flags | using the PTP_PERIOD_xxx flags |
bool PtpClock::setPtpPpsEvent | ( | bool | enable | ) | const |
Enable or disable Linux pulse per second event
[in] | enable | flag |
bool PtpClock::setTimeFromSys | ( | ) | const |
Set PHC time using the system clock
bool PtpClock::setTimeToSys | ( | ) | const |
Set system clock using the PHC as source time
bool PtpClock::writePin | ( | PtpPin_t & | pin | ) | const |
Set PHC clock pin functional state
[in] | pin | hardware functional state |