Skip to content

Commit

Permalink
Commented not fully implemented CipEpathEncodeConnectionEpath
Browse files Browse the repository at this point in the history
As this method leads to compile issues for now I commented it.
  • Loading branch information
azoitl authored and MartinMelikMerkumians committed Nov 20, 2024
1 parent 1e99582 commit c700e6b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
100 changes: 50 additions & 50 deletions source/src/cip/cipepath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions source/src/cip/cipepath.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c700e6b

Please sign in to comment.