DCMD_PTPD_GET_TIME
QNX SDP8.0Devctl and Ioctl CommandsDeveloper
Get the current time
Synopsis:
#include <dcmd_ptpd.h>
#define DCMD_PTPD_GET_TIME __DIOF(_DCMD_NET, 15, MyTimeInternal )
Arguments to devctl():
Argument | Value |
---|---|
filedes | A file descriptor that you obtained by opening /dev/ptpd |
dcmd | DCMD_PTPD_GET_TIME |
dev_data_ptr | A pointer to a MyTimeInternal |
n_bytes | sizeof(MyTimeInternal) |
dev_info_ptr | NULL |
Description:
This command gets the current time that's maintained by the Precision Time Protocol.
Note:
To use this command, you must specify the -K option when you start
ptpd2.
Input:
None.
Output:
A filled-in MyTimeInternal structure, which is defined in <dcmd_ptpd.h> as follows:
typedef struct {
uint32_t seconds;
uint32_t nanoseconds;
} MyTimeInternal;
Example:
MyTimeInternal curr_time;
if(devctl(fd, DCMD_PTPD_GET_TIME, &curr_time, sizeof(curr_time), NULL) != EOK)
{
/* Error */
}
See also:
DCMD_PTPD_DELAYMS, DCMD_PTPD_DELAYSM, DCMD_PTPD_GET_PDELAY_INTERVAL, DCMD_PTPD_GET_TAI_UTC_OFFSET, DCMD_PTPD_INFO, DCMD_PTPD_SEND_SIGNALING_MSG, DCMD_PTPD_SET_PDELAY_INTERVAL, DCMD_PTPD_STATUS
devctl() in the QNX OS C Library Reference
ptpd2 in the Utilities Reference
Page updated: