eventMonitor_example.c

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: examples/eventMonitor/eventMonitor_example.c File Reference
eventMonitor_example.c File Reference
#include <stdio.h>
#include <signal.h>
#include "nt.h"

Go to the source code of this file.

Functions

static void StopApplication (int sig)
 
static const char * NT_TranslateSensorType (NtSensorType_t Type)
 
static float NT_GetSensorMultiplier (NtSensorType_t Type)
 
static const char * NT_GetSensorUnit (NtSensorType_t Type)
 
static char * NT_TranslateSensorValue (char *Str, size_t Size, int Value, NtSensorType_t Type, const char *FmtStr, char *Prefix)
 
static const char * NT_TranslatePortEvent (enum NtEventPort_e Event)
 
static int GetSensorData (const struct NtEventSensor_s *pSensor, NtInfo_t *pInfo)
 
static NtError_t DumpSensor (const struct NtEventSensor_s *pSensorEvent)
 
static void DumpConfigChangeEvents (const struct NtConfig_s *pConfigEvent)
 
static const char * ref2text (enum NtTimeSyncReference_e ref)
 
static const char * ptp2text (enum NtPTPPortState_e state)
 
static NtError_t DumpEvent (const NtEvent_t *pEventInfo)
 
int main (void)
 

Macros

#define NT_APPL_SUCCESS   0
 
#define NT_APPL_ERROR_NTAPI   1
 
#define NT_APPL_ERROR_OS   2
 

Variables

static volatile bool stopApplication = false
 

Function Documentation

static void StopApplication ( int  sig)
static
Examples:
eventMonitor_example.c.

Definition at line 124 of file eventMonitor_example.c.

Referenced by main().

static const char* NT_TranslateSensorType ( NtSensorType_t  Type)
static
Examples:
eventMonitor_example.c.

Definition at line 137 of file eventMonitor_example.c.

Referenced by DumpSensor().

static float NT_GetSensorMultiplier ( NtSensorType_t  Type)
static

< Unit: 0.1 degree Celsius

< Unit: 1 mV

< Unit: 1 uA

< Unit: 0.1 uW

< Unit: 1 RPM (Revolutions Per Minute)

< Unit: 1 mW

Examples:
eventMonitor_example.c.

Definition at line 155 of file eventMonitor_example.c.

Referenced by NT_TranslateSensorValue().

static const char* NT_GetSensorUnit ( NtSensorType_t  Type)
static
Examples:
eventMonitor_example.c.

Definition at line 172 of file eventMonitor_example.c.

Referenced by NT_TranslateSensorValue().

static char* NT_TranslateSensorValue ( char *  Str,
size_t  Size,
int  Value,
NtSensorType_t  Type,
const char *  FmtStr,
char *  Prefix 
)
static
Examples:
eventMonitor_example.c.

Definition at line 213 of file eventMonitor_example.c.

Referenced by DumpSensor().

static const char* NT_TranslatePortEvent ( enum NtEventPort_e  Event)
static
Examples:
eventMonitor_example.c.

Definition at line 268 of file eventMonitor_example.c.

Referenced by DumpEvent().

static int GetSensorData ( const struct NtEventSensor_s pSensor,
NtInfo_t pInfo 
)
static
Examples:
eventMonitor_example.c.

Definition at line 285 of file eventMonitor_example.c.

Referenced by DumpSensor().

static NtError_t DumpSensor ( const struct NtEventSensor_s pSensorEvent)
static
Examples:
eventMonitor_example.c.

Definition at line 329 of file eventMonitor_example.c.

Referenced by DumpEvent().

static void DumpConfigChangeEvents ( const struct NtConfig_s pConfigEvent)
static
Examples:
eventMonitor_example.c.

Definition at line 434 of file eventMonitor_example.c.

Referenced by DumpEvent().

static const char* ref2text ( enum NtTimeSyncReference_e  ref)
static
Examples:
eventMonitor_example.c.

Definition at line 492 of file eventMonitor_example.c.

Referenced by DumpEvent().

static const char* ptp2text ( enum NtPTPPortState_e  state)
static
Examples:
eventMonitor_example.c.

Definition at line 520 of file eventMonitor_example.c.

Referenced by DumpEvent().

static NtError_t DumpEvent ( const NtEvent_t pEventInfo)
static
Examples:
eventMonitor_example.c.

Definition at line 559 of file eventMonitor_example.c.

Referenced by main().

int main ( void  )
Examples:
eventMonitor_example.c.

Definition at line 664 of file eventMonitor_example.c.

Macro Definition Documentation

#define NT_APPL_SUCCESS   0
Examples:
eventMonitor_example.c.

Definition at line 113 of file eventMonitor_example.c.

Referenced by main().

#define NT_APPL_ERROR_NTAPI   1
Examples:
eventMonitor_example.c.

Definition at line 114 of file eventMonitor_example.c.

Referenced by main().

#define NT_APPL_ERROR_OS   2
Examples:
eventMonitor_example.c.

Definition at line 115 of file eventMonitor_example.c.

Referenced by main().

Variable Documentation

volatile bool stopApplication = false
static

Definition at line 118 of file eventMonitor_example.c.

Referenced by main(), and StopApplication().