|
|
@@ -95,11 +95,12 @@ unsigned int g_config_data_length = 0; /**< length of g_config_data_buffer. Init
|
|
|
|
|
|
EipUint32 g_run_idle_state; /**< buffer for holding the run idle information. */
|
|
|
|
|
|
-EipUint16 ProcessProductionInhibitTime(ConnectionObject *io_connection_object
|
|
|
- ) {
|
|
|
+EipUint16 ProcessProductionInhibitTime(ConnectionObject *io_connection_object)
|
|
|
+{
|
|
|
if ( kProductionTriggerCyclic
|
|
|
== GetProductionTrigger(io_connection_object) ) {
|
|
|
if ( 256 == GetProductionInhibitTime(io_connection_object) ) {
|
|
|
+ OPENER_TRACE_INFO("No PIT segment available\n");
|
|
|
/* there was no PIT segment in the connection path; set PIT to one fourth of RPI */
|
|
|
SetProductionInhibitTime(
|
|
|
GetTargetToOriginatorRequestedPackedInterval(io_connection_object)
|
|
|
@@ -119,9 +120,7 @@ EipUint16 ProcessProductionInhibitTime(ConnectionObject *io_connection_object
|
|
|
}
|
|
|
|
|
|
CipConnectionObjectTransportClassTriggerClass GetConnectionObjectTransportClass(
|
|
|
- const ConnectionObject *const connection_object
|
|
|
- )
|
|
|
-{
|
|
|
+ const ConnectionObject *const connection_object) {
|
|
|
const unsigned int kTransportClassMask = 0x0F;
|
|
|
|
|
|
switch(connection_object->transport_type_class_trigger &
|
|
|
@@ -137,8 +136,7 @@ CipConnectionObjectTransportClassTriggerClass GetConnectionObjectTransportClass(
|
|
|
return kCipConnectionObjectTransportClassTriggerClassInvalid;
|
|
|
}
|
|
|
|
|
|
-void SetIoConnectionCallbacks(ConnectionObject *const io_connection_object
|
|
|
- ) {
|
|
|
+void SetIoConnectionCallbacks(ConnectionObject *const io_connection_object) {
|
|
|
io_connection_object->connection_close_function = CloseIoConnection;
|
|
|
io_connection_object->connection_timeout_function = HandleIoConnectionTimeOut;
|
|
|
io_connection_object->connection_send_data_function = SendConnectedData;
|
|
|
@@ -232,6 +230,12 @@ EipUint16 SetupIoConnectionTargetToOriginatorConnectionPoint(
|
|
|
return kConnectionManagerExtendedStatusCodeMismatchedTransportClass;
|
|
|
}
|
|
|
|
|
|
+ if( GetProductionInhibitTime(io_connection_object) !=
|
|
|
+ GetProductionInhibitTime(iterator) ) {
|
|
|
+ return
|
|
|
+ kConnectionManagerExtendedStatusCodeMismatchedTToOProductionInhibitTimeSegment;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
iterator = iterator->next_connection_object;
|
|
|
@@ -640,8 +644,7 @@ EipStatus OpenMulticastConnection(
|
|
|
return kEipStatusOk;
|
|
|
}
|
|
|
|
|
|
-EipUint16 HandleConfigData(ConnectionObject *connection_object
|
|
|
- ) {
|
|
|
+EipUint16 HandleConfigData(ConnectionObject *connection_object) {
|
|
|
|
|
|
CipClass *const assembly_class = GetCipClass(kCipAssemblyClassCode);
|
|
|
EipUint16 connection_manager_status = 0;
|
|
|
@@ -688,8 +691,7 @@ EipUint16 HandleConfigData(ConnectionObject *connection_object
|
|
|
return connection_manager_status;
|
|
|
}
|
|
|
|
|
|
-void CloseIoConnection(ConnectionObject *connection_object
|
|
|
- ) {
|
|
|
+void CloseIoConnection(ConnectionObject *connection_object) {
|
|
|
|
|
|
CheckIoConnectionEvent(connection_object->connection_path.connection_point[
|
|
|
kConnectionPointConsumer],
|
|
|
@@ -738,8 +740,7 @@ void CloseIoConnection(ConnectionObject *connection_object
|
|
|
connection_object);
|
|
|
}
|
|
|
|
|
|
-void HandleIoConnectionTimeOut(ConnectionObject *connection_object
|
|
|
- ) {
|
|
|
+void HandleIoConnectionTimeOut(ConnectionObject *connection_object) {
|
|
|
CheckIoConnectionEvent(connection_object->connection_path.connection_point[0],
|
|
|
connection_object->connection_path.connection_point[1],
|
|
|
kIoConnectionEventTimedOut);
|
|
|
@@ -786,8 +787,7 @@ void HandleIoConnectionTimeOut(ConnectionObject *connection_object
|
|
|
connection_object->connection_close_function(connection_object);
|
|
|
}
|
|
|
|
|
|
-EipStatus SendConnectedData(ConnectionObject *connection_object
|
|
|
- ) {
|
|
|
+EipStatus SendConnectedData(ConnectionObject *connection_object) {
|
|
|
|
|
|
/* TODO think of adding an own send buffer to each connection object in order to preset up the whole message on connection opening and just change the variable data items e.g., sequence number */
|
|
|
|
|
|
@@ -903,8 +903,7 @@ EipStatus HandleReceivedIoConnectionData(
|
|
|
return kEipStatusOk;
|
|
|
}
|
|
|
|
|
|
-EipStatus OpenCommunicationChannels(ConnectionObject *connection_object
|
|
|
- ) {
|
|
|
+EipStatus OpenCommunicationChannels(ConnectionObject *connection_object) {
|
|
|
|
|
|
EipStatus eip_status = kEipStatusOk;
|
|
|
/*get pointer to the CPF data, currently we have just one global instance of the struct. This may change in the future*/
|
|
|
@@ -966,8 +965,7 @@ EipStatus OpenCommunicationChannels(ConnectionObject *connection_object
|
|
|
}
|
|
|
|
|
|
void CloseCommunicationChannelsAndRemoveFromActiveConnectionsList(
|
|
|
- ConnectionObject *connection_object
|
|
|
- ) {
|
|
|
+ ConnectionObject *connection_object) {
|
|
|
IApp_CloseSocket_udp(
|
|
|
connection_object->socket[kUdpCommuncationDirectionConsuming]);
|
|
|
|