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.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2016, Rockwell Automation, Inc.
3  * All rights reserved.
4  *
5  ******************************************************************************/
6 
7 #ifndef SRC_PORTS_SOCKET_TIMER_H_
8 #define SRC_PORTS_SOCKET_TIMER_H_
9 
10 #include "typedefs.h"
11 
15 typedef struct socket_timer {
16  int socket;
18 } SocketTimer;
19 
20 
28  const int socket);
29 
37  const MilliSeconds actual_time);
38 
46 
53 
60 void SocketTimerArrayInitialize(SocketTimer *const array_of_socket_timers,
61  const size_t array_length);
62 
73  SocketTimer *const array_of_socket_timers,
74  const size_t array_length,
75  const int socket);
76 
86  SocketTimer *const array_of_socket_timers,
87  const size_t array_length);
88 
89 #endif /* SRC_PORTS_SOCKET_TIMER_H_ */
void SocketTimerArrayInitialize(SocketTimer *const array_of_socket_timers, const size_t array_length)
Initializes an array of Socket Timer entries.
Definition: socket_timer.c:34
Data structure to store last usage times for sockets.
Definition: socket_timer.h:15
SocketTimer * SocketTimerArrayGetEmptySocketTimer(SocketTimer *const array_of_socket_timers, const size_t array_length)
Get an empty Socket Timer entry.
Definition: socket_timer.c:53
void SocketTimerClear(SocketTimer *const socket_timer)
Clears a Socket Timer entry.
Definition: socket_timer.c:29
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.
Definition: socket_timer.c:41
MilliSeconds SocketTimerGetLastUpdate(SocketTimer *const socket_timer)
Gets time stamp of the last update.
Definition: socket_timer.c:25
unsigned long MilliSeconds
Definition: typedefs.h:68
MilliSeconds last_update
Definition: socket_timer.h:17
struct socket_timer SocketTimer
Data structure to store last usage times for sockets.
void SocketTimerSetLastUpdate(SocketTimer *const socket_timer, const MilliSeconds actual_time)
Sets time stamp entry of the Socket Timer.
Definition: socket_timer.c:17
void SocketTimerSetSocket(SocketTimer *const socket_timer, const int socket)
Sets socket of a Socket Timer.
Definition: socket_timer.c:11