From d2959c36d3b15a441abf0445a9414d691098bfca Mon Sep 17 00:00:00 2001 From: Yogeswaran K <166126056+yogeswaransky@users.noreply.github.com> Date: Fri, 26 Jun 2026 16:43:57 +0530 Subject: [PATCH 1/2] Move initialization out of t2_event APIs into t2_init --- source/commonlib/telemetry_busmessage_sender.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/commonlib/telemetry_busmessage_sender.c b/source/commonlib/telemetry_busmessage_sender.c index eb77e5c8..77fe978e 100644 --- a/source/commonlib/telemetry_busmessage_sender.c +++ b/source/commonlib/telemetry_busmessage_sender.c @@ -757,6 +757,16 @@ static int report_or_cache_data(char* telemetry_data, const char* markerName) void t2_init(char *component) { componentName = strdup(component); + initMutex(); + + if(initMessageBus() != T2ERROR_SUCCESS) + { + EVENT_ERROR("%s:%d, T2:initMessageBus failed in t2_init, will retry during event send\n", __func__, __LINE__); + } + else + { + isRFCT2Enable = true; + } } void t2_uninit(void) @@ -787,7 +797,6 @@ T2ERROR t2_event_s(const char* marker, const char* value) EVENT_DEBUG("%s:%d, T2:component with pid = %d is trying to send event %s with value %s without component name \n", __func__, __LINE__, (int) getpid(), marker, value); return T2ERROR_COMPONENT_NULL; } - initMutex(); pthread_mutex_lock(&sMutex); if ( NULL == marker || NULL == value) { @@ -836,7 +845,6 @@ T2ERROR t2_event_f(const char* marker, double value) return T2ERROR_COMPONENT_NULL; } - initMutex(); pthread_mutex_lock(&fMutex); if ( NULL == marker ) { @@ -880,7 +888,6 @@ T2ERROR t2_event_d(const char* marker, int value) return T2ERROR_COMPONENT_NULL; } - initMutex(); pthread_mutex_lock(&dMutex); if ( NULL == marker ) { From e3ba1382bac5cd7a79f546101620f71302d7db71 Mon Sep 17 00:00:00 2001 From: Yogeswaran K Date: Fri, 26 Jun 2026 12:46:37 +0000 Subject: [PATCH 2/2] RDKEMW-19134: Stubbing the t2 client apis Signed-off-by: Yogeswaran K --- .../commonlib/telemetry_busmessage_sender.c | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/source/commonlib/telemetry_busmessage_sender.c b/source/commonlib/telemetry_busmessage_sender.c index 77fe978e..27d56b33 100644 --- a/source/commonlib/telemetry_busmessage_sender.c +++ b/source/commonlib/telemetry_busmessage_sender.c @@ -42,6 +42,7 @@ #include "t2log_wrapper.h" #include "telemetry_busmessage_internal.h" +#if 0 #define MESSAGE_DELIMITER "<#=#>" #define MAX_EVENT_CACHE 200 #define T2_COMPONENT_READY "/tmp/.t2ReadyToReceiveEvents" @@ -926,3 +927,34 @@ T2ERROR t2_event_d(const char* marker, int value) pthread_mutex_unlock(&dMutex); return retStatus ; } + +#endif +void t2_init(char *component) +{ + (void)component; +} + +void t2_uninit(void) +{ +} + +T2ERROR t2_event_s(const char* marker, const char* value) +{ + (void)marker; + (void)value; + return T2ERROR_SUCCESS; +} + +T2ERROR t2_event_f(const char* marker, double value) +{ + (void)marker; + (void)value; + return T2ERROR_SUCCESS; +} + +T2ERROR t2_event_d(const char* marker, int value) +{ + (void)marker; + (void)value; + return T2ERROR_SUCCESS; +} \ No newline at end of file