Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commented not fully implemented CipEpathEncodeConnectionEpath #519

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading