OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cipioconnection.h File Reference
Include dependency graph for cipioconnection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void CloseCommunicationChannelsAndRemoveFromActiveConnectionsList (CipConnectionObject *connection_object)
 close the communication channels of the given connection and remove it from the active connections list. More...
 
EipStatus EstablishIoConnection (CipConnectionObject *RESTRICT const connection_object, EipUint16 *const extended_error)
 Setup all data in order to establish an IO connection. More...
 
EipStatus OpenCommunicationChannels (CipConnectionObject *connection_object)
 Take the data given in the connection object structure and open the necessary communication channels. More...
 

Variables

EipUint8g_config_data_buffer
 
unsigned int g_config_data_length
 

Detailed Description

CIP I/O Connection implementation

I/O Connection Object State Transition Diagram

Definition in file cipioconnection.h.

Function Documentation

void CloseCommunicationChannelsAndRemoveFromActiveConnectionsList ( CipConnectionObject connection_object)

close the communication channels of the given connection and remove it from the active connections list.

Parameters
connection_objectpointer to the connection object data

Definition at line 976 of file cipioconnection.c.

References CloseUdpSocket(), ConnectionObjectInitializeEmpty(), kUdpCommuncationDirectionConsuming, kUdpCommuncationDirectionProducing, RemoveFromActiveConnections(), and cip_connection_object::socket.

Referenced by CloseIoConnection().

Here is the call graph for this function:

Here is the caller graph for this function:

EipStatus EstablishIoConnection ( CipConnectionObject *RESTRICT const  connection_object,
EipUint16 *const  extended_error 
)

Setup all data in order to establish an IO connection.

This function can be called after all data has been parsed from the forward open request

Parameters
connection_objectpointer to the connection object structure holding the parsed data from the forward open request
extended_errorthe extended error code in case an error happened
Returns
general status on the establishment
  • EIP_OK ... on success
  • On an error the general status code to be put into the response

Setup all data in order to establish an IO connection.

This function needs the guarantee that no Null request will be passed to it. It will generate a new IO connection based on the data parsed in the Forward Open service

Parameters
connection_objectpointer to the connection object structure holding the parsed data from the forward open request
extended_errorthe extended error code in case an error happened
Returns
general status on the establishment
  • kEipStatusOk ... on success
  • On an error the general status code to be put into the response

Already handled by forward open

Definition at line 275 of file cipioconnection.c.

References AddNewActiveConnection(), CheckIoConnectionEvent(), ConnectionObjectGeneralConfiguration(), ConnectionObjectGetOToTConnectionType(), ConnectionObjectGetTToOConnectionType(), cip_connection_object::consumed_connection_path_length, cip_connection_object::consumed_path, cip_connection_object::consuming_instance, g_config_data_buffer, GetIoConnectionForConnectionData(), HandleConfigData(), connection_path_epath::instance_id, kCipErrorConnectionFailure, kConnectionManagerExtendedStatusCodeSuccess, kConnectionObjectConnectionTypeNull, kEipStatusOk, kIoConnectionEventOpened, OpenCommunicationChannels(), OPENER_ASSERT, ProcessProductionInhibitTime(), cip_connection_object::produced_connection_path_length, cip_connection_object::produced_path, cip_connection_object::producing_instance, SetIoConnectionCallbacks(), SetupIoConnectionOriginatorToTargetConnectionPoint(), and SetupIoConnectionTargetToOriginatorConnectionPoint().

Referenced by ConnectionManagerInit().

Here is the call graph for this function:

Here is the caller graph for this function:

EipStatus OpenCommunicationChannels ( CipConnectionObject connection_object)

Take the data given in the connection object structure and open the necessary communication channels.

This function will use the g_stCPFDataItem!

Parameters
connection_objectpointer to the connection object data
Returns
general status on the open process
  • EIP_OK ... on success
  • On an error the general status code to be put into the response

Definition at line 919 of file cipioconnection.c.

References ConnectionObjectGetOToTConnectionType(), ConnectionObjectGetTToOConnectionType(), g_common_packet_format_data_item, kCipErrorConnectionFailure, kConnectionObjectConnectionTypeMulticast, kConnectionObjectConnectionTypePointToPoint, kEipStatusError, kEipStatusOk, kUdpCommuncationDirectionConsuming, OpenConsumingPointToPointConnection(), OPENER_TRACE_ERR, OpenMulticastConnection(), OpenProducingMulticastConnection(), and OpenProducingPointToPointConnection().

Referenced by EstablishIoConnection().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

EipUint8* g_config_data_buffer

buffers for the config data coming with a forward open request.

Definition at line 70 of file cipioconnection.c.

Referenced by EstablishIoConnection(), HandleConfigData(), and ParseConnectionPath().

unsigned int g_config_data_length

length of g_config_data_buffer. Initialized with 0

Definition at line 71 of file cipioconnection.c.

Referenced by HandleConfigData(), and ParseConnectionPath().