mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-04 21:07:43 +01:00
tr181: deviceinfo: use os specific implementation for model_name
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
This commit is contained in:
parent
d0e399d67d
commit
53ceedd990
4 changed files with 14 additions and 7 deletions
|
|
@ -44,6 +44,12 @@ int os__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data
|
|||
return 0;
|
||||
}
|
||||
|
||||
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);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char * os__get_deviceid_manufactureroui()
|
||||
{
|
||||
char *v, *mac = NULL, str[16];
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ int os__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data
|
|||
return 0;
|
||||
}
|
||||
|
||||
int os__get_device_routermodel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = get_uci_deviceinfo("ModelName");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char * os__get_deviceid_manufactureroui()
|
||||
{
|
||||
return get_uci_deviceinfo("ManufacturerOUI");
|
||||
|
|
|
|||
|
|
@ -82,12 +82,6 @@ static int get_device_softwareversion(char *refparam, struct dmctx *ctx, void *d
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_routermodel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("hw", "board", "model_name", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_info_uptime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
|
|
@ -371,7 +365,7 @@ DMLEAF tDeviceInfoParams[] = {
|
|||
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
|
||||
{"Manufacturer", &DMREAD, DMT_STRING, get_device_manufacturer, NULL, &DMFINFRM, NULL, BBFDM_BOTH},
|
||||
{"ManufacturerOUI", &DMREAD, DMT_STRING, get_device_manufactureroui, NULL, &DMFINFRM, NULL, BBFDM_BOTH},
|
||||
{"ModelName", &DMREAD, DMT_STRING, get_device_routermodel, NULL, &DMFINFRM, NULL, BBFDM_BOTH},
|
||||
{"ModelName", &DMREAD, DMT_STRING, os__get_device_routermodel, NULL, &DMFINFRM, NULL, BBFDM_BOTH},
|
||||
{"ProductClass", &DMREAD, DMT_STRING, get_device_productclass, NULL, &DMFINFRM, NULL, BBFDM_BOTH},
|
||||
{"SerialNumber", &DMREAD, DMT_STRING, get_device_serialnumber, NULL, &DMFINFRM, NULL, BBFDM_BOTH},
|
||||
{"HardwareVersion", &DMREAD, DMT_STRING, os__get_device_hardwareversion, NULL, &DMFINFRM, NULL, BBFDM_BOTH},
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ char * os__get_softwareversion();
|
|||
char * os__get_deviceid_manufactureroui();
|
||||
|
||||
int os__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_device_routermodel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
int os__get_base_mac_addr(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
|
||||
int os__get_memory_status_total(char* refparam, struct dmctx *ctx, void *data, char *instance, char **value);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue