diff --git a/dmtree/tr181/deviceinfo-iopsyswrt.c b/dmtree/tr181/deviceinfo-iopsyswrt.c index 7b905124..3999826e 100644 --- a/dmtree/tr181/deviceinfo-iopsyswrt.c +++ b/dmtree/tr181/deviceinfo-iopsyswrt.c @@ -2,6 +2,7 @@ #include +/*#Device.DeviceInfo.Manufacturer!UCI:cwmp/cwmp,cpe/manufacturer*/ char * os__get_deviceid_manufacturer() { char *v; @@ -13,10 +14,11 @@ char * os__get_deviceid_manufacturer() return v; } +/*#Device.DeviceInfo.ProductClass!UCI:cwmp/cwmp,cpe/product_class*/ char * os__get_deviceid_productclass() { char *v; - dmuci_get_option_value_string("cwmp", "cpe", "override_productclass", &v); + dmuci_get_option_value_string("cwmp", "cpe", "product_class", &v); if (v[0] == '\0') { db_get_value_string("hw", "board", "iopVerFam", &v); return v; @@ -44,18 +46,22 @@ int os__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data return 0; } +/*#Device.DeviceInfo.ManufacturerOUI!UCI:cwmp/cwmp,cpe/model_name*/ int os__get_device_routermodel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - db_get_value_string("hw", "board", "model_name", value); + dmuci_get_option_value_string("cwmp", "cpe", "model_name", value); + if (*value[0] == '\0') + db_get_value_string("hw", "board", "model_name", value); return 0; } +/*#Device.DeviceInfo.ManufacturerOUI!UCI:cwmp/cwmp,cpe/manufacturer_oui*/ char * os__get_deviceid_manufactureroui() { char *v, *mac = NULL, str[16]; json_object *res; - dmuci_get_option_value_string("cwmp", "cpe", "override_oui", &v); + dmuci_get_option_value_string("cwmp", "cpe", "manufacturer_oui", &v); if (v[0]) return v; diff --git a/dmtree/tr181/deviceinfo.c b/dmtree/tr181/deviceinfo.c index 5d916f32..25e9cbc0 100644 --- a/dmtree/tr181/deviceinfo.c +++ b/dmtree/tr181/deviceinfo.c @@ -49,21 +49,18 @@ int lookup_vcf_name(char *instance, char **value) return 0; } -/*#Device.DeviceInfo.Manufacturer!UCI:cwmp/cwmp,cpe/manufacturer*/ static int get_device_manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = get_deviceid_manufacturer(); return 0; } -/*#Device.DeviceInfo.ManufacturerOUI!UCI:cwmp/cwmp,cpe/override_oui*/ static int get_device_manufactureroui(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = get_deviceid_manufactureroui(); return 0; } -/*#Device.DeviceInfo.ProductClass!UCI:cwmp/cwmp,cpe/override_productclass*/ static int get_device_productclass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = get_deviceid_productclass(); diff --git a/json/tr181.json b/json/tr181.json index 7b67f098..47dc2b41 100644 --- a/json/tr181.json +++ b/json/tr181.json @@ -339,7 +339,7 @@ "name": "cpe" }, "option": { - "name": "override_oui" + "name": "manufacturer_oui" } } } @@ -382,6 +382,21 @@ { "max": 64 } + ], + "mapping": [ + { + "type": "uci", + "uci": { + "file": "cwmp", + "section": { + "type": "cwmp", + "name": "cpe" + }, + "option": { + "name": "model_name" + } + } + } ] }, "Description": { @@ -423,7 +438,7 @@ "name": "cpe" }, "option": { - "name": "override_productclass" + "name": "product_class" } } }