| 314 | } |
| 315 | |
| 316 | void GenerateEncapsulationHeader(const EncapsulationData *const receive_data, |
| 317 | const size_t command_specific_data_length, |
| 318 | const size_t session_handle, |
| 319 | const EncapsulationProtocolErrorCode encapsulation_protocol_status, |
| 320 | ENIPMessage *const outgoing_message) { |
| 321 | outgoing_message->used_message_length += AddIntToMessage( |
| 322 | receive_data->command_code, |
| 323 | &outgoing_message->current_message_position); |
| 324 | outgoing_message->used_message_length += AddIntToMessage( |
| 325 | command_specific_data_length, |
| 326 | &outgoing_message->current_message_position); |
| 327 | outgoing_message->used_message_length += AddDintToMessage(session_handle, |
| 328 | &outgoing_message->current_message_position); //Session handle |
| 329 | outgoing_message->used_message_length += AddDintToMessage( |
| 330 | encapsulation_protocol_status, |
| 331 | &outgoing_message->current_message_position); //Status |
| 332 | memcpy(outgoing_message->current_message_position, |
| 333 | receive_data->sender_context, kSenderContextSize); // sender context |
| 334 | outgoing_message->current_message_position += kSenderContextSize; |
| 335 | outgoing_message->used_message_length += kSenderContextSize; |
| 336 | outgoing_message->used_message_length += AddDintToMessage(0, |
| 337 | &outgoing_message->current_message_position); // options |
| 338 | } |
| 339 | |
| 340 | /** @brief generate reply with "Communications Services" + compatibility Flags. |
| 341 | * @param receive_data pointer to structure with received data |
no test coverage detected