mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Support more than 255 results in NeighboringWiFiDiagnostic
This commit is contained in:
parent
13b998acc7
commit
87dae5d1cf
1 changed files with 14 additions and 3 deletions
|
|
@ -3533,7 +3533,7 @@ static int operate_WiFi_NeighboringWiFiDiagnostic(char *refparam, struct dmctx *
|
||||||
if (res) {
|
if (res) {
|
||||||
json_object *radios = NULL, *arrobj = NULL;
|
json_object *radios = NULL, *arrobj = NULL;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
uint8_t index = 1;
|
uint32_t index = 1;
|
||||||
|
|
||||||
dmjson_foreach_obj_in_array(res, arrobj, radios, i, 1, "radios") {
|
dmjson_foreach_obj_in_array(res, arrobj, radios, i, 1, "radios") {
|
||||||
json_object *scan_res = NULL, *obj = NULL;
|
json_object *scan_res = NULL, *obj = NULL;
|
||||||
|
|
@ -3554,6 +3554,15 @@ static int operate_WiFi_NeighboringWiFiDiagnostic(char *refparam, struct dmctx *
|
||||||
if (!DM_STRLEN(radio_name))
|
if (!DM_STRLEN(radio_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
char *isup = dmjson_get_value(radios, 1, "isup");
|
||||||
|
if (!DM_STRLEN(isup))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
bool ifup = false;
|
||||||
|
string_to_bool(isup, &ifup);
|
||||||
|
if (!ifup)
|
||||||
|
continue;
|
||||||
|
|
||||||
snprintf(object, sizeof(object), "wifi.radio.%s", radio_name);
|
snprintf(object, sizeof(object), "wifi.radio.%s", radio_name);
|
||||||
|
|
||||||
adm_entry_get_reference_param(ctx, "Device.WiFi.Radio.*.Name", radio_name, &radio[1]);
|
adm_entry_get_reference_param(ctx, "Device.WiFi.Radio.*.Name", radio_name, &radio[1]);
|
||||||
|
|
@ -3577,8 +3586,10 @@ static int operate_WiFi_NeighboringWiFiDiagnostic(char *refparam, struct dmctx *
|
||||||
if (!json_object_object_get_ex(scan_res,"accesspoints", &obj))
|
if (!json_object_object_get_ex(scan_res,"accesspoints", &obj))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint8_t len = obj ? json_object_array_length(obj) : 0;
|
uint32_t len = obj ? json_object_array_length(obj) : 0;
|
||||||
for (uint8_t j = 0; j < len; j++ ) {
|
for (uint32_t j = 0; j < len; j++ ) {
|
||||||
|
if (index == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
json_object *array_obj = json_object_array_get_idx(obj, j);
|
json_object *array_obj = json_object_array_get_idx(obj, j);
|
||||||
ssid[1] = dmjson_get_value(array_obj, 1, "ssid");
|
ssid[1] = dmjson_get_value(array_obj, 1, "ssid");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue