MCPcopy Create free account
hub / github.com/EIPStackGroup/OpENer / CipEpathEncodeConnectionEpath

Function CipEpathEncodeConnectionEpath

source/src/cip/cipepath.c:645–695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643}
644
645size_t CipEpathEncodeConnectionEpath(
646 const CipConnectionPathEpath *const connection_epath,
647 CipOctet **encoded_path) {
648
649 size_t encoded_path_length = 0;
650 {
651 SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
652 SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
653 *encoded_path);
654 LogicalSegmentLogicalFormat logical_value =
655 CipEpathGetNeededLogicalFormatForValue(connection_epath->class_id);
656 SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
657 encoded_path_length += 1;
658 MoveMessageNOctets(1, (const CipOctet **)encoded_path);
659 encoded_path_length += CipEpathSetLogicalValue(connection_epath->class_id,
660 logical_value,
661 encoded_path);
662 }
663
664 {
665 SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
666 SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
667 *encoded_path);
668 LogicalSegmentLogicalFormat logical_value =
669 CipEpathGetNeededLogicalFormatForValue(connection_epath->instance_id);
670 SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
671 encoded_path_length += 1;
672 MoveMessageNOctets(1, (const CipOctet **)encoded_path);
673 encoded_path_length += CipEpathSetLogicalValue(
674 connection_epath->instance_id,
675 logical_value,
676 encoded_path);
677 }
678
679 if(0 != connection_epath->attribute_id_or_connection_point) {
680 SetPathSegmentType(kSegmentTypeLogicalSegment, *encoded_path);
681 SetPathLogicalSegmentLogicalType(kLogicalSegmentLogicalTypeClassId,
682 *encoded_path);
683 LogicalSegmentLogicalFormat logical_value =
684 CipEpathGetNeededLogicalFormatForValue(
685 connection_epath->attribute_id_or_connection_point);
686 SetPathLogicalSegmentLogicalFormat(logical_value, *encoded_path);
687 encoded_path_length += 1;
688 MoveMessageNOctets(1, (const CipOctet **)encoded_path);
689 encoded_path_length += CipEpathSetLogicalValue(
690 connection_epath->attribute_id_or_connection_point,
691 logical_value,
692 encoded_path);
693 }
694 return encoded_path_length += 1;
695}
696
697bool CipEpathEqual(const CipOctet *const path1,
698 const CipUint path1_length,

Callers

nothing calls this directly

Tested by

no test coverage detected