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

Function GetPathNetworkSegmentSubtype

source/src/cip/cipepath.c:466–489  ·  view source on GitHub ↗

@brief Return the Network Segment subtype * * @param cip_path Pointer to the start of the EPath message * @return The Network Segment subtype of the EPath */

Source from the content-addressed store, hash-verified

464 * @return The Network Segment subtype of the EPath
465 */
466NetworkSegmentSubtype GetPathNetworkSegmentSubtype(
467 const unsigned char *const cip_path) {
468 OPENER_ASSERT( kSegmentTypeNetworkSegment == GetPathSegmentType(cip_path) )
469 const unsigned int kSubtypeMask = 0x1F;
470 const unsigned int subtype = (*cip_path) & kSubtypeMask;
471 NetworkSegmentSubtype result = kNetworkSegmentSubtypeReserved;
472 switch(subtype) {
473 case NETWORK_SEGMENT_SCHEDULE:
474 result = kNetworkSegmentSubtypeScheduleSegment; break;
475 case NETWORK_SEGMENT_FIXED_TAG:
476 result = kNetworkSegmentSubtypeFixedTagSegment; break;
477 case NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MILLISECONDS:
478 result = kNetworkSegmentSubtypeProductionInhibitTimeInMilliseconds; break;
479 case NETWORK_SEGMENT_SAFETY:
480 result = kNetworkSegmentSubtypeSafetySegment; break;
481 case NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MICROSECONDS:
482 result = kNetworkSegmentSubtypeProductionInhibitTimeInMicroseconds; break;
483 case NETWORK_SEGMENT_EXTENDED_NETWORK:
484 result = kNetworkSegmentSubtypeExtendedNetworkSegment; break;
485 default: result = kNetworkSegmentSubtypeReserved; break;
486 }
487
488 return result;
489}
490
491/**
492 * @brief Return the Production Inhibit Time in milliseconds from an EPath

Calls 1

GetPathSegmentTypeFunction · 0.85

Tested by 1

TESTFunction · 0.68