mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
TR-104: set the index of DECT.Portable. as per the 'id' from the ubus call
Each DECT handset has its own 'id' value and this shall be used as the index of DECT.Portable object. Otherwise the index of the DECT.Portable. changes if the handset prior to it is deregistered.
This commit is contained in:
parent
6b1d67e6ec
commit
c9955fdd9f
1 changed files with 9 additions and 1 deletions
|
|
@ -54,8 +54,16 @@ static int browseServicesVoiceServiceDECTPortableInst(struct dmctx *dmctx, DMNOD
|
|||
int id = 0, i = 0;
|
||||
|
||||
dmjson_foreach_obj_in_array(res, arrobj, obj, i, 1, "handsets") {
|
||||
char *str_id = dmjson_get_value(obj, 1, "id");
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, ++id);
|
||||
/* Use the id from the UBUS call if it is found */
|
||||
if (str_id && *str_id) {
|
||||
id = atoi(str_id);
|
||||
} else {
|
||||
id++;
|
||||
}
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, id);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)obj, inst) == DM_STOP)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue