pps_example.c

Reference Documentation

Platform
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.15
Napatech Software Suite: examples/pps/pps_example.c File Reference
pps_example.c File Reference
#include <nt.h>
#include <signal.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdatomic.h>
#include <stdlib.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  TimeSync_s
 
struct  nttimeval
 

Macros

#define MAX_TS_CARDS   4
 
#define NT_CONST64(a)   a##ULL
 
#define UNIX_EPOCH_OFFSET_MAGIC   116444736000000000ULL
 

Typedefs

typedef struct TimeSync_s TimeSync_t
 

Functions

int PpsGetOsTime (uint64_t *osTime)
 
int PrintTimestamp (uint64_t timeValue)
 
int PpsPrintStatusAndTime (int i, uint64_t timeSyncPpsSampled, int64_t timeSyncTimeSkew)
 
static void StopApplication (int sig)
 
int main (void)
 

Variables

TimeSync_t TS_os [MAX_TS_CARDS]
 
static atomic_int appRunning = 1
 

Macro Definition Documentation

#define MAX_TS_CARDS   4
Examples:
pps/pps_example.c.

Definition at line 98 of file pps_example.c.

Referenced by main().

#define NT_CONST64 (   a)    a##ULL

Definition at line 129 of file pps_example.c.

#define UNIX_EPOCH_OFFSET_MAGIC   116444736000000000ULL

Definition at line 130 of file pps_example.c.

Typedef Documentation

typedef struct TimeSync_s TimeSync_t
Examples:
pps/pps_example.c.

Function Documentation

int PpsGetOsTime ( uint64_t *  osTime)
Examples:
pps/pps_example.c.

Definition at line 170 of file pps_example.c.

Referenced by main().

int PrintTimestamp ( uint64_t  timeValue)
Examples:
pps/pps_example.c.

Definition at line 184 of file pps_example.c.

Referenced by PpsPrintStatusAndTime().

int PpsPrintStatusAndTime ( int  i,
uint64_t  timeSyncPpsSampled,
int64_t  timeSyncTimeSkew 
)
Examples:
pps/pps_example.c.

Definition at line 204 of file pps_example.c.

Referenced by main().

static void StopApplication ( int  sig)
static

Definition at line 158 of file pps_example.c.

Referenced by main().

int main ( void  )

Definition at line 227 of file pps_example.c.

Variable Documentation

Examples:
pps/pps_example.c.

Definition at line 105 of file pps_example.c.

atomic_int appRunning = 1
static

Definition at line 111 of file pps_example.c.

Referenced by main(), and StopApplication().