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

RDKBDEV-2903 :Implement xTUC and xTUR configuration fields Data models in xDSLManager #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
72 changes: 71 additions & 1 deletion config/RdkXdslManager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,49 @@
</parameter>
<parameter>
<name>XTURVendor</name>
<type>string(9)</type>
<type>hexBinary(4:4)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTURVersion</name>
<type>string(17)</type>
<syntax>string</syntax>
</parameter>
<parameter>
<name>XTURSerial</name>
<type>string(33)</type>
<syntax>string</syntax>
</parameter>
<parameter>
<name>XTURVendorId</name>
<type>hexBinary(8:8)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTURSystemVendorId</name>
<type>hexBinary(8:8)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTURVendorSpecific</name>
<type>hexBinary(2:2)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTURSystemVendor</name>
<type>hexBinary(4:4)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTURSystemVendorSpecific</name>
<type>hexBinary(2:2)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTURSystemCountry</name>
<type>hexBinary(2:2)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTURCountry</name>
<type>string(5)</type>
Expand All @@ -367,6 +407,36 @@
<type>string(9)</type>
<syntax>string</syntax>
</parameter>
<parameter>
<name>XTUCVersion</name>
<type>hexBinary(16:16)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTUCSerial</name>
<type>string(33)</type>
<syntax>string</syntax>
</parameter>
<parameter>
<name>XTUCVendorSpecific</name>
<type>hexBinary(2:2)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTUCSystemVendor</name>
<type>hexBinary(4:4)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTUCSystemVendorSpecific</name>
<type>hexBinary(2:2)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTUCSystemCountry</name>
<type>hexBinary(2:2)</type>
<syntax>hexBinary</syntax>
</parameter>
<parameter>
<name>XTUCCountry</name>
<type>string(5)</type>
Expand Down
125 changes: 125 additions & 0 deletions hal_schema/xdsl_hal_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,15 @@
{ "$ref": "#/definitions/dslLineUpstreamPower" },
{ "$ref": "#/definitions/dslLineDownstreamPower" },
{ "$ref": "#/definitions/dslLineXTURVendor" },
{ "$ref": "#/definitions/dslLineXTURVersion" },
{ "$ref": "#/definitions/dslLineXTURSerial" },
{ "$ref": "#/definitions/dslLineXTURCountry" },
{ "$ref": "#/definitions/dslLineXTURANSIStd" },
{ "$ref": "#/definitions/dslLineXTURANSIRev" },
{ "$ref": "#/definitions/dslLineXTUCVendor" },
{ "$ref": "#/definitions/dslLineXTUCVersion" },
{ "$ref": "#/definitions/dslLineXTUCSerial" },
{ "$ref": "#/definitions/dslLineXTUCVendorSpecific" },
{ "$ref": "#/definitions/dslLineXTUCCountry" },
{ "$ref": "#/definitions/dslLineXTUCANSIStd" },
{ "$ref": "#/definitions/dslLineXTUCANSIRev" },
Expand Down Expand Up @@ -1438,6 +1443,46 @@
}
},

"dslLineXTURVendorSpecific": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^Device\\.DSL\\.Line\\.\\d+\\.XTURVendorSpecific$"
},
"type": {
"type": "string",
"const": "hexBinary"
},
"value": {
"$ref": "#/definitions/typeHex",
"minLength": 2,
"maxLength": 2
}
}
},

"dslLineXTURSystemVendorId": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^Device\\.DSL\\.Line\\.\\d+\\.XTURSystemVendorId$"
},
"type": {
"type": "string",
"const": "hexBinary"
},
"value": {
"$ref": "#/definitions/typeHex",
"minLength": 8,
"maxLength": 8
}
}
},

"dslLineXTURCountry": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -1516,6 +1561,86 @@
}
},

"dslLineXTUCSystemVendorId": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^Device\\.DSL\\.Line\\.\\d+\\.XTUCSystemVendorId$"
},
"type": {
"type": "string",
"const": "hexBinary"
},
"value": {
"$ref": "#/definitions/typeHex",
"minLength": 8,
"maxLength": 8
}
}
},

"dslLineXTUCVersion": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^Device\\.DSL\\.Line\\.\\d+\\.XTUCVersion$"
},
"type": {
"type": "string",
"const": "hexBinary"
},
"value": {
"$ref": "#/definitions/typeHex",
"minLength": 16,
"maxLength": 16
}
}
},

"dslLineXTUCSerial": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^Device\\.DSL\\.Line\\.\\d+\\.XTUCSerial$"
},
"type": {
"type": "string",
"const": "hexBinary"
},
"value": {
"$ref": "#/definitions/typeHex",
"minLength": 32,
"maxLength": 32
}
}
},

"dslLineXTUCVendorSpecific": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "^Device\\.DSL\\.Line\\.\\d+\\.XTUCVendorSpecific$"
},
"type": {
"type": "string",
"const": "hexBinary"
},
"value": {
"$ref": "#/definitions/typeHex",
"minLength": 2,
"maxLength": 2
}
}
},

"dslLineXTUCCountry": {
"type": "object",
"additionalProperties": false,
Expand Down
17 changes: 17 additions & 0 deletions source/TR-181/include/xdsl_apis.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@


#define XDSL_STANDARD_USED_STR_MAX 64
#define SYSTEM_VENDOR_ID_LENGTH 16
#define BEGINNING_INDEX 4

typedef enum
_DML_XDSL_LINE_TYPE
Expand Down Expand Up @@ -253,12 +255,27 @@ _DML_XDSL_LINE
INT DownstreamAttenuation;
INT DownstreamNoiseMargin;
INT DownstreamPower;
CHAR XTURSerial[33];
CHAR XTURVersion[17];
CHAR XTURVendor[9];
CHAR XTURSystemCountry[5];
CHAR XTURSystemVendor[9];
CHAR XTURVendorSpecific[5];
CHAR XTURSystemVendorSpecific[5];
CHAR XTURCountry[5];
UINT XTURANSIStd;
UINT XTURANSIRev;
CHAR XTUCVendor[9];
CHAR XTUCVersion[33];
CHAR XTUCSerial[33];
CHAR XTUCSystemVendorId[17];
CHAR XTUCVersionNumber[17];
CHAR XTUCSerialNumber[33];
CHAR XTUCVendorSpecific[5];
CHAR XTUCSystemVendor[9];
CHAR XTUCSystemVendorSpecific[5];
CHAR XTUCCountry[5];
CHAR XTUCSystemCountry[5];
UINT XTUCANSIStd;
UINT XTUCANSIRev;
DML_XDSL_LINE_STATS stLineStats;
Expand Down
47 changes: 47 additions & 0 deletions source/TR-181/integration_src.shared/xdsl_apis.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
//XDSL
#define XDSL_LINE_ENABLE "Device.DSL.Line.%d.Enable"
#define XDSL_LINE_DATA_GATHERING_ENABLE "Device.DSL.Line.%d.EnableDataGathering"
#define XDSL_LINE_XTURVERSION "Device.DSL.Line.%d.XTURVersion"
#define XDSL_LINE_XTURSERIAL "Device.DSL.Line.%d.XTURSerial"
#define MAX_XTURVERSION_LENGTH 17
#define MAX_XTURSERIAL_LENGTH 33
#define MAX_STRING_SIZE 64

/* *********************************************************************** */
//Global Declaration
Expand All @@ -122,6 +127,7 @@ extern char * XdslReportStatusDfltReportingPeriod;
extern char * XdslReportStatusReportingPeriod;

static ANSC_STATUS DmlXdslGetLineStaticInfo( INT LineIndex, PDML_XDSL_LINE pstLineInfo );
static ANSC_STATUS DmlXdslSetLineInfo( INT LineIndex);
static ANSC_STATUS DmlXdslGetParamValues( char *pComponent, char *pBus, char *pParamName, char *pReturnVal );
static ANSC_STATUS DmlXdslSetParamValues( char *pComponent, char *pBus, char *pParamName, char *pParamVal, enum dataType_e type, BOOLEAN bCommit );
static ANSC_STATUS DmlXdslGetParamNames( char *pComponent, char *pBus, char *pParamName, char a2cReturnVal[][256], int *pReturnSize );
Expand Down Expand Up @@ -250,6 +256,7 @@ DmlXdslLineInit
pXDSLLineTmp[iLoopCount].ulInstanceNumber = iLoopCount + 1;

DmlXdslGetLineStaticInfo( iLoopCount, &pXDSLLineTmp[iLoopCount] );
DmlXdslSetLineInfo( iLoopCount);
}

//Assign the memory address to oringinal structure
Expand Down Expand Up @@ -285,6 +292,46 @@ static ANSC_STATUS DmlXdslGetLineStaticInfo( INT LineIndex, PDML_XDSL_LINE pstLi
return ANSC_STATUS_SUCCESS;
}

/* DmlXdslSetLineInfo() */
static ANSC_STATUS DmlXdslSetLineInfo( INT LineIndex)
{
char fName[ANSC_MAX_STRING_SIZE] = {0} , Model[ANSC_MAX_STRING_SIZE] = {0}, Serial[ANSC_MAX_STRING_SIZE] = {0};

if (platform_hal_GetSerialNumber(Serial) == RETURN_OK )
{
/* collect value*/
if (platform_hal_GetFirmwareName(fName, ANSC_MAX_STRING_SIZE) == RETURN_OK )
{
if (platform_hal_GetModelName(Model) == RETURN_OK )
{
hal_param_t set_param;

/* XTURVersion in BCM Level */
memset(&set_param, 0, sizeof(set_param));
set_param.type = PARAM_STRING;
snprintf(set_param.name, sizeof(set_param.name), XDSL_LINE_XTURVERSION, LineIndex + 1);
snprintf(set_param.value,MAX_XTURVERSION_LENGTH,"%s %s",fName,Model);
xtm_hal_setLinkInfoParam(&set_param);

/* XTURSerial in BCM */
memset(&set_param, 0, sizeof(set_param));
set_param.type = PARAM_STRING;
snprintf(set_param.name, sizeof(set_param.name), XDSL_LINE_XTURSERIAL, LineIndex + 1);
snprintf(set_param.value,MAX_XTURSERIAL_LENGTH,"%s %s %s",Serial, Model, fName);
xtm_hal_setLinkInfoParam(&set_param);
}
else
return ANSC_STATUS_FAILURE;
}
else
return ANSC_STATUS_FAILURE;
}
else
return ANSC_STATUS_FAILURE;

return ANSC_STATUS_SUCCESS;
}

/* DmlXdslGetLineCfg() */
ANSC_STATUS DmlXdslGetLineCfg( INT LineIndex, PDML_XDSL_LINE pstLineInfo )
{
Expand Down
Loading