chore: Implemented incphub_await_msg

This commit is contained in:
2026-06-29 15:13:23 +01:00
parent 439df57e23
commit d3d2da6747
2 changed files with 8 additions and 6 deletions

View File

@@ -40,8 +40,8 @@ int incphub_send_local(incphub_cli_t *cli, uint8_t *buffer, size_t length, ntl_p
/// @param cli Current client handle /// @param cli Current client handle
/// @param buffer_ptr Location to return the buffer /// @param buffer_ptr Location to return the buffer
/// @param length_ptr Location to return the length /// @param length_ptr Location to return the length
/// @param sender_ptr Location to return the message length /// @param source_ptr Location to return the message sender
/// @return INCPHUB_OK on success, an error otherwise /// @return INCPHUB_OK on success, an error otherwise
int incphub_await_msg(incphub_cli_t *cli, uint8_t **buffer_ptr, size_t *length_ptr, incphub_addr_t *sender_ptr); int incphub_await_msg(incphub_cli_t *cli, uint8_t **buffer_ptr, size_t *length_ptr, incphub_addr_t *source_ptr);
#endif #endif

View File

@@ -66,7 +66,7 @@ int incphub_send_local(incphub_cli_t *cli, uint8_t *buffer, size_t length, ntl_p
return enqueue_message_ingest((uint8_t *)nil_packet, extended_len); return enqueue_message_ingest((uint8_t *)nil_packet, extended_len);
} }
int incphub_await_msg(incphub_cli_t *cli, uint8_t **buffer_ptr, size_t *length_ptr, incphub_addr_t *sender_ptr) int incphub_await_msg(incphub_cli_t *cli, uint8_t **buffer_ptr, size_t *length_ptr, incphub_addr_t *source_ptr)
{ {
if (cli == NULL) if (cli == NULL)
return INCPHUB_EINVAL; return INCPHUB_EINVAL;
@@ -74,9 +74,11 @@ int incphub_await_msg(incphub_cli_t *cli, uint8_t **buffer_ptr, size_t *length_p
return INCPHUB_EINVAL; return INCPHUB_EINVAL;
if (length_ptr == NULL) if (length_ptr == NULL)
return INCPHUB_EINVAL; return INCPHUB_EINVAL;
if (sender_ptr == NULL) if (source_ptr == NULL)
return INCPHUB_EINVAL; return INCPHUB_EINVAL;
//TODO: Implement (with await_message_dispatch) // cli requested for interface consistency only (for now)
return INCPHUB_ERR; (void)cli;
return await_message_dispatch(buffer_ptr, length_ptr, source_ptr);
} }