chore: Implemented incphub_await_msg
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user