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

Function GetPathPortSegmentExtendedPortNumber

source/src/cip/cipepath.c:186–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186unsigned int GetPathPortSegmentExtendedPortNumber(
187 const unsigned char *const cip_path) {
188/* OPENER_ASSERT(kPortSegmentExtendedPort == GetPathPortSegmentPortIdentifier(cip_path),
189 "There is no extended port available!\n") */
190 OPENER_ASSERT( kPortSegmentExtendedPort ==
191 GetPathPortSegmentPortIdentifier(cip_path) )
192 const unsigned int kExtendedPortSegmentPosition =
193 GetPathPortSegmentExtendedLinkAddressSizeBit(cip_path) == true ? 2 : 1;
194 return cip_path[kExtendedPortSegmentPosition]
195 + (cip_path[kExtendedPortSegmentPosition + 1] << 8);
196}
197
198void SetPathPortSegmentExtendedPortIdentifier(
199 const unsigned int extended_port_identifier,

Callers 1

TESTFunction · 0.85

Tested by 1

TESTFunction · 0.68