PDK API Guide for J721E

Introduction

Files

file  gptpbasetypes.h
 File contains base datatypes used, as per IEEE 802.1AS Standard Documentation.
 
file  gptpmasterclock.h
 file contains gptp master clock related functions.
 
file  gptpipc.h
 Defines and methods for gPTP2.
 

Data Structures

struct  PortIdentity
 The portIdentity identifies a port of a time-aware system. More...
 
struct  ClockQuality
 The clock quality represents quality of clock. More...
 
struct  UInteger48
 48bit variable, lsb is 32 bits More...
 
struct  UInteger48m32
 48bit variable, msb is 32 bits More...
 
struct  UInteger112
 UInteger112 (802.1AS, 10.3.2 systemIdentity) More...
 
struct  UInteger224
 UInteger224 (802.1AS, 10.3.4 time-synchronization spanning tree priority vectors ) More...
 
struct  ScaledNs
 The ScaledNs type represents signed values of time and time interval in units of 2e-16 ns. More...
 
struct  UScaledNs
 The ScaledNs type represents unsigned values of time and time interval in units of 2^-16 ns. More...
 
struct  TimeInterval
 
struct  Timestamp
 The Timestamp type represents a positive time with respect to the epoch. More...
 
struct  ExtendedTimestamp
 The ExtendTimestamp type represents a positive time with respect to the epoch. The fractionalNanoseconds member is the fractional portion of the timestamp in units of 2^16 ns. More...
 
struct  gptpipc_notice_data
 gptp notice data type More...
 
struct  gptpipc_client_req_abnormal
 gptp ipc client request, register/deregister abnormal event. More...
 
struct  gptpipc_client_req_data
 gptp ipc client request data. this structure formed with following details: More...
 
struct  gptpipc_data_netlink
 
struct  gptpipc_ndport_data
 to retreive netlink status. this structure has nlstatus type of gptpipc_data_netlinnk_t. for more details read More...
 
struct  gptpipc_gport_data
 grand master port data. this structure formed with following details: More...
 
struct  gptpipc_clock_data
 gptp clock data. More...
 
struct  gptpipc_statistics_system
 
struct  gptpipc_statistics_tas
 
struct  gptpipc_gptpd_data
 data type to be used in IPC. More...
 
struct  gptpipc_thread_data_t
 variables to run gptp ipc thread More...
 

Functions

struct UInteger112 __attribute__ ((packed, aligned(1))) UInteger112
 UInteger112 (802.1AS, 10.3.2 systemIdentity) More...
 
int gptpmasterclock_init (const char *shmem_name)
 initialize to get gptp clock from gptp2 daemon. if previously initialized, it will simply return 0. More...
 
int gptpmasterclock_close (void)
 close gptpmasterclcock More...
 
int gptpmasterclock_gm_domainIndex (void)
 return the domainIndex which is currently used as systeme wide gptp clock. More...
 
int gptpmasterclock_gm_domainNumber (void)
 return the domainNumber which is currently used as system wide gptp clock. More...
 
int64_t gptpmasterclock_getts64 (void)
 get 64-bit nsec unit ts of system wide gptp clock More...
 
int gptpmasterclock_wait_until_ts64 (int64_t tts, int64_t vclose, int64_t toofar)
 Wait until tts comes. More...
 
uint64_t gptpmasterclock_expand_timestamp (uint32_t timestamp)
 expand 32-bit nsec time to 64 bit with aligning to gptp clock. More...
 
int gptpmasterclock_gmchange_ind (void)
 get GM change indicator, the number is incremented whenever GM is changed More...
 
int gptpmasterclock_get_max_domains (void)
 get maximum number of domains More...
 
int gptpmasterclock_get_domain_ts64 (int64_t *ts64, int domainIndex)
 get a synchronized clock value on specific domain More...
 
void gptpmasterclock_dump_offset (void)
 print phase offset for all domains More...
 
struct gptpipc_notice_data __attribute__ ((packed)) gptpipc_notice_data_t
 gptp notice data type More...
 
int send_ipc_request (int ipcfd, int domainNumber, int portIndex, gptp_ipc_command_t cmd)
 request IPC data More...
 
int gptpipc_init (gptpipc_thread_data_t *ipctd, int wait_toutsec)
 run gptp2d ipc thread More...
 
int gptpipc_close (gptpipc_thread_data_t *ipctd)
 close IPC thread. More...
 

Variables

typedef __attribute__
 

Typedefs

typedef uint8_t ClockIdentity[CLOCK_IDENTITY_LENGTH]
 
typedef uint8_t Nibble
 Primitive data types specifications for IEEE 802.1AS. All non-primitive data types are derived from the primitive types, signed integers are represented as two's complement form. More...
 
typedef uint8_t Octet
 
typedef uint8_t Octet2[2]
 
typedef uint8_t Octet3[3]
 
typedef uint8_t Octet4[4]
 
typedef uint8_t Enumeration2
 
typedef uint8_t Enumeration4
 
typedef uint8_t Enumeration8
 
typedef uint16_t Enumeration16
 
typedef uint32_t Enumeration24
 
typedef uint8_t UInteger4
 
typedef int(* gptpipc_cb_t) (gptpipc_gptpd_data_t *ipcrd, void *cb_data)
 

Enumerations

enum  TimeSource {
  ATOMIC_CLOCK = 0x10, GPS = 0x20, TERRESTRIAL_RADIO = 0x30, PTP = 0x40,
  NTP = 0x50, HAND_SET = 0x60, OTHER = 0x90, INTERNAL_OSCILLATOR = 0xA0
}
 the type of source of time used by a ClockMaster(802.1AS, 8.6.2.7 timeSource) More...
 
enum  PTPPortState { DisabledPort = 3, MasterPort = 6, PassivePort = 7, SlavePort = 9 }
 value of the port state (802.1AS 14.8.3 portState) More...
 
enum  gptp_ipc_command_t {
  GPTPIPC_CMD_NOP =0, GPTPIPC_CMD_REQ_NDPORT_INFO, GPTPIPC_CMD_REQ_GPORT_INFO, GPTPIPC_CMD_REQ_CLOCK_INFO,
  GPTPIPC_CMD_ACTIVE_DOMAINT_SWITCH, GPTPIPC_CMD_RUN_EXT_SCRIPT, GPTPIPC_CMD_TSN_SCHEDULE_CONTROL, GPTPIPC_CMD_REQ_STAT_INFO,
  GPTPIPC_CMD_REQ_STAT_INFO_RESET, GPTPIPC_CMD_REG_ABNORMAL_EVENT, GPTPIPC_CMD_DISCONNECT
}
 command for gptp ipc. More...
 
enum  gptpipc_event_t {
  GPTPIPC_EVENT_CLOCK_NETDEV_DOWN = 0, GPTPIPC_EVENT_CLOCK_NETDEV_UP, GPTPIPC_EVENT_CLOCK_PHASE_UPDATE, GPTPIPC_EVENT_CLOCK_FREQ_UPDATE,
  GPTPIPC_EVENT_CLOCK_GM_SYNCED, GPTPIPC_EVENT_CLOCK_GM_UNSYNCED, GPTPIPC_EVENT_CLOCK_GM_CHANGE, GPTPIPC_EVENT_PORT_AS_CAPABLE_DOWN,
  GPTPIPC_EVENT_PORT_AS_CAPABLE_UP, GPTPIPC_EVENT_CLOCK_ACTIVE_DOMAIN, GPTPIPC_EVENT_CLOCK_TIMELEAP_FUTURE, GPTPIPC_EVENT_CLOCK_TIMELEAP_PAST
}
 Enumeration for GPTP IPC events. More...
 
enum  gptpd_data_type_t {
  GPTPIPC_GPTPD_NOTICE = 0, GPTPIPC_GPTPD_NDPORTD, GPTPIPC_GPTPD_GPORTD, GPTPIPC_GPTPD_CLOCKD,
  GPTPIPC_GPTPD_STATSD, GPTPIPC_GPTPD_STATTD
}
 data from gptp2d to connected clients More...
 

Macros

#define MAX_PORT_NUMBER_LIMIT   33
 Macro which defines Maximum port number limit for gPTP2. More...
 
#define MAX_PATH_TRACE_N   179
 Macro to define maximum path trace. More...
 
#define CLOCK_IDENTITY_LENGTH   8
 Macro which defines Clock Identity Length. More...
 
#define VALUE_DISABLED   0
 
#define VALUE_ENABLED   1
 
#define GPTP2D_IPC_CB_SOCKET_NODE   "/tmp/gptp2d_ipc"
 IPC node for gptp2 communication This node is used to communicate with gptp2 internally. More...
 
#define GPTPIPC_EXT_SCRIPT   "gptpipc_extscript"
 
#define GPTPIPC_EVENT_CLOCK_FLAG_NETDEV_DOWN   (1<<GPTPIPC_EVENT_CLOCK_NETDEV_DOWN)
 Macro which is used to define event flag. it is set using bitwise operation. More...
 
#define GPTPIPC_EVENT_CLOCK_FLAG_NETDEV_UP   (1<<GPTPIPC_EVENT_CLOCK_NETDEV_UP)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_PHASE_UPDATE   (1<<GPTPIPC_EVENT_CLOCK_PHASE_UPDATE)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_FREQ_UPDATE   (1<<GPTPIPC_EVENT_CLOCK_FREQ_UPDATE)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_GM_SYNCED   (1<<GPTPIPC_EVENT_CLOCK_GM_SYNCED)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_GM_UNSYNCED   (1<<GPTPIPC_EVENT_CLOCK_GM_UNSYNCED)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_GM_CHANGE   (1<<GPTPIPC_EVENT_CLOCK_GM_CHANGE)
 
#define GPTPIPC_EVENT_PORT_FLAG_AS_CAPABLE_DOWN   (1<<GPTPIPC_EVENT_PORT_AS_CAPABLE_DOWN)
 
#define GPTPIPC_EVENT_PORT_FLAG_AS_CAPABLE_UP   (1<<GPTPIPC_EVENT_PORT_AS_CAPABLE_UP)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_ACTIVE_DOMAIN   (1<<GPTPIPC_EVENT_CLOCK_ACTIVE_DOMAIN)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_TIMELEAP_FUTURE   (1<<GPTPIPC_EVENT_CLOCK_TIMELEAP_FUTURE)
 
#define GPTPIPC_EVENT_CLOCK_FLAG_TIMELEAP_PAST   (1<<GPTPIPC_EVENT_CLOCK_TIMELEAP_PAST)
 
#define GPTPIPC_MAX_NETDEV_NAME   16
 gptp data for netlink. this structure is formed with following details: More...
 
#define GPTPIPC_MAX_PTPDEV_NAME   32
 

Macro Definition Documentation

◆ MAX_PORT_NUMBER_LIMIT

#define MAX_PORT_NUMBER_LIMIT   33

Macro which defines Maximum port number limit for gPTP2.

Note
CONF_MAX_PORT_NUMBER can be configured at a runtime, it must be less than this numumber

◆ MAX_PATH_TRACE_N

#define MAX_PATH_TRACE_N   179

Macro to define maximum path trace.

Note
The maximum possible number is 179 based on specification we can set the maximum here and restrict the frame using MAX_PTP_PACKET instead
#define MAX_PATH_TRACE_N 179
See also
10.3.8.23 pathTrace

◆ CLOCK_IDENTITY_LENGTH

#define CLOCK_IDENTITY_LENGTH   8

Macro which defines Clock Identity Length.

◆ VALUE_DISABLED

#define VALUE_DISABLED   0

◆ VALUE_ENABLED

#define VALUE_ENABLED   1

◆ GPTP2D_IPC_CB_SOCKET_NODE

#define GPTP2D_IPC_CB_SOCKET_NODE   "/tmp/gptp2d_ipc"

IPC node for gptp2 communication This node is used to communicate with gptp2 internally.

◆ GPTPIPC_EXT_SCRIPT

#define GPTPIPC_EXT_SCRIPT   "gptpipc_extscript"

◆ GPTPIPC_EVENT_CLOCK_FLAG_NETDEV_DOWN

#define GPTPIPC_EVENT_CLOCK_FLAG_NETDEV_DOWN   (1<<GPTPIPC_EVENT_CLOCK_NETDEV_DOWN)

Macro which is used to define event flag. it is set using bitwise operation.

◆ GPTPIPC_EVENT_CLOCK_FLAG_NETDEV_UP

#define GPTPIPC_EVENT_CLOCK_FLAG_NETDEV_UP   (1<<GPTPIPC_EVENT_CLOCK_NETDEV_UP)

◆ GPTPIPC_EVENT_CLOCK_FLAG_PHASE_UPDATE

#define GPTPIPC_EVENT_CLOCK_FLAG_PHASE_UPDATE   (1<<GPTPIPC_EVENT_CLOCK_PHASE_UPDATE)

◆ GPTPIPC_EVENT_CLOCK_FLAG_FREQ_UPDATE

#define GPTPIPC_EVENT_CLOCK_FLAG_FREQ_UPDATE   (1<<GPTPIPC_EVENT_CLOCK_FREQ_UPDATE)

◆ GPTPIPC_EVENT_CLOCK_FLAG_GM_SYNCED

#define GPTPIPC_EVENT_CLOCK_FLAG_GM_SYNCED   (1<<GPTPIPC_EVENT_CLOCK_GM_SYNCED)

◆ GPTPIPC_EVENT_CLOCK_FLAG_GM_UNSYNCED

#define GPTPIPC_EVENT_CLOCK_FLAG_GM_UNSYNCED   (1<<GPTPIPC_EVENT_CLOCK_GM_UNSYNCED)

◆ GPTPIPC_EVENT_CLOCK_FLAG_GM_CHANGE

#define GPTPIPC_EVENT_CLOCK_FLAG_GM_CHANGE   (1<<GPTPIPC_EVENT_CLOCK_GM_CHANGE)

◆ GPTPIPC_EVENT_PORT_FLAG_AS_CAPABLE_DOWN

#define GPTPIPC_EVENT_PORT_FLAG_AS_CAPABLE_DOWN   (1<<GPTPIPC_EVENT_PORT_AS_CAPABLE_DOWN)

◆ GPTPIPC_EVENT_PORT_FLAG_AS_CAPABLE_UP

#define GPTPIPC_EVENT_PORT_FLAG_AS_CAPABLE_UP   (1<<GPTPIPC_EVENT_PORT_AS_CAPABLE_UP)

◆ GPTPIPC_EVENT_CLOCK_FLAG_ACTIVE_DOMAIN

#define GPTPIPC_EVENT_CLOCK_FLAG_ACTIVE_DOMAIN   (1<<GPTPIPC_EVENT_CLOCK_ACTIVE_DOMAIN)

◆ GPTPIPC_EVENT_CLOCK_FLAG_TIMELEAP_FUTURE

#define GPTPIPC_EVENT_CLOCK_FLAG_TIMELEAP_FUTURE   (1<<GPTPIPC_EVENT_CLOCK_TIMELEAP_FUTURE)

◆ GPTPIPC_EVENT_CLOCK_FLAG_TIMELEAP_PAST

#define GPTPIPC_EVENT_CLOCK_FLAG_TIMELEAP_PAST   (1<<GPTPIPC_EVENT_CLOCK_TIMELEAP_PAST)

◆ GPTPIPC_MAX_NETDEV_NAME

#define GPTPIPC_MAX_NETDEV_NAME   16

gptp data for netlink. this structure is formed with following details:

  1. up -> true or false, used to know that device is up or not.
  2. devname -> character array is used to hold device name (interface name i.e eth0,... ).
  3. ptpdev -> array used to hold ptp device name.
  4. speed -> integer used to notify speed.
  5. duplex -> integer used to notify type of communication.
  6. portid -> ClockIdentity is used to hold port identity number.

◆ GPTPIPC_MAX_PTPDEV_NAME

#define GPTPIPC_MAX_PTPDEV_NAME   32

Typedef Documentation

◆ ClockIdentity

typedef uint8_t ClockIdentity[CLOCK_IDENTITY_LENGTH]

◆ Nibble

typedef uint8_t Nibble

Primitive data types specifications for IEEE 802.1AS. All non-primitive data types are derived from the primitive types, signed integers are represented as two's complement form.

See the following Table
Data Types Definition
EnumerationN N-bit enumerated value
UIntegerN N-bit unsigned integer
Nibble 4-bit field not interpreted as a number
Octet 8-bit field not interpreted as a number
OctetN N-octet fiels not interpreted as a number
Double Double precision (64-bit) floating-point vlaue

◆ Octet

typedef uint8_t Octet

◆ Octet2

typedef uint8_t Octet2[2]

◆ Octet3

typedef uint8_t Octet3[3]

◆ Octet4

typedef uint8_t Octet4[4]

◆ Enumeration2

typedef uint8_t Enumeration2

◆ Enumeration4

typedef uint8_t Enumeration4

◆ Enumeration8

typedef uint8_t Enumeration8

◆ Enumeration16

typedef uint16_t Enumeration16

◆ Enumeration24

typedef uint32_t Enumeration24

◆ UInteger4

typedef uint8_t UInteger4

◆ gptpipc_cb_t

typedef int(* gptpipc_cb_t) (gptpipc_gptpd_data_t *ipcrd, void *cb_data)

Enumeration Type Documentation

◆ TimeSource

enum TimeSource

the type of source of time used by a ClockMaster(802.1AS, 8.6.2.7 timeSource)

Enumerator
ATOMIC_CLOCK 
GPS 
TERRESTRIAL_RADIO 
PTP 
NTP 
HAND_SET 
OTHER 
INTERNAL_OSCILLATOR 

◆ PTPPortState

value of the port state (802.1AS 14.8.3 portState)

Enumerator
DisabledPort 
MasterPort 
PassivePort 
SlavePort 

◆ gptp_ipc_command_t

command for gptp ipc.

Enumerator
GPTPIPC_CMD_NOP 
GPTPIPC_CMD_REQ_NDPORT_INFO 
GPTPIPC_CMD_REQ_GPORT_INFO 
GPTPIPC_CMD_REQ_CLOCK_INFO 
GPTPIPC_CMD_ACTIVE_DOMAINT_SWITCH 
GPTPIPC_CMD_RUN_EXT_SCRIPT 
GPTPIPC_CMD_TSN_SCHEDULE_CONTROL 
GPTPIPC_CMD_REQ_STAT_INFO 
GPTPIPC_CMD_REQ_STAT_INFO_RESET 
GPTPIPC_CMD_REG_ABNORMAL_EVENT 
GPTPIPC_CMD_DISCONNECT 

◆ gptpipc_event_t

Enumeration for GPTP IPC events.

Enumerator
GPTPIPC_EVENT_CLOCK_NETDEV_DOWN 
GPTPIPC_EVENT_CLOCK_NETDEV_UP 
GPTPIPC_EVENT_CLOCK_PHASE_UPDATE 
GPTPIPC_EVENT_CLOCK_FREQ_UPDATE 
GPTPIPC_EVENT_CLOCK_GM_SYNCED 
GPTPIPC_EVENT_CLOCK_GM_UNSYNCED 
GPTPIPC_EVENT_CLOCK_GM_CHANGE 
GPTPIPC_EVENT_PORT_AS_CAPABLE_DOWN 
GPTPIPC_EVENT_PORT_AS_CAPABLE_UP 
GPTPIPC_EVENT_CLOCK_ACTIVE_DOMAIN 
GPTPIPC_EVENT_CLOCK_TIMELEAP_FUTURE 
GPTPIPC_EVENT_CLOCK_TIMELEAP_PAST 

◆ gptpd_data_type_t

data from gptp2d to connected clients

Enumerator
GPTPIPC_GPTPD_NOTICE 
GPTPIPC_GPTPD_NDPORTD 
GPTPIPC_GPTPD_GPORTD 
GPTPIPC_GPTPD_CLOCKD 
GPTPIPC_GPTPD_STATSD 
GPTPIPC_GPTPD_STATTD 

Function Documentation

◆ __attribute__() [1/2]

struct UInteger112 __attribute__ ( (packed, aligned(1))  )

UInteger112 (802.1AS, 10.3.2 systemIdentity)

UInteger224 (802.1AS, 10.3.4 time-synchronization spanning tree priority vectors )

◆ gptpmasterclock_init()

int gptpmasterclock_init ( const char *  shmem_name)

initialize to get gptp clock from gptp2 daemon. if previously initialized, it will simply return 0.

Parameters
shmem_nameshared memory node name. set NULL to use the default
Returns
-1 on error, 0 on Successful initialization.
Note
argument 'shmem_name' will not be used in platforms that recommends against using shared memory (e.g GHS INTEGRITY). Pass NULL is such case.

◆ gptpmasterclock_close()

int gptpmasterclock_close ( void  )

close gptpmasterclcock

Returns
-1: on error, 0:on successfull

◆ gptpmasterclock_gm_domainIndex()

int gptpmasterclock_gm_domainIndex ( void  )

return the domainIndex which is currently used as systeme wide gptp clock.

Returns
domainIndex, -1: error

◆ gptpmasterclock_gm_domainNumber()

int gptpmasterclock_gm_domainNumber ( void  )

return the domainNumber which is currently used as system wide gptp clock.

Returns
domainIndex, -1: error, domain number on success.

◆ gptpmasterclock_getts64()

int64_t gptpmasterclock_getts64 ( void  )

get 64-bit nsec unit ts of system wide gptp clock

Returns
0 on success, -1 on error

◆ gptpmasterclock_wait_until_ts64()

int gptpmasterclock_wait_until_ts64 ( int64_t  tts,
int64_t  vclose,
int64_t  toofar 
)

Wait until tts comes.

Returns
-1: error, 1:already passed, 2:in vclose, 3:farther than toofar seconds, 0:returns from nanosleep(has been waited to very close timing)
Parameters
ttstarget time in nano second unit
vclosenano second unit; treated as very close, and stop waiting even ttv is still in future
toofarnano second unit; treated as too far, and stop waiting

◆ gptpmasterclock_expand_timestamp()

uint64_t gptpmasterclock_expand_timestamp ( uint32_t  timestamp)

expand 32-bit nsec time to 64 bit with aligning to gptp clock.

Parameters
timestamptimestamp which we are going to convert into 32bit to 64 bit.
Returns
expanded time
Note
a range of -2.147 to 2.147 secconds can be correctly aligned

◆ gptpmasterclock_gmchange_ind()

int gptpmasterclock_gmchange_ind ( void  )

get GM change indicator, the number is incremented whenever GM is changed

Returns
GM change indicator value, -1: on error

◆ gptpmasterclock_get_max_domains()

int gptpmasterclock_get_max_domains ( void  )

get maximum number of domains

Returns
returns availabe number of domains.

◆ gptpmasterclock_get_domain_ts64()

int gptpmasterclock_get_domain_ts64 ( int64_t *  ts64,
int  domainIndex 
)

get a synchronized clock value on specific domain

Parameters
ts64pointer to return clock value
domainIndexdomain index number
Returns
0 on success, -1 on error.

◆ gptpmasterclock_dump_offset()

void gptpmasterclock_dump_offset ( void  )

print phase offset for all domains

◆ __attribute__() [2/2]

struct gptpipc_notice_data __attribute__ ( (packed)  )

gptp notice data type

data type to be used in IPC.

gptp clock data.

grand master port data. this structure formed with following details:

to retreive netlink status. this structure has nlstatus type of gptpipc_data_netlinnk_t. for more details read

gptp ipc client request data. this structure formed with following details:

gptp ipc client request, register/deregister abnormal event.

  1. subcmd -> 0: register, 1:deregister
  2. msgtype -> use the same number as PTPMsgType, -1 means all types for deregister subcmd
  3. eventtype -> use the same number as md_abn_event_type
  4. eventrate -> rate of event happening, 0.0 to 1.0
  5. repeat -> repeat times of the event
  6. interval -> interval times whtn it has repeat number
  7. eventpara -> integer parameter for the event
  1. cmd -> it is used for give command to IPC.
  2. domainNumber -> integer used for domain number.
  3. domainIndex -> integer used for domain index.
  4. portNumber -> integer used for port index.
    See also
    gptp_ipc_command_t
    gptpipc_data_netlink_t
  1. domainNumber -> used to hold domain number of clock.
  2. portIndex -> integer used to hold port index of clock.
  3. asCapable -> this port in tis time-awaer system can interoperate to the other end of port via the IEEE 802.1AS protocol.
  4. portOper -> True if the port is up and able to send and receive messages.
  5. gmClockId -> If gmPresent is TRUE, gmClockId is the ClockIdentity of the current grandmaster. If gmPresent is FALSE, the value of gmIdentity is 0x0.
  6. annPathSequenceCount -> number of path sequence to grand master
  7. annPathSequence -> array of path sequence to grand master
  1. domainNumber -> The domain number of a gPTP domain
  2. portIndex -> index number of the clock port
  3. lastGmPhaseChange_nsec -> the most recent change in timeBaseIndicator
  4. clockId -> the clock identiy of this clock port
  5. gmClockId -> the clock identiy of the current grand master clock
  6. lastSyncReceiptTime_nsec ->
  7. lastSyncReceiptLocalTime_nsec ->
  8. adjppb -> adjustment value
  9. gmTimeBaseIndicator -> timeBaseIndicator of the current grand master
  10. lastSyncSeqID -> sequence number of the last Sync/FollowUp received
  11. gmsync -> True if synchronized to grand master
  12. domainActive -> True if this domain is providing the gptp clock
  13. lastGmFreqChangePk -> the last

gptp notice data type

◆ send_ipc_request()

int send_ipc_request ( int  ipcfd,
int  domainNumber,
int  portIndex,
gptp_ipc_command_t  cmd 
)

request IPC data

Parameters
ipcfdsocket descriptor of ipc.
domainNumberdomain number.
portIndexclockport index or network device port index.
cmdcommand for IPC
See also
gptp_ipc_command_t
Returns
0 on success, -1 on Failure.

◆ gptpipc_init()

int gptpipc_init ( gptpipc_thread_data_t ipctd,
int  wait_toutsec 
)

run gptp2d ipc thread

Returns
0:success, -1:error
Parameters
ipctdparameters to run IPC thread, to get callback set 'cb' and 'cbdata'
wait_toutsec0:immediately returns regardless connection status, -1:forever wait to get connetction positive:wait for this seconds, -1 is returned with timetout

◆ gptpipc_close()

int gptpipc_close ( gptpipc_thread_data_t ipctd)

close IPC thread.

Parameters
*ipctdreference to gptpipc_thread_data_t.
Returns
0 on success.
See also
gptpipc_thread_data_t

Variable Documentation

◆ __attribute__

typedef __attribute__