diff --git a/source/commonlib/telemetry_busmessage_sender.c b/source/commonlib/telemetry_busmessage_sender.c index eb77e5c8..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" @@ -757,6 +758,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 +798,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 +846,6 @@ T2ERROR t2_event_f(const char* marker, double value) return T2ERROR_COMPONENT_NULL; } - initMutex(); pthread_mutex_lock(&fMutex); if ( NULL == marker ) { @@ -880,7 +889,6 @@ T2ERROR t2_event_d(const char* marker, int value) return T2ERROR_COMPONENT_NULL; } - initMutex(); pthread_mutex_lock(&dMutex); if ( NULL == marker ) { @@ -919,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