Skip to content
Open
Show file tree
Hide file tree
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
41 changes: 40 additions & 1 deletion schemas/t2_reportProfileSchema.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,44 @@
}
}
]
},
"dataModelSimple": {
"title": "\"dataModel\" Parameter (restricted for use in dataModelTable)",
"type": "object",
"properties": {
"type": { "type": "string", "const": "dataModel" },
"reference": { "type": "string" }
},
"required": ["type", "reference"],
"additionalProperties": false
},
"dataModelTable": {
"title": "\"dataModelTable\" Parameter",
"type": "object",
"properties": {
"type": { "type": "string", "const": "dataModelTable" },
"reference": {
"type": "string",
"pattern": ".*\\.$",
"description": "Reference must end with a dot '.'"
},
"index": {
"type": "string",
"pattern": "^(\\d+(-\\d+)?)(,(\\d+(-\\d+)?))*$",
"description": "Comma separated numbers, ranges (e.g. 1-4), or combinations (e.g. 1,2,5-7)."
},
"Parameter": {
"type": "array",
"items": {
"oneOf": [
{ "$ref": "#/definitions/parmDefinitions/properties/dataModelSimple" },
{ "$ref": "#/definitions/parmDefinitions/properties/dataModelTable" }
]
}
}
},
"required": ["type", "reference", "Parameter"],
"additionalProperties": false
}
}
},
Expand Down Expand Up @@ -234,7 +272,8 @@
"oneOf": [
{ "$ref": "#/definitions/parmDefinitions/properties/grep", "title": "grep" },
{ "$ref": "#/definitions/parmDefinitions/properties/event", "title": "event" },
{ "$ref": "#/definitions/parmDefinitions/properties/dataModel", "title": "dataModel" }
{ "$ref": "#/definitions/parmDefinitions/properties/dataModel", "title": "dataModel" },
{ "$ref": "#/definitions/parmDefinitions/properties/dataModelTable", "title": "dataModelTable" }
]
},
"description": "An array of objects which defines the data to be included in the generated report. Each object defines the type of data, the source of the data and an optional name to be used as the name (marker) for this data in the generated report. "
Expand Down
14 changes: 13 additions & 1 deletion source/bulkdata/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "t2markers.h"
#include "t2log_wrapper.h"
#include "busInterface.h"
#include "ccspinterface.h"
#include "curlinterface.h"
#include "rbusmethodinterface.h"
#include "scheduler.h"
Expand Down Expand Up @@ -195,6 +196,10 @@ static void freeProfile(void *data)
Vector_Destroy(profile->cachedReportList, free);
profile->cachedReportList = NULL;
}
if(profile->dataModelTableList)
{
Vector_Destroy(profile->dataModelTableList, freeDataModelTable);
}
if(profile->jsonReportObj)
{
cJSON_Delete(profile->jsonReportObj);
Expand Down Expand Up @@ -445,7 +450,14 @@ static void* CollectAndReport(void* data)
profileParamVals = getProfileParameterValues(profile->paramList, count);
if(profileParamVals != NULL)
{
encodeParamResultInJSON(valArray, profile->paramList, profileParamVals);
if (Vector_Size(profile->dataModelTableList) > 0)
{
encodeParamResultInJSON(valArray, profile->paramList, profileParamVals, profile->dataModelTableList);
}
else
{
encodeParamResultInJSON(valArray, profile->paramList, profileParamVals, NULL);
}
}
Vector_Destroy(profileParamVals, freeProfileValues);
}
Expand Down
1 change: 1 addition & 0 deletions source/bulkdata/profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ typedef struct _Profile
Vector *gMarkerList;
Vector *topMarkerList;
Vector *cachedReportList;
Vector *dataModelTableList; // List of DataModelTable
cJSON *jsonReportObj;
pthread_t reportThread;
pthread_mutex_t triggerCondMutex;
Expand Down
2 changes: 1 addition & 1 deletion source/bulkdata/profilexconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static void* CollectAndReportXconf(void* data)
T2Info("Fetch complete for TR-181 Object/Parameter Values for parameters \n");
if(profileParamVals != NULL)
{
encodeParamResultInJSON(valArray, profile->paramList, profileParamVals);
encodeParamResultInJSON(valArray, profile->paramList, profileParamVals, NULL);
}
Vector_Destroy(profileParamVals, freeProfileValues);
}
Expand Down
Loading