Skip to content

Commit 5498366

Browse files
SPRESENSEjerpelea
authored andcommitted
netutils/esp8266: Add to get channel from access points
Fix bug that channel retrieved by lesp_list_access_points is undefined. Signed-off-by: SPRESENSE <[email protected]>
1 parent e61ee79 commit 5498366

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

netutils/esp8266/esp8266.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ static int lesp_parse_cwjap_ans_line(char *ptr, lesp_ap_t *ap)
11231123
* "FreeWifi" => ssid
11241124
* -90 => rssi
11251125
* "00:07:cb:07:b6:00" => mac
1126+
* 1 => channel
11261127
*
11271128
* Note: Content of ptr is modified and string in ap point into ptr string.
11281129
*
@@ -1220,6 +1221,14 @@ static int lesp_parse_cwlap_ans_line(char *ptr, lesp_ap_t *ap)
12201221
}
12211222
}
12221223
break;
1224+
1225+
case 5:
1226+
{
1227+
int i = atoi(ptr);
1228+
1229+
ap->channel = i;
1230+
}
1231+
break;
12231232
}
12241233

12251234
ptr = ptr_next + 1;

0 commit comments

Comments
 (0)