Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 42 additions & 3 deletions source/commonlib/telemetry_busmessage_sender.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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)
{
}
Comment on lines +932 to +939

T2ERROR t2_event_s(const char* marker, const char* value)
{
(void)marker;
(void)value;
return T2ERROR_SUCCESS;
}
Comment on lines +941 to +946

T2ERROR t2_event_f(const char* marker, double value)
{
(void)marker;
(void)value;
return T2ERROR_SUCCESS;
}
Comment on lines +948 to +953

T2ERROR t2_event_d(const char* marker, int value)
{
(void)marker;
(void)value;
return T2ERROR_SUCCESS;
}
Comment on lines +955 to +960