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

Function CipEpathGetLogicalValue

source/src/cip/cipepath.c:332–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332const CipDword CipEpathGetLogicalValue(const EipUint8 **message) {
333 LogicalSegmentLogicalFormat logical_format =
334 GetPathLogicalSegmentLogicalFormat(*message);
335 CipDword data = 0;
336 MoveMessageNOctets(1, message); /* Move to logical value */
337 switch (logical_format) {
338 case kLogicalSegmentLogicalFormatEightBit:
339 data = GetSintFromMessage(message);
340 break;
341 case kLogicalSegmentLogicalFormatSixteenBit:
342 MoveMessageNOctets(1, message); /* Pad byte needs to be skipped */
343 data = GetIntFromMessage(message);
344 break;
345 case kLogicalSegmentLogicalFormatThirtyTwoBit:
346 MoveMessageNOctets(1, message); /* Pad byte needs to be skipped */
347 data = GetDintFromMessage(message);
348 break;
349 default:
350 OPENER_ASSERT(false) /* shall not happen! */
351 break;
352 }
353 return data;
354}
355
356size_t CipEpathSetLogicalValue(const CipDword logical_value,
357 const LogicalSegmentLogicalFormat logical_format,

Callers 1

ParseConnectionPathFunction · 0.85

Calls 5

MoveMessageNOctetsFunction · 0.85
GetSintFromMessageFunction · 0.85
GetIntFromMessageFunction · 0.85
GetDintFromMessageFunction · 0.85

Tested by

no test coverage detected