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

Function EncodeConnectedAddressItem

source/src/enet_encap/cpf.c:314–327  ·  view source on GitHub ↗

* Encodes a Connected Address Item into the message frame * @param common_packet_format_data_item The Common Packet Format data structure from which the message is constructed * @param outgoing_message The outgoing message object * * @return The new size of the message frame after encoding */

Source from the content-addressed store, hash-verified

312 * @return The new size of the message frame after encoding
313 */
314int EncodeConnectedAddressItem(
315 const CipCommonPacketFormatData *const common_packet_format_data_item,
316 ENIPMessage *const outgoing_message) {
317 /* connected data item -> address length set to 4 and copy ConnectionIdentifier */
318 outgoing_message->used_message_length += AddIntToMessage(
319 kCipItemIdConnectionAddress,
320 &outgoing_message->current_message_position);
321 outgoing_message->used_message_length += AddIntToMessage(4,
322 &outgoing_message->current_message_position);
323 outgoing_message->used_message_length += AddDintToMessage(
324 common_packet_format_data_item->address_item.data.connection_identifier,
325 &outgoing_message->current_message_position);
326 return outgoing_message->used_message_length;
327}
328
329/**
330 * @brief Encodes a sequenced address item into the message

Callers 1

AssembleLinearMessageFunction · 0.85

Calls 2

AddIntToMessageFunction · 0.85
AddDintToMessageFunction · 0.85

Tested by

no test coverage detected