@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 */
| 464 | * @return The Network Segment subtype of the EPath |
| 465 | */ |
| 466 | NetworkSegmentSubtype 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 |