Просмотр исходного кода

Fixes name scheme, adds some getters and setters

Signed-off-by: CapXilinx <melik-merkumians@acin.tuwien.ac.at>
CapXilinx 8 лет назад
Родитель
Сommit
9bc4ec9923

+ 53 - 5
source/src/cip/cipconnectionobject.c

@@ -32,7 +32,7 @@
 #define CIP_CONNECTION_OBJECT_TRANSPORT_CLASS_TRIGGER_TRANSPORT_CLASS_2 2
 #define CIP_CONNECTION_OBJECT_TRANSPORT_CLASS_TRIGGER_TRANSPORT_CLASS_3 3
 
-ConnectionObjectState GetConnectionObjectState(
+ConnectionObjectState ConnectionObjectGetState(
   const CipConnectionObject *const connection_object) {
   switch(connection_object->state) {
     case CIP_CONNECTION_OBJECT_STATE_NON_EXISTENT: return
@@ -53,7 +53,7 @@ ConnectionObjectState GetConnectionObjectState(
   }
 }
 
-ConnectionObjectInstanceType GetConnectionObjectInstanceType(
+ConnectionObjectInstanceType ConnectionObjectGetInstanceType(
   const CipConnectionObject *const connection_object) {
   switch(connection_object->instance_type) {
     case CIP_CONNECTION_OBJECT_INSTANCE_TYPE_EXPLICIT_MESSAGING: return
@@ -67,7 +67,7 @@ ConnectionObjectInstanceType GetConnectionObjectInstanceType(
 }
 
 ConnectionObjectTransportClassTriggerDirection
-GetConnectionObjectTransportClassTriggerDirection(
+ConnectionObjectGetTransportClassTriggerDirection(
   const CipConnectionObject *const connection_object) {
   const CipByte TransportClassTriggerDirectionMask = 0x80;
   return (connection_object->transport_class_trigger &
@@ -78,7 +78,7 @@ GetConnectionObjectTransportClassTriggerDirection(
 }
 
 ConnectionObjectTransportClassTriggerProductionTrigger
-GetConnectionObjectTransportClassTriggerProductionTrigger(
+ConnectionObjectGetTransportClassTriggerProductionTrigger(
   const CipConnectionObject *const connection_object) {
   const CipByte kTransportClassTriggerProductionTriggerMask = 0x70;
   switch( (connection_object->transport_class_trigger) &
@@ -103,7 +103,7 @@ GetConnectionObjectTransportClassTriggerProductionTrigger(
 }
 
 ConnectionObjectTransportClassTriggerTransportClass
-GetConnectionObjectTransportClassTriggerTransportClass(
+ConnectionObjectGetTransportClassTriggerTransportClass(
   const CipConnectionObject *const connection_object) {
   const CipByte kTransportClassTriggerTransportClassMask = 0x0F;
   switch( (connection_object->transport_class_trigger) &
@@ -119,3 +119,51 @@ GetConnectionObjectTransportClassTriggerTransportClass(
     default: return kConnectionObjectTransportClassTriggerTransportClassInvalid;
   }
 }
+
+CipUint ConnectionObjectGetProducedConnectionSize(
+  const CipConnectionObject *const connection_object) {
+  return connection_object->produced_connection_size;
+}
+
+void ConnectionObjectSetProducedConnectionSize(
+  CipConnectionObject *const connection_object,
+  const CipUint
+  produced_connection_size) {
+  connection_object->produced_connection_size = produced_connection_size;
+}
+
+CipUint ConnectionObjectGetConsumedConnectionSize(
+  const CipConnectionObject *const connection_object) {
+  return connection_object->consumed_connection_size;
+}
+
+void ConnectionObjectSetConsumedConnectionSize(
+  CipConnectionObject *const connection_object,
+  const CipUint
+  consumed_connection_size) {
+  connection_object->consumed_connection_size = consumed_connection_size;
+}
+
+CipUdint ConnectionObjectGetCipProducedConnectionID(
+  const CipConnectionObject *const connection_object) {
+  return connection_object->cip_produced_connection_id;
+}
+
+void ConnectionObjectSetCipProducedConnectionID(
+  CipConnectionObject *const connection_object,
+  const CipUdint
+  cip_produced_connection_id) {
+  connection_object->cip_produced_connection_id = cip_produced_connection_id;
+}
+
+CipUdint ConnectionObjectGetCipConsumedConnectionID(
+  const CipConnectionObject *const connection_object) {
+  return connection_object->cip_consumed_connection_id;
+}
+
+void ConnectionObjectSetCipConsumedConnectionID(
+  CipConnectionObject *const connection_object,
+  const CipUdint
+  cip_consumed_connection_id) {
+  connection_object->cip_consumed_connection_id = cip_consumed_connection_id;
+}

+ 100 - 43
source/src/cip/cipconnectionobject.h

@@ -13,80 +13,137 @@
 #define CIP_CONNECTION_OBJECT_CODE 0x05
 
 typedef enum {
-  kConnectionObjectStateInvalid = -1,
-  kConnectionObjectStateNonExistent = 0,
-  kConnectionObjectStateConfiguring,
-  kConnectionObjectStateWaitingForConnectionID,
-  kConnectionObjectStateEstablished,
-  kConnectionObjectStateTimedOut,
-  kConnectionObjectStateDeferredDelete,
-  kConnectionObjectStateClosing
+  kConnectionObjectStateInvalid = -1, /**< An invalid state, shall never occur! */
+  kConnectionObjectStateNonExistent = 0, /**< Connection is non existent */
+  kConnectionObjectStateConfiguring, /**< Waiting for both to be configured and to apply the configuration */
+  kConnectionObjectStateWaitingForConnectionID, /**< Only used for device net */
+  kConnectionObjectStateEstablished, /**< Connection is established */
+  kConnectionObjectStateTimedOut, /**< Connection timed out - inactivity or watchdog timer expired */
+  kConnectionObjectStateDeferredDelete, /**< Only used for device net */
+  kConnectionObjectStateClosing /**< For CIP bridged connections - have to wait for a successful forward close */
 } ConnectionObjectState;
 
 typedef enum {
-  kConnectionObjectInstanceTypeInvalid = -1,
-  kConnectionObjectInstanceTypeExplicitMessaging = 0,
-  kConnectionObjectInstanceTypeIO,
-  kConnectionObjectInstanceTypeCipBridged
+  kConnectionObjectInstanceTypeInvalid = -1, /**< Invalid instance type - shall never occur! */
+  kConnectionObjectInstanceTypeExplicitMessaging = 0, /**< Connection is an explicit messaging connection */
+  kConnectionObjectInstanceTypeIO, /**< Connection is an I/O connection */
+  kConnectionObjectInstanceTypeCipBridged  /**< Connection is a bridged connection */
 } ConnectionObjectInstanceType;
 
 typedef enum {
-  kConnectionObjectTransportClassTriggerDirectionClient = 0,
-  kConnectionObjectTransportClassTriggerDirectionServer
+  kConnectionObjectTransportClassTriggerDirectionClient = 0,  /**< Endpoint provides client behavior */
+  kConnectionObjectTransportClassTriggerDirectionServer /**< Endpoint provides server behavior - production trigger bits are to be ignored */
 } ConnectionObjectTransportClassTriggerDirection;
 
 typedef enum {
-  kConnectionObjectTransportClassTriggerProductionTriggerInvalid = -1,
-  kConnectionObjectTransportClassTriggerProductionTriggerCyclic = 0,
-  kConnectionObjectTransportClassTriggerProductionTriggerChangeOfState,
-  kConnectionObjectTransportClassTriggerProductionTriggerApplicationObject
+  kConnectionObjectTransportClassTriggerProductionTriggerInvalid = -1,  /**< Invalid Production trigger - shall never occur! */
+  kConnectionObjectTransportClassTriggerProductionTriggerCyclic = 0, /**< Transmission Trigger Timer trigger data production */
+  kConnectionObjectTransportClassTriggerProductionTriggerChangeOfState, /**< Production is trigger when change-of-state is detected by the Application Object */
+  kConnectionObjectTransportClassTriggerProductionTriggerApplicationObject /**< The Application Object decided when production is triggered */
 } ConnectionObjectTransportClassTriggerProductionTrigger;
 
 typedef enum {
-  kConnectionObjectTransportClassTriggerTransportClassInvalid = -1,
-  kConnectionObjectTransportClassTriggerTransportClass0 = 0,
-  kConnectionObjectTransportClassTriggerTransportClass1,
-  kConnectionObjectTransportClassTriggerTransportClass2,
-  kConnectionObjectTransportClassTriggerTransportClass3
+  kConnectionObjectTransportClassTriggerTransportClassInvalid = -1, /**< Invalid Transport Class - shall never occur! */
+  kConnectionObjectTransportClassTriggerTransportClass0 = 0, /**< Class 0 producing or consuming connection, based on Direction */
+  kConnectionObjectTransportClassTriggerTransportClass1, /**< Class 1 producing or consuming connection, based on Direction */
+  kConnectionObjectTransportClassTriggerTransportClass2, /**< Class 2 producing and consuming connection, Client starts producing */
+  kConnectionObjectTransportClassTriggerTransportClass3 /**< Class 3 producing and consuming connection, Client starts producing */
+  /* Higher transport classes not supported */
 } ConnectionObjectTransportClassTriggerTransportClass;
 
+typedef enum {
+  kConnectionObjectWatchdogTimeoutActionInvalid = -1,       /**< Invalid Watchdog Timeout Action - shall never occur! */
+  kConnectionObjectWatchdogTimeoutActionTransitionToTimedOut = 0,       /**< Default for I/O connections, invalid for Explicit Messaging */
+  kConnectionObjectWatchdogTimeoutActionAutoDelete,       /**< Default for explicit connections */
+  kConnectionObjectWatchdogTimeoutActionAutoReset,       /**< Invalid for explicit connections */
+  kConnectionObjectWatchdogTimeoutActionDeferredDelete       /**< Only for Device Net, invalid for I/O connections */
+} ConnectionObjectWatchdogTimeoutAction;
+
 typedef struct cip_connection_object {
-  CipUsint state;       //*< Attribute 1
-  CipUsint instance_type;       //*< Attribute 2
-  CipByte transport_class_trigger;       //*< Attribute 3
+  CipUsint state; /*< Attribute 1 */
+  CipUsint instance_type; /*< Attribute 2 */
+  CipByte transport_class_trigger; /*< Attribute 3 */
   /* Attribute 4-6 only for device net*/
-  CipUint produced_connection_size;       //*< Attribute 7
-  CipUint consumed_connection_size;       //*< Attribute 8
-  CipUint expected_packet_rate;       //*< Attribute 9
-  CipUint cip_produced_connection_id;       //*< Attribute 10
-  CipUint cip_consumed_connection_id;       //*< Attribute 11
-  CipUsint watchdog_timeout_action;       //*< Attribute 12
-  CipUint produced_connection_path_length;       //*< Attribute 13
-  CipEpath produced_connection_path;       //*< Attribute 14
-  CipUint consumed_connection_path_length;       //*< Attribute 15
-  CipEpath consumed_connection_path;       //*< Attribute 16
-  CipUint production_inhibit_time;        //*< Attribute 17
-  CipUsint connection_timeout_multiplier;        //*< Attribute 18
+  CipUint produced_connection_size; /*< Attribute 7 - Limits produced connection size - for explicit messaging 0xFFFF means no predefined limit */
+  CipUint consumed_connection_size; /*< Attribute 8 - Limits produced connection size - for explicit messaging 0xFFFF means no predefined limit */
+  CipUint expected_packet_rate; /*< Attribute 9 - Resolution in Milliseconds */
+  CipUint cip_produced_connection_id; /*< Attribute 10 */
+  CipUint cip_consumed_connection_id; /*< Attribute 11 */
+  CipUsint watchdog_timeout_action; /*< Attribute 12 */
+  CipUint produced_connection_path_length; /*< Attribute 13 */
+  unsigned char *produced_connection_path; /*< Attribute 14 */
+  CipUint consumed_connection_path_length; /*< Attribute 15 */
+  unsigned char *consumed_connection_path; /*< Attribute 16 */
+  CipUint production_inhibit_time; /*< Attribute 17 */
+  CipUsint connection_timeout_multiplier; /*< Attribute 18 */
   /* Attribute 19 not supported as Connection Bind service not supported */
 
+  /* End of CIP attributes */
+  /* Start of OpENer specific variables */
+  CipUint requested_produced_connection_size;
+  CipUint requested_consumed_connection_size;
+
 } CipConnectionObject;
 
-ConnectionObjectState GetConnectionObjectState(
+ConnectionObjectState ConnectionObjectGetState(
   const CipConnectionObject *const connection_object);
 
-ConnectionObjectInstanceType GetConnectionObjectInstanceType(
+ConnectionObjectInstanceType ConnectionObjectGetInstanceType(
   const CipConnectionObject *const connection_object);
 
 ConnectionObjectTransportClassTriggerDirection
-GetConnectionObjectTransportClassTriggerDirection(
+ConnectionObjectGetTransportClassTriggerDirection(
   const CipConnectionObject *const connection_object);
 
 ConnectionObjectTransportClassTriggerProductionTrigger
-GetConnectionObjectTransportClassTriggerProductionTrigger(
+ConnectionObjectGetTransportClassTriggerProductionTrigger(
   const CipConnectionObject *const connection_object);
 
 ConnectionObjectTransportClassTriggerTransportClass
-GetConnectionObjectTransportClassTriggerTransportClass(
+ConnectionObjectGetTransportClassTriggerTransportClass(
+  const CipConnectionObject *const connection_object);
+
+CipUint ConnectionObjectGetProducedConnectionSize(
   const CipConnectionObject *const connection_object);
 
+void ConnectionObjectSetProducedConnectionSize(
+  CipConnectionObject *const connection_object,
+  const CipUint
+  produced_connection_size);
+
+CipUint ConnectionObjectGetConsumedConnectionSize(
+  const CipConnectionObject *const connection_object);
+
+void ConnectionObjectSetConsumedConnectionSize(
+  CipConnectionObject *const connection_object,
+  const CipUint
+  consumed_connection_size);
+
+/**
+ * @brief Sets the expected packet rate according to the rules of the CIP specification
+ *
+ * As this function sets the expected packet rate according to the rules of the CIP specification, it is not always
+ * the exact value entered, but rounded up to the next serviceable increment, relative to the timer resolution
+ */
+void ConnectionObjectSetExpectedPacketRate(
+  CipConnectionObject *const connection_object,
+  CipUint expected_packet_rate);
+
+CipUdint ConnectionObjectGetCipProducedConnectionID(
+  const CipConnectionObject *const connection_object);
+
+void ConnectionObjectSetCipProducedConnectionID(
+  CipConnectionObject *const connection_object,
+  const CipUdint
+  cip_produced_connection_id);
+
+CipUdint ConnectionObjectGetCipConsumedConnectionID(
+  const CipConnectionObject *const connection_object);
+
+void ConnectionObjectSetCipConsumedConnectionID(
+  CipConnectionObject *const connection_object,
+  const CipUdint
+  cip_consumed_connection_id);
+
+
 #endif /* SRC_CIP_CIPCONNECTIONOBJECT_H_ */

+ 23 - 23
source/tests/cip/cipconnectionobjecttest.cpp

@@ -21,63 +21,63 @@ TEST_GROUP(CipConnectionObject) {
 TEST(CipConnectionObject, StateNonExistent) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 0;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateNonExistent, state);
 }
 
 TEST(CipConnectionObject, StateConfiguring) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 1;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateConfiguring, state);
 }
 
 TEST(CipConnectionObject, StateWaitingForConnectionID) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 2;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateWaitingForConnectionID, state);
 }
 
 TEST(CipConnectionObject, StateEstablished) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 3;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateEstablished, state);
 }
 
 TEST(CipConnectionObject, StateTimedOut) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 4;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateTimedOut, state);
 }
 
 TEST(CipConnectionObject, StateDeferredDelete) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 5;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateDeferredDelete, state);
 }
 
 TEST(CipConnectionObject, StateClosing) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 6;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateClosing, state);
 }
 
 TEST(CipConnectionObject, StateInvalid) {
   CipConnectionObject connection_object = { 0 };
   connection_object.state = 7;
-  ConnectionObjectState state = GetConnectionObjectState(&connection_object);
+  ConnectionObjectState state = ConnectionObjectGetState(&connection_object);
   CHECK_EQUAL(kConnectionObjectStateInvalid, state);
 }
 
 TEST(CipConnectionObject, InstanceTypeInvalid) {
   CipConnectionObject connection_object = { 0 };
   connection_object.instance_type = 4;
-  ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(
+  ConnectionObjectInstanceType type = ConnectionObjectGetInstanceType(
     &connection_object);
   CHECK_EQUAL(kConnectionObjectInstanceTypeInvalid, type);
 }
@@ -85,7 +85,7 @@ TEST(CipConnectionObject, InstanceTypeInvalid) {
 TEST(CipConnectionObject, InstanceTypeIExplicitMessaging) {
   CipConnectionObject connection_object = { 0 };
   connection_object.instance_type = 0;
-  ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(
+  ConnectionObjectInstanceType type = ConnectionObjectGetInstanceType(
     &connection_object);
   CHECK_EQUAL(kConnectionObjectInstanceTypeExplicitMessaging, type);
 }
@@ -93,7 +93,7 @@ TEST(CipConnectionObject, InstanceTypeIExplicitMessaging) {
 TEST(CipConnectionObject, InstanceTypeIO) {
   CipConnectionObject connection_object = { 0 };
   connection_object.instance_type = 1;
-  ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(
+  ConnectionObjectInstanceType type = ConnectionObjectGetInstanceType(
     &connection_object);
   CHECK_EQUAL(kConnectionObjectInstanceTypeIO, type);
 }
@@ -101,7 +101,7 @@ TEST(CipConnectionObject, InstanceTypeIO) {
 TEST(CipConnectionObject, InstanceTypeCipBridged) {
   CipConnectionObject connection_object = { 0 };
   connection_object.instance_type = 2;
-  ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(
+  ConnectionObjectInstanceType type = ConnectionObjectGetInstanceType(
     &connection_object);
   CHECK_EQUAL(kConnectionObjectInstanceTypeCipBridged, type);
 }
@@ -110,7 +110,7 @@ TEST(CipConnectionObject, TransportClassTriggerDirectionServer) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 0x80;
   ConnectionObjectTransportClassTriggerDirection direction =
-    GetConnectionObjectTransportClassTriggerDirection(&connection_object);
+    ConnectionObjectGetTransportClassTriggerDirection(&connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerDirectionServer, direction);
 }
 
@@ -118,7 +118,7 @@ TEST(CipConnectionObject, TransportClassTriggerDirectionClient) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 0x00;
   ConnectionObjectTransportClassTriggerDirection direction =
-    GetConnectionObjectTransportClassTriggerDirection(&connection_object);
+    ConnectionObjectGetTransportClassTriggerDirection(&connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerDirectionClient, direction);
 }
 
@@ -126,7 +126,7 @@ TEST(CipConnectionObject, TransportClassTriggerProductionTriggerInvalid) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 3 << 4;
   ConnectionObjectTransportClassTriggerProductionTrigger production_trigger =
-    GetConnectionObjectTransportClassTriggerProductionTrigger(
+    ConnectionObjectGetTransportClassTriggerProductionTrigger(
       &connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerProductionTriggerInvalid,
               production_trigger);
@@ -136,7 +136,7 @@ TEST(CipConnectionObject, TransportClassTriggerProductionTriggerCyclic) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 0x00;
   ConnectionObjectTransportClassTriggerProductionTrigger production_trigger =
-    GetConnectionObjectTransportClassTriggerProductionTrigger(
+    ConnectionObjectGetTransportClassTriggerProductionTrigger(
       &connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerProductionTriggerCyclic,
               production_trigger);
@@ -147,7 +147,7 @@ TEST(CipConnectionObject,
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 1 << 4;
   ConnectionObjectTransportClassTriggerProductionTrigger production_trigger =
-    GetConnectionObjectTransportClassTriggerProductionTrigger(
+    ConnectionObjectGetTransportClassTriggerProductionTrigger(
       &connection_object);
   CHECK_EQUAL(
     kConnectionObjectTransportClassTriggerProductionTriggerChangeOfState,
@@ -159,7 +159,7 @@ TEST(CipConnectionObject,
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 2 << 4;
   ConnectionObjectTransportClassTriggerProductionTrigger production_trigger =
-    GetConnectionObjectTransportClassTriggerProductionTrigger(
+    ConnectionObjectGetTransportClassTriggerProductionTrigger(
       &connection_object);
   CHECK_EQUAL(
     kConnectionObjectTransportClassTriggerProductionTriggerApplicationObject,
@@ -170,7 +170,7 @@ TEST(CipConnectionObject, TransportClassTriggerClassInvalid) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 5;
   ConnectionObjectTransportClassTriggerTransportClass transport_class =
-    GetConnectionObjectTransportClassTriggerTransportClass(&connection_object);
+    ConnectionObjectGetTransportClassTriggerTransportClass(&connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerTransportClassInvalid,
               transport_class);
 }
@@ -179,7 +179,7 @@ TEST(CipConnectionObject, TransportClassTriggerClass0) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 0;
   ConnectionObjectTransportClassTriggerTransportClass transport_class =
-    GetConnectionObjectTransportClassTriggerTransportClass(&connection_object);
+    ConnectionObjectGetTransportClassTriggerTransportClass(&connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerTransportClass0,
               transport_class);
 }
@@ -188,7 +188,7 @@ TEST(CipConnectionObject, TransportClassTriggerClass1) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 1;
   ConnectionObjectTransportClassTriggerTransportClass transport_class =
-    GetConnectionObjectTransportClassTriggerTransportClass(&connection_object);
+    ConnectionObjectGetTransportClassTriggerTransportClass(&connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerTransportClass1,
               transport_class);
 }
@@ -197,7 +197,7 @@ TEST(CipConnectionObject, TransportClassTriggerClass2) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 2;
   ConnectionObjectTransportClassTriggerTransportClass transport_class =
-    GetConnectionObjectTransportClassTriggerTransportClass(&connection_object);
+    ConnectionObjectGetTransportClassTriggerTransportClass(&connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerTransportClass2,
               transport_class);
 }
@@ -206,7 +206,7 @@ TEST(CipConnectionObject, TransportClassTriggerClass3) {
   CipConnectionObject connection_object = { 0 };
   connection_object.transport_class_trigger = 3;
   ConnectionObjectTransportClassTriggerTransportClass transport_class =
-    GetConnectionObjectTransportClassTriggerTransportClass(&connection_object);
+    ConnectionObjectGetTransportClassTriggerTransportClass(&connection_object);
   CHECK_EQUAL(kConnectionObjectTransportClassTriggerTransportClass3,
               transport_class);
 }