Skip to content

Commit

Permalink
Add logging of comms error in GG_CoapEventEmitter_OnError
Browse files Browse the repository at this point in the history
  • Loading branch information
bdavidoaia committed Apr 16, 2024
1 parent 417aad0 commit 699690d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xp/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions xp/utils/gg_coap_event_emitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 699690d

Please sign in to comment.