From d3d2da67474a32c6262b5db99c6f53e987dd2750 Mon Sep 17 00:00:00 2001 From: Diogo Diniz Date: Mon, 29 Jun 2026 15:13:23 +0100 Subject: [PATCH] chore: Implemented incphub_await_msg --- app/src/incphub/include/incphub/incphub_client.h | 4 ++-- app/src/incphub/src/incphub_client.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/incphub/include/incphub/incphub_client.h b/app/src/incphub/include/incphub/incphub_client.h index 648c524..b3453c5 100644 --- a/app/src/incphub/include/incphub/incphub_client.h +++ b/app/src/incphub/include/incphub/incphub_client.h @@ -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 buffer_ptr Location to return the buffer /// @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 -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 diff --git a/app/src/incphub/src/incphub_client.c b/app/src/incphub/src/incphub_client.c index 42f13ee..c64826e 100644 --- a/app/src/incphub/src/incphub_client.c +++ b/app/src/incphub/src/incphub_client.c @@ -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); } -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) 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; if (length_ptr == NULL) return INCPHUB_EINVAL; - if (sender_ptr == NULL) + if (source_ptr == NULL) return INCPHUB_EINVAL; - //TODO: Implement (with await_message_dispatch) - return INCPHUB_ERR; + // cli requested for interface consistency only (for now) + (void)cli; + + return await_message_dispatch(buffer_ptr, length_ptr, source_ptr); }