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

Function GetPathLogicalSegmentLogicalFormat

source/src/cip/cipepath.c:287–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287LogicalSegmentLogicalFormat GetPathLogicalSegmentLogicalFormat(
288 const unsigned char *const cip_path) {
289 OPENER_ASSERT( kSegmentTypeLogicalSegment == GetPathSegmentType(cip_path) )
290 const unsigned int kLogicalFormatMask = 0x03;
291 const unsigned int logical_format = (*cip_path) & kLogicalFormatMask;
292 LogicalSegmentLogicalFormat result = kLogicalSegmentLogicalFormatEightBit;
293 switch (logical_format) {
294 case LOGICAL_SEGMENT_FORMAT_EIGHT_BIT:
295 result = kLogicalSegmentLogicalFormatEightBit;
296 break;
297 case LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT:
298 result = kLogicalSegmentLogicalFormatSixteenBit;
299 break;
300 case LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT:
301 result = kLogicalSegmentLogicalFormatThirtyTwoBit;
302 break;
303 default:
304 OPENER_ASSERT(
305 "Logical segment/logical type: Invalid logical type detected!\n")
306 break;
307 }
308 return result;
309}
310
311void SetPathLogicalSegmentLogicalFormat(LogicalSegmentLogicalFormat format,
312 CipOctet *const cip_path) {

Callers 2

CipEpathGetLogicalValueFunction · 0.85
TESTFunction · 0.85

Calls 1

GetPathSegmentTypeFunction · 0.85

Tested by 1

TESTFunction · 0.68