From c700e6b487a55ad35024addb00c3465bb3096ec3 Mon Sep 17 00:00:00 2001 From: Alois Zoitl Date: Wed, 20 Nov 2024 23:19:46 +0100 Subject: [PATCH] Commented not fully implemented CipEpathEncodeConnectionEpath As this method leads to compile issues for now I commented it. --- source/src/cip/cipepath.c | 100 +++++++++++++++++++------------------- source/src/cip/cipepath.h | 8 +-- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/source/src/cip/cipepath.c b/source/src/cip/cipepath.c index c168cdfb1..31011b99b 100644 --- a/source/src/cip/cipepath.c +++ b/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, diff --git a/source/src/cip/cipepath.h b/source/src/cip/cipepath.h index a794e1533..74b79a1a8 100644 --- a/source/src/cip/cipepath.h +++ b/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,