* @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 */
| 335 | * @return New message size after encoding |
| 336 | */ |
| 337 | int 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 |
no test coverage detected