Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.3.0 #25

Closed
wants to merge 12 commits into from
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [1.3.0](https://github.com/rdkcentral/telemetry/compare/1.2.0...1.3.0)

- RDK-55755: [RDK-E] Optimize Telemetry 2.0 Client Library [`#18`](https://github.com/rdkcentral/telemetry/pull/18)
- RDK-53334: Integrate RDK cert selector API to telemetry. [`#15`](https://github.com/rdkcentral/telemetry/pull/15)
- Rebase [`#19`](https://github.com/rdkcentral/telemetry/pull/19)
- RDKEMW-1323: use wan mac to send xconf request for RDK-E [`#17`](https://github.com/rdkcentral/telemetry/pull/17)
- RDKB-56707:Integrate RDK cert selector API to telemetry. [`faeadd4`](https://github.com/rdkcentral/telemetry/commit/faeadd4446d8d052d528e83a0e008cebef02cc2a)
- Update xconfclient.c [`04d817f`](https://github.com/rdkcentral/telemetry/commit/04d817f26605589e403ff2edb54c470d4a1d6824)
- Removed platfrom specific flags [`df274a0`](https://github.com/rdkcentral/telemetry/commit/df274a0267d2482617ce4bdd6aeb469dfff54bf7)

#### 1.2.0

> 4 February 2025

- Fix Compiler Warning for coverity build and add generic macros [`#11`](https://github.com/rdkcentral/telemetry/pull/11)
- RDKEMW-1498: Empty profile name and Hash getting accepted and processed as valid profile [`#10`](https://github.com/rdkcentral/telemetry/pull/10)
- RDK-49250: [RDKE] Improve L2 Test Coverage For Telemetry [`#2`](https://github.com/rdkcentral/telemetry/pull/2)
- RDK-49250: [RDKE] Improve L2 Test Coverage For Telemetry [`#1`](https://github.com/rdkcentral/telemetry/pull/1)
- Import of source (develop) [`afcd234`](https://github.com/rdkcentral/telemetry/commit/afcd23406fc2e5f808812fbc5e3b38e64e510fc0)
- Changelog updates for 1.2.0 release [`a8b1c60`](https://github.com/rdkcentral/telemetry/commit/a8b1c60ff68cff39c58da6dc87644e051829482b)
- RDKEMW-587 : Fix Race-Condition when accessing the data [`7f0ce46`](https://github.com/rdkcentral/telemetry/commit/7f0ce465605c98cc283874b9c9ae13fdeebeb288)
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ GTEST_ENABLE_FLAG =" "
LIBSYSWRAPPER_FLAG=" "
IS_LIBSYSWRAPPER_ENABLED=" "
IS_LIBRDKCONFIG_ENABLED=" "
IS_LIBRDKCERTSEL_ENABLED=" "

AC_ARG_ENABLE([gtestapp],
AS_HELP_STRING([--enable-gtestapp],[enable Gtest support (default is no)]),
Expand Down Expand Up @@ -193,6 +194,19 @@ AC_ARG_ENABLE([mountutils],
AM_CONDITIONAL([IS_LIBRDKCONFIG_ENABLED], [test x$IS_LIBRDKCONFIG_ENABLED = xtrue])
AC_SUBST(LIBRDKCONFIG_FLAG)

AC_ARG_ENABLE([rdkcertselector],
AS_HELP_STRING([--enable-rdkcertselector],[enables rdkcertselector replacement (default is no)]),
[
case "${enableval}" in
yes) IS_LIBRDKCERTSEL_ENABLED=true
LIBRDKCERTSEL_FLAG=" -DLIBRDKCERTSEL_BUILD ";;
no) IS_LIBRDKCERTSEL_ENABLED=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-rdkcertselector]) ;;
esac
],
[echo "rdkcertselector is disabled"])
AM_CONDITIONAL([IS_LIBRDKCERTSEL_ENABLED], [test x$IS_LIBRDKCERTSEL_ENABLED = xtrue])
AC_SUBST(LIBRDKCERTSEL_FLAG)

AC_CONFIG_FILES([Makefile
source/Makefile
Expand Down
9 changes: 9 additions & 0 deletions include/telemetry2_0.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern "C" {
#define T2_EVENT_LIST_PARAM_SUFFIX ".EventMarkerList"
#define T2_EVENT_PARAM "Telemetry.ReportProfiles.EventMarker"
#define T2_PROFILE_UPDATED_NOTIFY "Telemetry.ReportProfiles.ProfilesUpdated"
#define T2_OPERATIONAL_STATUS "Telemetry.OperationalStatus"
#define T2_REPORT_PROFILE_PARAM "Device.X_RDKCENTRAL-COM_T2.ReportProfiles"
#define T2_REPORT_PROFILE_PARAM_MSG_PCK "Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack"
#define T2_TEMP_REPORT_PROFILE_PARAM "Device.X_RDKCENTRAL-COM_T2.Temp_ReportProfiles"
Expand Down Expand Up @@ -74,6 +75,14 @@ typedef enum
#define T2_CACHE_LOCK_FILE "/tmp/t2_lock_file"
#define T2_CONFIG_READY "/tmp/.t2ConfigReady"

typedef enum
{
T2_STATE_NOT_READY,
T2_STATE_COMPONENT_READY,
T2_STATE_CONFIG_READY,
T2_STATE_READY
}T2_OPERATIONAL_STATE;

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 4 additions & 1 deletion source/bulkdata/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ endif

libbulkdata_la_DEPENDENCIES = ${top_builddir}/source/utils/libt2utils.la ${top_builddir}/source/dcautil/libdcautil.la ${top_builddir}/source/protocol/http/libhttp.la ${top_builddir}/source/protocol/rbusMethod/librbusmethod.la ${top_builddir}/source/ccspinterface/libccspinterface.la ${top_builddir}/source/reportgen/libreportgen.la ${top_builddir}/source/scheduler/libscheduler.la ${top_builddir}/source/xconf-client/libxconfclient.la


if IS_PRIVACYCONTROL_ENABLED
libbulkdata_la_CFLAGS = $(PRIVACYCONTROL_FLAG)
libbulkdata_la_CPPFLAGS += -I${top_srcdir}/source/privacycontrol
libbulkdata_la_DEPENDENCIES += ${top_builddir}/source/privacycontrol/libt2thunder_privacycontrol.la
libbulkdata_la_LIBADD += ${top_builddir}/source/privacycontrol/libt2thunder_privacycontrol.la
endif

if IS_LIBRDKCERTSEL_ENABLED
libbulkdata_la_CFLAGS = $(LIBRDKCERTSEL_FLAG)
endif
11 changes: 11 additions & 0 deletions source/bulkdata/reportprofiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
#include "telemetry2_0.h"
#include "t2MtlsUtils.h"
#include "persistence.h"
#ifdef LIBRDKCERTSEL_BUILD
#include "curlinterface.h"
#endif

#if defined(PRIVACYMODES_CONTROL)
#include "rdkservices_privacyutils.h"
Expand Down Expand Up @@ -366,6 +369,8 @@ static void createComponentDataElements() {
if(cfgReadyFlag){
fclose(cfgReadyFlag);
}
setT2EventReceiveState(T2_STATE_CONFIG_READY);
T2Info("T2 is now Ready to be configured for report profiles\n");

T2Debug("%s --out\n", __FUNCTION__);
}
Expand Down Expand Up @@ -434,9 +439,11 @@ T2ERROR initReportProfiles()
T2Error("%s ReportProfiles already initialized - ignoring\n", __FUNCTION__);
return T2ERROR_FAILURE;
}
#ifndef LIBRDKCERTSEL_BUILD
if(isMtlsEnabled() == true){
initMtls();
}
#endif
#if defined (PRIVACYMODES_CONTROL)
DIR *dir = opendir(PRIVACYMODE_PATH);
if(dir == NULL){
Expand Down Expand Up @@ -584,7 +591,11 @@ T2ERROR ReportProfiles_uninit( ) {
rpInitialized = false;
if(isRbusEnabled())
getMarkerCompRbusSub(false); // remove Rbus subscription
#ifdef LIBRDKCERTSEL_BUILD
curlCertSelectorFree();
#else
uninitMtls();
#endif
T2ER_Uninit();
destroyT2MarkerComponentMap();
uninitScheduler();
Expand Down
2 changes: 2 additions & 0 deletions source/bulkdata/t2eventreceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ T2ERROR T2ER_Init()
}

system("touch /tmp/.t2ReadyToReceiveEvents");
setT2EventReceiveState(T2_STATE_COMPONENT_READY);
T2Info("T2 is now Ready to Recieve Events\n");

T2Debug("%s --out\n", __FUNCTION__);
return T2ERROR_SUCCESS;
Expand Down
2 changes: 2 additions & 0 deletions source/ccspinterface/busInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ T2ERROR registerForTelemetryEvents(TelemetryEventCallback eventCB);
// Needs to be called only in rBus mode
T2ERROR regDEforCompEventList(const char* componentName, T2EventMarkerListCallback callBackHandler) ;

void setT2EventReceiveState(int T2_STATE);

void unregisterDEforCompEventList();

T2ERROR regDEforProfileDataModel(callBackHandlers* cbHandlers);
Expand Down
28 changes: 24 additions & 4 deletions source/ccspinterface/rbusInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static ReportProfilesDeleteDNDCallBack mprofilesDeleteCallBack;
#if defined(PRIVACYMODES_CONTROL)
static char* privacyModeVal = NULL;
#endif
static uint32_t t2ReadyStatus = T2_STATE_NOT_READY;;
static char* reportProfileVal = NULL ;
static char* tmpReportProfileVal = NULL ;
static char* reportProfilemsgPckVal = NULL ;
Expand Down Expand Up @@ -586,7 +587,16 @@ rbusError_t t2PropertyDataGetHandler(rbusHandle_t handle, rbusProperty_t propert
rbusValue_SetString(value, "");
rbusProperty_SetValue(property, value);
rbusValue_Release(value);
}else if(strncmp(propertyName, T2_TOTAL_MEM_USAGE, maxParamLen) == 0) {
}
else if(strncmp(propertyName, T2_OPERATIONAL_STATUS, maxParamLen) == 0) {
rbusValue_t value;
rbusValue_Init(&value);

rbusValue_SetUInt32(value, t2ReadyStatus);
rbusProperty_SetValue(property, value);
rbusValue_Release(value);
}
else if(strncmp(propertyName, T2_TOTAL_MEM_USAGE, maxParamLen) == 0) {
rbusValue_t value;
rbusValue_Init(&value);
profilememUsedCallBack(&t2MemUsage);
Expand Down Expand Up @@ -1003,11 +1013,12 @@ T2ERROR registerRbusT2EventListener(TelemetryEventCallback eventCB)
/**
* Register data elements with rbus for EVENTS and Profile Updates.
*/
rbusDataElement_t dataElements[2] = {
rbusDataElement_t dataElements[3] = {
{T2_EVENT_PARAM, RBUS_ELEMENT_TYPE_PROPERTY, {NULL, t2PropertyDataSetHandler, NULL, NULL, NULL, NULL}},
{T2_PROFILE_UPDATED_NOTIFY, RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, (rbusEventSubHandler_t)eventSubHandler, NULL}}
{T2_PROFILE_UPDATED_NOTIFY, RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, (rbusEventSubHandler_t)eventSubHandler, NULL}},
{T2_OPERATIONAL_STATUS, RBUS_ELEMENT_TYPE_PROPERTY, {t2PropertyDataGetHandler, NULL, NULL, NULL, NULL, NULL}}
};
ret = rbus_regDataElements(t2bus_handle, 2, dataElements);
ret = rbus_regDataElements(t2bus_handle, 3, dataElements);
if(ret != RBUS_ERROR_SUCCESS)
{
T2Error("Failed to register T2 data elements with rbus. Error code : %d\n", ret);
Expand All @@ -1019,6 +1030,15 @@ T2ERROR registerRbusT2EventListener(TelemetryEventCallback eventCB)
return status;
}

void setT2EventReceiveState(int T2_STATE)
{
T2Debug("%s ++in\n", __FUNCTION__);

t2ReadyStatus |= T2_STATE;

T2Debug("%s ++out\n", __FUNCTION__);
}

T2ERROR unregisterRbusT2EventListener()
{
rbusEvent_Unsubscribe(t2bus_handle, T2_EVENT_PARAM);
Expand Down
20 changes: 17 additions & 3 deletions source/commonlib/telemetry_busmessage_sender.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,22 @@ static bool isCachingRequired( ) {
}

// Always check for t2 is ready to accept events. Shutdown target can bring down t2 process at runtime
if(access( T2_COMPONENT_READY, F_OK) == -1) {
return true ;
uint32_t t2ReadyStatus;
rbusError_t retVal = RBUS_ERROR_SUCCESS;

retVal = rbus_getUint(bus_handle, T2_OPERATIONAL_STATUS, &t2ReadyStatus);

if(retVal != RBUS_ERROR_SUCCESS)
{
return true;
}
else
{
EVENT_DEBUG("value for %s is : %d\n", T2_OPERATIONAL_STATUS, t2ReadyStatus);
if((t2ReadyStatus & T2_STATE_COMPONENT_READY)==0)
{
return true;
}
}

if(!isRbusEnabled){
Expand All @@ -567,7 +581,7 @@ static bool isCachingRequired( ) {
if(!isT2Ready) {
if(componentName && (0 != strcmp(componentName, "telemetry_client"))) {
// From other binary applications in rbus mode if t2 daemon is yet to determine state of component specific config from cloud, enable cache
if( access( T2_CONFIG_READY, F_OK) == -1 ) {
if((t2ReadyStatus & T2_STATE_COMPONENT_READY)==0) {
return true;
}else {
rbusError_t ret = RBUS_ERROR_SUCCESS;
Expand Down
4 changes: 4 additions & 0 deletions source/protocol/http/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ lib_LTLIBRARIES = libhttp.la

libhttp_la_SOURCES = curlinterface.c
libhttp_la_LDFLAGS = -shared -fPIC -lcurl
if IS_LIBRDKCERTSEL_ENABLED
libhttp_la_CFLAGS = $(LIBRDKCERTSEL_FLAG)
libhttp_la_LDFLAGS += -lRdkCertSelector
endif
libhttp_la_CPPFLAGS = -fPIC -I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/dbus-1.0 \
-I${PKG_CONFIG_SYSROOT_DIR}$(libdir)/dbus-1.0/include \
-I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/ccsp \
Expand Down
Loading