RDKCOM-5313: RDKBDEV-3174 T2 Telemetry JSON report incorrectly serializes all TR-181 parameter values as strings (missing type fidelity)#81
Conversation
…ters Introduced enum TR181ParameterType and added 'type' field to tr181ValStruct_t in businterface.h. Updated getCCSPProfileParamValues() and getRbusProfileParamValues() to map CCSP/RBUS value types to TR181ParameterType. Modified encodeParamResultInJSON() to inspect tr181ValStruct_t.type and use cJSON_AddNumberToObject, cJSON_AddBoolToObject or cJSON_AddStringToObject as appropriate. Added necessary includes (ccsp_memory.h, ccsp_base_api.h, rbus.h) and cleaned up resource handling (free_parameterValStruct_t, etc.). Ensures telemetry JSON output uses proper numeric/boolean types instead of quoting all values. Signed-off-by: Abdelkarim EL HOSNI abdelkarim.elhosni.prestataire@sfr.com
|
Thank you for your contribution @abdelkarimelhosni . |
There was a problem hiding this comment.
Thank you for your contribution @abdelkarimelhosni .
There are existing backend systems which today expects all fields as strings.
We do see value in this at the same time will have to make sure the existing systems shall operate without disruptions.
Could you please make this support as a configurable build time option to enable this support with default option as current behavior.
This is would help in controlled and phased roll out as well.
Also please apply astyle formatter to the modified files. Commands are as below :
find . -name '*.c' -o -name '*.h' | xargs astyle --options=.astylerc
find . -name '*.orig' -type f -delete
|
Hi @abdelkarimelhosni |
|
Hi @abdelkarimelhosni |
|
Closing this PR due to inactive. |
telemetry: Add tr 181 type tracking for CCSP/RBUS parameters
Introduced enum TR181ParameterType and added 'type' field to tr181ValStruct_t in businterface.h. Updated getCCSPProfileParamValues() and getRbusProfileParamValues() to map CCSP/RBUS value types to TR181ParameterType. Modified encodeParamResultInJSON() to inspect tr181ValStruct_t.type and use cJSON_AddNumberToObject, cJSON_AddBoolToObject or cJSON_AddStringToObject as appropriate. Added necessary includes (ccsp_memory.h, ccsp_base_api.h, rbus.h) and cleaned up resource handling (free_parameterValStruct_t, etc.). Ensures telemetry JSON output uses proper numeric/boolean types instead of quoting all values.
Signed-off-by: Abdelkarim EL HOSNI abdelkarim.elhosni.prestataire@sfr.com