OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cipconnectionmanager.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, Rockwell Automation, Inc.
3  * All rights reserved.
4  *
5  ******************************************************************************/
6 #ifndef OPENER_CIPCONNECTIONMANAGER_H_
7 #define OPENER_CIPCONNECTIONMANAGER_H_
8 
9 #include "opener_user_conf.h"
10 #include "opener_api.h"
11 #include "typedefs.h"
12 #include "ciptypes.h"
13 #include "cipconnectionobject.h"
14 
23 typedef enum {
35 typedef enum {
38  = 0x0100,
40  = 0x0103,
43  0x0107,
45  0x0110,
55  0x011B,
60  0x011F,
62  0x0120,
64  0x0121,
66  0x0122,
70  = 0x0125,
75  0x0129,
86  =
87  0x0133,
89  0x0135,
91  0x0136,
95  = 0x0139,
99  = 0x0205,
101  0x0206,
103  0x0207,
106  0x0302,
108  0x0303,
110  = 0x0304,
113  0x0306,
118  = 0x0316,
124  0x031B,
128  = 0x031E,
130  = 0x031F,
134  0x0811,
136  = 0x0812,
138  0x0813,
140  kConnectionManagerExtendedStatusWrongCloser = 0xFFFF /* No a real extended error code, but needed for forward close */
142 
150 #define SEQ_LEQ32(a, b) ( (int)( (a) - (b) ) <= 0 )
151 #define SEQ_GEQ32(a, b) ( (int)( (a) - (b) ) >= 0 )
152 #define SEQ_GT32(a, b) ( (int)( (a) - (b) ) > 0 )
153 
159 #define SEQ_LEQ16(a, b) ( (short)( (a) - (b) ) <= 0 )
160 #define SEQ_GEQ16(a, b) ( (short)( (a) - (b) ) >= 0 )
161 
163 static const int g_kCipConnectionManagerClassCode = 0x06;
164 
165 /* public functions */
166 
172 EipStatus ConnectionManagerInit(EipUint16 unique_connection_id);
173 
180 CipConnectionObject *GetConnectedObject(const EipUint32 connection_id);
181 
190  const EipUint32 output_assembly_id);
191 
199 void CloseConnection(CipConnectionObject *RESTRICT connection_object);
200 
201 /* TODO: Missing documentation */
202 EipBool8 IsConnectedOutputAssembly(const EipUint32 instance_number);
203 
213 void AddNewActiveConnection(const CipConnectionObject *const connection_object);
214 
219 void RemoveFromActiveConnections(CipConnectionObject *const connection_object);
220 
221 
223 
224 typedef void (*CloseSessionFunction)(const CipConnectionObject *const
225  connection_object);
226 
228  const CipConnectionObject *const connection_object,
229  CloseSessionFunction CloseSessions);
230 
231 #endif /* OPENER_CIPCONNECTIONMANAGER_H_ */
void AddNewActiveConnection(const CipConnectionObject *const connection_object)
Insert the given connection object to the list of currently active and managed connections.
ConnectionManagerExtendedStatusCode
Connection Manager Error codes.
CipConnectionObject * GetConnectedOutputAssembly(const EipUint32 output_assembly_id)
CipConnectionObject * GetConnectedObject(const EipUint32 connection_id)
Get a connected object dependent on requested ConnectionID.
EipStatus
EIP stack status enum.
Definition: typedefs.h:93
uint32_t EipUint32
Definition: typedefs.h:34
void CloseConnection(CipConnectionObject *RESTRICT connection_object)
Close the given connection.
EipStatus ConnectionManagerInit(EipUint16 unique_connection_id)
Initialize the data of the connection manager object.
void RemoveFromActiveConnections(CipConnectionObject *const connection_object)
Removes connection from the list of active connections.
CipUint GetConnectionId(void)
Generate a new connection Id utilizing the Incarnation Id as described in the EIP specs...
uint8_t EipBool8
Definition: typedefs.h:37
void(* CloseSessionFunction)(const CipConnectionObject *const connection_object)
uint16_t CipUint
Definition: typedefs.h:47
void CheckForTimedOutConnectionsAndCloseTCPConnections(const CipConnectionObject *const connection_object, CloseSessionFunction CloseSessions)
uint16_t EipUint16
Definition: typedefs.h:33
ConnectionManagerGeneralStatus
Connection Type constants of the Forward Open service request Indicates either a. ...
EipBool8 IsConnectedOutputAssembly(const EipUint32 instance_number)