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

Function EncodeSequencedAddressItem

source/src/enet_encap/cpf.c:337–354  ·  view source on GitHub ↗

* @brief Encodes a sequenced address item into the message * * @param common_packet_format_data_item Common Packet Format item which is used in the encoding * @param outgoing_message The outgoing message object * * @return New message size after encoding */

Source from the content-addressed store, hash-verified

335 * @return New message size after encoding
336 */
337int EncodeSequencedAddressItem(
338 const CipCommonPacketFormatData *const common_packet_format_data_item,
339 ENIPMessage *const outgoing_message) {
340 /* sequenced address item -> address length set to 8 and copy ConnectionIdentifier and SequenceNumber */
341 outgoing_message->used_message_length += AddIntToMessage(
342 kCipItemIdSequencedAddressItem,
343 &outgoing_message->current_message_position);
344 outgoing_message->used_message_length += AddIntToMessage(
345 sequenced_address_item_length,
346 &outgoing_message->current_message_position);
347 outgoing_message->used_message_length += AddDintToMessage(
348 common_packet_format_data_item->address_item.data.connection_identifier,
349 &outgoing_message->current_message_position);
350 outgoing_message->used_message_length += AddDintToMessage(
351 common_packet_format_data_item->address_item.data.sequence_number,
352 &outgoing_message->current_message_position);
353 return outgoing_message->used_message_length;
354}
355
356/**
357 * @brief Adds the item count to the message frame

Callers 1

AssembleLinearMessageFunction · 0.85

Calls 2

AddIntToMessageFunction · 0.85
AddDintToMessageFunction · 0.85

Tested by

no test coverage detected