From 5fcb94a2ec6c825074dd098565189e7bce8dfaa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Wed, 28 Aug 2024 07:46:13 +0000 Subject: [PATCH] log: fix missing string error on sid_init in cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit one of the errors were not converted to string form in logs Signed-off-by: Robert Gałat --- samples/sid_end_device/src/cli/app_dut.c | 2 +- samples/sid_end_device/src/cli/sbdt_shell_events.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/samples/sid_end_device/src/cli/app_dut.c b/samples/sid_end_device/src/cli/app_dut.c index 637ec3117e..de2ec43177 100644 --- a/samples/sid_end_device/src/cli/app_dut.c +++ b/samples/sid_end_device/src/cli/app_dut.c @@ -39,7 +39,7 @@ void dut_event_init(sidewalk_ctx_t *sid, void *ctx) return; } sid_error_t e = sid_init(&sid->config, &sid->handle); - LOG_INF("sid_init returned %d", e); + LOG_INF("sid_init returned %d (%s)", e, SID_ERROR_T_STR(e)); if (e != SID_ERROR_NONE) { return; } diff --git a/samples/sid_end_device/src/cli/sbdt_shell_events.c b/samples/sid_end_device/src/cli/sbdt_shell_events.c index a4a33f1ba0..4ed114d4ec 100644 --- a/samples/sid_end_device/src/cli/sbdt_shell_events.c +++ b/samples/sid_end_device/src/cli/sbdt_shell_events.c @@ -59,7 +59,6 @@ void sbdt_event_print_params(sidewalk_ctx_t *sid, void *ctx) struct sid_bulk_data_transfer_params params = {}; sid_error_t ret = sid_bulk_data_transfer_get_transfer_params(sid->handle, file_id, ¶ms); if (ret != SID_ERROR_NONE) { - // CMD_PRINT_RESULT(ret); LOG_ERR("sid_bulk_data_transfer_get_transfer_params returned %d, (%s)", ret, SID_ERROR_T_STR(ret)); return; @@ -111,6 +110,10 @@ void sbdt_event_finalize_request_response(sidewalk_ctx_t *sid, void *ctx) struct sbdt_finalize_resp_ctx *resp_event = (struct sbdt_finalize_resp_ctx *)ctx; sid_error_t result = sid_bulk_data_transfer_finalize(sid->handle, resp_event->file_id, resp_event->finalize_response_action); + if (result != SID_ERROR_NONE) { + LOG_ERR("sid_bulk_data_transfer_finalize returned %d, (%s)", result, + SID_ERROR_T_STR(result)); + } LOG_INF("CMD: FINALIZE RESP: ERR: %d", result); } @@ -119,5 +122,9 @@ void sbdt_event_release_buffer(sidewalk_ctx_t *sid, void *ctx) struct sbdt_buffer_release_ctx *release_event = ctx; sid_error_t result = sid_bulk_data_transfer_release_buffer( sid->handle, release_event->file_id, &release_event->transfer_buffer); + if (result != SID_ERROR_NONE) { + LOG_ERR("sid_bulk_data_transfer_release_buffer returned %d, (%s)", result, + SID_ERROR_T_STR(result)); + } LOG_INF("CMD: RELEASE BUFFER: ERR: %d", result); }