OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
socket_timer.c File Reference
#include "socket_timer.h"
#include "trace.h"
Include dependency graph for socket_timer.c:

Go to the source code of this file.

Functions

SocketTimerSocketTimerArrayGetEmptySocketTimer (SocketTimer *const array_of_socket_timers, const size_t array_length)
 Get an empty Socket Timer entry. More...
 
SocketTimerSocketTimerArrayGetSocketTimer (SocketTimer *const array_of_socket_timers, const size_t array_length, const int socket)
 Get the Socket Timer entry with the spezified socket value. More...
 
void SocketTimerArrayInitialize (SocketTimer *const array_of_socket_timers, const size_t array_length)
 Initializes an array of Socket Timer entries. More...
 
void SocketTimerClear (SocketTimer *const socket_timer)
 Clears a Socket Timer entry. More...
 
MilliSeconds SocketTimerGetLastUpdate (SocketTimer *const socket_timer)
 Gets time stamp of the last update. More...
 
void SocketTimerSetLastUpdate (SocketTimer *const socket_timer, const MilliSeconds actual_time)
 Sets time stamp entry of the Socket Timer. More...
 
void SocketTimerSetSocket (SocketTimer *const socket_timer, const int socket)
 Sets socket of a Socket Timer. More...
 

Function Documentation

SocketTimer* SocketTimerArrayGetEmptySocketTimer ( SocketTimer *const  array_of_socket_timers,
const size_t  array_length 
)

Get an empty Socket Timer entry.

Parameters
array_of_socket_timersThe Socket Timer array
array_lengthThe Socket Timer array length
Returns
An empty Socket Timer entry, or NULL if non is available

Definition at line 53 of file socket_timer.c.

References SocketTimerArrayGetSocketTimer().

Referenced by CheckAndHandleTcpListenerSocket(), and HandleReceivedRegisterSessionCommand().

Here is the call graph for this function:

Here is the caller graph for this function:

SocketTimer* SocketTimerArrayGetSocketTimer ( SocketTimer *const  array_of_socket_timers,
const size_t  array_length,
const int  socket 
)

Get the Socket Timer entry with the spezified socket value.

Parameters
array_of_socket_timersThe Socket Timer array
array_lengthThe Socket Timer array length
socketThe socket value to be searched for
Returns
The Socket Timer of found, otherwise NULL

Definition at line 41 of file socket_timer.c.

Referenced by CheckEncapsulationInactivity(), HandleDataOnTcpSocket(), RemoveSocketTimerFromList(), and SocketTimerArrayGetEmptySocketTimer().

Here is the caller graph for this function:

void SocketTimerArrayInitialize ( SocketTimer *const  array_of_socket_timers,
const size_t  array_length 
)

Initializes an array of Socket Timer entries.

Parameters
array_of_socket_timersThe array of Socket Timer entries to be initialized
array_lengththe length of the array

Definition at line 34 of file socket_timer.c.

References SocketTimerClear().

Referenced by NetworkHandlerInitialize().

Here is the call graph for this function:

Here is the caller graph for this function:

void SocketTimerClear ( SocketTimer *const  socket_timer)

Clears a Socket Timer entry.

Parameters
socket_timerSocket Timer to be cleared

Definition at line 29 of file socket_timer.c.

References socket_timer::last_update, and socket_timer::socket.

Referenced by RemoveSocketTimerFromList(), and SocketTimerArrayInitialize().

Here is the caller graph for this function:

MilliSeconds SocketTimerGetLastUpdate ( SocketTimer *const  socket_timer)

Gets time stamp of the last update.

Parameters
socket_timerSocket Timer to be set
Returns
Last update field value

Definition at line 25 of file socket_timer.c.

References socket_timer::last_update.

Referenced by CheckEncapsulationInactivity().

Here is the caller graph for this function:

void SocketTimerSetLastUpdate ( SocketTimer *const  socket_timer,
const MilliSeconds  actual_time 
)

Sets time stamp entry of the Socket Timer.

Parameters
socket_timerSocket Timer to be set
actual_timeTime stamp

Definition at line 17 of file socket_timer.c.

References socket_timer::last_update, OPENER_TRACE_INFO, and socket_timer::socket.

Referenced by HandleDataOnTcpSocket(), and HandleReceivedRegisterSessionCommand().

Here is the caller graph for this function:

void SocketTimerSetSocket ( SocketTimer *const  socket_timer,
const int  socket 
)

Sets socket of a Socket Timer.

Parameters
socket_timerSocket Timer to be set
socketSocket handle

Definition at line 11 of file socket_timer.c.

References OPENER_TRACE_INFO, and socket_timer::socket.

Referenced by HandleReceivedRegisterSessionCommand().

Here is the caller graph for this function: