From 699690d12c502893d51662b196bf2613bc84b17d Mon Sep 17 00:00:00 2001 From: Bogdan-Mihai Davidoaia Date: Mon, 15 Apr 2024 19:04:23 +0300 Subject: [PATCH] Add logging of comms error in GG_CoapEventEmitter_OnError --- xp/utils/CMakeLists.txt | 2 +- xp/utils/gg_coap_event_emitter.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xp/utils/CMakeLists.txt b/xp/utils/CMakeLists.txt index a10ef043..44520931 100644 --- a/xp/utils/CMakeLists.txt +++ b/xp/utils/CMakeLists.txt @@ -28,7 +28,7 @@ set(HEADERS gg_async_pipe.h add_library(gg-utils ${SOURCES} ${HEADERS}) gg_add_to_all_libs(gg-utils) -target_link_libraries(gg-utils PRIVATE gg-common) +target_link_libraries(gg-utils PRIVATE gg-annotations gg-common) set_target_properties(gg-utils PROPERTIES PUBLIC_HEADER "${HEADERS}") install(TARGETS gg-utils EXPORT golden-gate diff --git a/xp/utils/gg_coap_event_emitter.c b/xp/utils/gg_coap_event_emitter.c index 1d1a643d..0bcdf9f4 100644 --- a/xp/utils/gg_coap_event_emitter.c +++ b/xp/utils/gg_coap_event_emitter.c @@ -17,6 +17,7 @@ /*---------------------------------------------------------------------- | includes +---------------------------------------------------------------------*/ +#include "xp/annotations/gg_annotations.h" #include "xp/common/gg_logging.h" #include "xp/common/gg_threads.h" #include "xp/coap/gg_coap.h" @@ -239,6 +240,8 @@ GG_CoapEventEmitter_OnError(GG_CoapResponseListener* _self, GG_Result error, con // after a timeout, we can retry immediately GG_CoapEventEmitter_Update(self); } else { + GG_LOG_COMMS_ERROR_CODE(GG_LIB_UTILS_COAP_EVENT_EMITTER_REQ_ERROR, error); + // after another error, wait before retrying GG_Timer_Schedule(self->timer, GG_CAST(self, GG_TimerListener), self->retry_delay); }