mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-03-01 17:35:33 +01:00
Get DeviceId specific parameter from cwmp
- CWMP DeviceId specific parameters first read from cwmp uci if not present, it fallback to default db.
This commit is contained in:
parent
8cd79f799e
commit
29f8051364
3 changed files with 10 additions and 5 deletions
|
|
@ -226,13 +226,19 @@ static int get_device_productclass(char *refparam, struct dmctx *ctx, void *data
|
|||
|
||||
static int get_device_serialnumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "SerialNumber", value);
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "serial_number", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "SerialNumber", value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_device_softwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
db_get_value_string("device", "deviceinfo", "SoftwareVersion", value);
|
||||
dmuci_get_option_value_string("cwmp", "cpe", "software_version", value);
|
||||
if (*value[0] == '\0')
|
||||
db_get_value_string("device", "deviceinfo", "SoftwareVersion", value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ int bbf_uci_init(void)
|
|||
|
||||
dmuci_init_bbfdm();
|
||||
|
||||
db_config = (folder_exists(LIB_DB_CONFIG)) ? LIB_DB_CONFIG : ETC_DB_CONFIG;
|
||||
db_config = ETC_DB_CONFIG;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -838,7 +838,7 @@ int db_get_value_string(char *package, char *section, char *option, char **value
|
|||
{
|
||||
struct uci_option *o;
|
||||
|
||||
o = dmuci_get_option_ptr((db_config) ? db_config : LIB_DB_CONFIG, package, section, option);
|
||||
o = dmuci_get_option_ptr((db_config) ? db_config : ETC_DB_CONFIG, package, section, option);
|
||||
if (o) {
|
||||
*value = o->v.string ? dmstrdup(o->v.string) : ""; // MEM WILL BE FREED IN DMMEMCLEAN
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <uci.h>
|
||||
#include <libubox/list.h>
|
||||
|
||||
#define LIB_DB_CONFIG "/lib/db/config"
|
||||
#define ETC_DB_CONFIG "/etc/board-db/config"
|
||||
#define VARSTATE_CONFIG "/var/state"
|
||||
#define BBFDM_CONFIG "/etc/bbfdm/dmmap"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue