S2OPC OPCUA Toolkit
Data Structures | Macros | Enumerations | Functions
p_sopc_udp_sockets_custom.h File Reference
#include "sopc_enums.h"
#include "sopc_udp_sockets.h"

Go to the source code of this file.

Data Structures

struct  SOPC_Socket_txtime
 The API for SO_TXTIME is the below struct and enum, which will be provided by uapi/linux/net_tstamp.h in the near future. More...
 

Macros

#define SO_TXTIME   61
 
#define SCM_TXTIME   SO_TXTIME
 
#define ONE_SEC   1000 * 1000 * 1000
 
#define CLOCKID   CLOCK_TAI
 

Enumerations

enum  txtime_flags { SOF_TXTIME_DEADLINE_MODE = (1 << 0), SOF_TXTIME_REPORT_ERRORS = (1 << 1), SOF_TXTIME_FLAGS_LAST = SOF_TXTIME_REPORT_ERRORS, SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_FLAGS_LAST - 1) | SOF_TXTIME_FLAGS_LAST }
 

Functions

SOPC_ReturnStatus SOPC_UDP_SO_TXTIME_Socket_Option (const char *interface, Socket *sock, uint32_t soPriority)
 Function to add new socket option and bind interface. More...
 
SOPC_ReturnStatus SOPC_TX_UDP_send (int sockAddress, void *txBuffer, uint32_t txBuffLen, uint64_t txtime, const char *node, const char *service)
 Send data through the UDP socket to given IP address and port. More...
 
SOPC_ReturnStatus SOPC_TX_UDP_Socket_Error_Queue (int sockFd)
 Function for socket error queue. More...
 

Macro Definition Documentation

◆ SO_TXTIME

#define SO_TXTIME   61

◆ SCM_TXTIME

#define SCM_TXTIME   SO_TXTIME

◆ ONE_SEC

#define ONE_SEC   1000 * 1000 * 1000

◆ CLOCKID

#define CLOCKID   CLOCK_TAI

Enumeration Type Documentation

◆ txtime_flags

Enumerator
SOF_TXTIME_DEADLINE_MODE 
SOF_TXTIME_REPORT_ERRORS 
SOF_TXTIME_FLAGS_LAST 
SOF_TXTIME_FLAGS_MASK 

Function Documentation

◆ SOPC_UDP_SO_TXTIME_Socket_Option()

SOPC_ReturnStatus SOPC_UDP_SO_TXTIME_Socket_Option ( const char *  interface,
Socket sock,
uint32_t  soPriority 
)

Function to add new socket option and bind interface.

Parameters
interfaceInterface selection - HW timestamp enabled NIC
sockValue pointed is set with the newly created socket
soPrioritySet priority of packets sent by this socket
Returns
SOPC_STATUS_OK if operation succeeded, SOPC_STATUS_INVALID_PARAMETERS or SOPC_STATUS_NOK otherwise.

◆ SOPC_TX_UDP_send()

SOPC_ReturnStatus SOPC_TX_UDP_send ( int  sockAddress,
void *  txBuffer,
uint32_t  txBuffLen,
uint64_t  txtime,
const char *  node,
const char *  service 
)

Send data through the UDP socket to given IP address and port.

Parameters
sockAddressValue pointed is set with the newly created socket
txBufferThe buffer containing data to be sent.
txBuffLenThe network message buffer length
txtimeThe frame transmission timestamp
nodeAn IPv4 or IPv6 address.
serviceThe param service The port to use
Returns
SOPC_STATUS_OK if operation succeeded, SOPC_STATUS_INVALID_PARAMETERS or SOPC_STATUS_NOK otherwise.

◆ SOPC_TX_UDP_Socket_Error_Queue()

SOPC_ReturnStatus SOPC_TX_UDP_Socket_Error_Queue ( int  sockFd)

Function for socket error queue.

Parameters
sockFdSocket file descriptor value
Returns
SOPC_STATUS_OK if operation succeeded, SOPC_STATUS_INVALID_PARAMETERS or SOPC_STATUS_NOK otherwise.