Sfoglia il codice sorgente

Commented not fully implemented CipEpathEncodeConnectionEpath

As this method leads to compile issues for now I commented it.
Alois Zoitl 1 anno fa
parent
commit
c700e6b487
2 ha cambiato i file con 54 aggiunte e 54 eliminazioni
  1. 50 50
      source/src/cip/cipepath.c
  2. 4 4
      source/src/cip/cipepath.h

+ 50 - 50
source/src/cip/cipepath.c

@@ -628,56 +628,56 @@ LogicalSegmentLogicalFormat CipEpathGetNeededLogicalFormatForValue(
   return logical_format;
 }
 
-//TODO: Does not match the actual interface anymore, check how to fix
-size_t CipEpathEncodeConnectionEpath(
-  const CipConnectionPathEpath *const connection_epath,
-  CipOctet **encoded_path) {
-
-  size_t encoded_path_length = 0;
-  {
-    SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
-    SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
-                                     *encoded_path);
-    LogicalSegmentLogicalFormat logical_value =
-      CipEpathGetNeededLogicalFormatForValue(connection_epath->class_id);
-    SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
-    encoded_path_length += 1;
-    MoveMessageNOctets(1, (const CipOctet **) encoded_path);
-    CipEpathSetLogicalValue(connection_epath->class_id,
-                            logical_value,
-                            encoded_path);
-  }
-
-  {
-    SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
-    SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
-                                     *encoded_path);
-    LogicalSegmentLogicalFormat logical_value =
-      CipEpathGetNeededLogicalFormatForValue(connection_epath->instance_id);
-    SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
-    encoded_path_length += 1;
-    MoveMessageNOctets(1, (const CipOctet **) encoded_path);
-    CipEpathSetLogicalValue(connection_epath->instance_id,
-                            logical_value,
-                            encoded_path);
-  }
-
-  if(0 != connection_epath->attribute_id_or_connection_point) {
-    SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
-    SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
-                                     *encoded_path);
-    LogicalSegmentLogicalFormat logical_value =
-      CipEpathGetNeededLogicalFormatForValue(
-        connection_epath->attribute_id_or_connection_point);
-    SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
-    encoded_path_length += 1;
-    MoveMessageNOctets(1, (const CipOctet **) encoded_path);
-    CipEpathSetLogicalValue(connection_epath->attribute_id_or_connection_point,
-                            logical_value,
-                            encoded_path);
-  }
-  return encoded_path_length += 1;
-}
+////TODO: Does not match the actual interface anymore, check how to fix
+//size_t CipEpathEncodeConnectionEpath(
+//  const CipConnectionPathEpath *const connection_epath,
+//  CipOctet **encoded_path) {
+//
+//  size_t encoded_path_length = 0;
+//  {
+//    SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
+//    SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
+//                                     *encoded_path);
+//    LogicalSegmentLogicalFormat logical_value =
+//      CipEpathGetNeededLogicalFormatForValue(connection_epath->class_id);
+//    SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
+//    encoded_path_length += 1;
+//    MoveMessageNOctets(1, (ENIPMessage * const) *encoded_path);
+//    CipEpathSetLogicalValue(connection_epath->class_id,
+//                            logical_value,
+//                            *encoded_path);
+//  }
+//
+//  {
+//    SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
+//    SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
+//                                     *encoded_path);
+//    LogicalSegmentLogicalFormat logical_value =
+//      CipEpathGetNeededLogicalFormatForValue(connection_epath->instance_id);
+//    SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
+//    encoded_path_length += 1;
+//    MoveMessageNOctets(1, (const CipOctet **) encoded_path);
+//    CipEpathSetLogicalValue(connection_epath->instance_id,
+//                            logical_value,
+//                            encoded_path);
+//  }
+//
+//  if(0 != connection_epath->attribute_id_or_connection_point) {
+//    SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
+//    SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
+//                                     *encoded_path);
+//    LogicalSegmentLogicalFormat logical_value =
+//      CipEpathGetNeededLogicalFormatForValue(
+//        connection_epath->attribute_id_or_connection_point);
+//    SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
+//    encoded_path_length += 1;
+//    MoveMessageNOctets(1, (const CipOctet **) encoded_path);
+//    CipEpathSetLogicalValue(connection_epath->attribute_id_or_connection_point,
+//                            logical_value,
+//                            encoded_path);
+//  }
+//  return encoded_path_length += 1;
+//}
 
 bool CipEpathEqual(const CipOctet *const path1,
                    const CipUint path1_length,

+ 4 - 4
source/src/cip/cipepath.h

@@ -379,10 +379,10 @@ SymbolicSegmentExtendedFormat GetPathSymbolicSegmentExtendedFormat(
   const unsigned char *const cip_path);
 
 /* Special purpose encoding and decoding functions */
-
-size_t CipEpathEncodeConnectionEpath(
-  const CipConnectionPathEpath *const connection_epath,
-  CipOctet **encoded_path);
+//TODO currently not fully implemented
+//size_t CipEpathEncodeConnectionEpath(
+//  const CipConnectionPathEpath *const connection_epath,
+//  CipOctet **encoded_path);
 
 bool CipEpathEqual(const CipOctet *const path1,
                    const CipUint path1_length,