X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fmessaging%2Fdefault_cb.cpp;h=681f5f6eaaabed5f1ca657908d9998b7e03b6a98;hb=HEAD;hp=10832935fd31a419f8ba1dbbc82eeade3e9be79b;hpb=4e4fb5021cc9aa67390f6641a060b85c077a1880;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/messaging/default_cb.cpp b/src/messaging/default_cb.cpp index 1083293..681f5f6 100644 --- a/src/messaging/default_cb.cpp +++ b/src/messaging/default_cb.cpp @@ -38,6 +38,9 @@ #include "messenger.hpp" +namespace xapp { + + /* This is the default health check function that we provide (user may override it). It will respond to health check messages by @@ -45,10 +48,21 @@ The mr paramter is obviously ignored, but to add this as a callback the function sig must match. + + This is a callback function; sonar will complain that we don't use payload or + data -- we don't, but this is a standard function proto so we cannot just + drop them. */ void Health_ck_cb( Message& mbuf, int mtype, int sid, int len, Msg_component payload, void* data ) { unsigned char response[128]; + if( len < 0 || mtype < 0 ) { + return; + } + snprintf( (char* ) response, sizeof( response ), "OK\n" ); mbuf.Send_response( RIC_HEALTH_CHECK_RESP, sid, strlen( (char *) response )+1, response ); } + + +} // namespace