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); }