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

Function GetPathSymbolicSegmentExtendedFormat

source/src/cip/cipepath.c:570–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570SymbolicSegmentExtendedFormat GetPathSymbolicSegmentExtendedFormat(
571 const unsigned char *const cip_path) {
572 OPENER_ASSERT( kSegmentTypeSymbolicSegment == GetPathSegmentType(cip_path) )
573 OPENER_ASSERT( kSymbolicSegmentFormatExtendedString == GetPathSymbolicSegmentFormat(
574 cip_path) )
575 const unsigned int kSymbolicSegmentExtendedFormatMask = 0xE0;
576 const unsigned int extended_type = *(cip_path + 1) &
577 kSymbolicSegmentExtendedFormatMask;
578 SymbolicSegmentExtendedFormat result = kSymbolicSegmentExtendedFormatReserved;
579 switch(extended_type) {
580 case SYMBOLIC_SEGMENT_EXTENDED_FORMAT_DOUBLE_CHAR: result =
581 kSymbolicSegmentExtendedFormatDoubleByteChars; break;
582 case SYMBOLIC_SEGMENT_EXTENDED_FORMAT_TRIPLE_CHAR: result =
583 kSymbolicSegmentExtendedFormatTripleByteChars; break;
584 case SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC: result =
585 GetPathSymbolicSegmentNumericType(cip_path); break;
586 default: result = kSymbolicSegmentExtendedFormatReserved; break;
587 }
588 return result;
589}
590
591/*** Symbolic Segment ***/
592

Callers 1

TESTFunction · 0.85

Calls 3

GetPathSegmentTypeFunction · 0.85

Tested by 1

TESTFunction · 0.68