[Bugfix][API-379][wifi] fix lynq_get_connect_ap_rssi
Change-Id: Iab4dfa86796c77bb501d3829f0da82a972d2f171
diff --git a/lib/liblynq-wifi6/libwifi6.c b/lib/liblynq-wifi6/libwifi6.c
index 07beaf7..2d7290f 100755
--- a/lib/liblynq-wifi6/libwifi6.c
+++ b/lib/liblynq-wifi6/libwifi6.c
@@ -268,6 +268,21 @@
return -1;
}
+ //@todo delete add temp check for socket avilable start (20220606)
+ for (i=0; i<60; i++)
+ {
+ if (system("netstat -an | grep -q DGRAM") == 0) {
+ break;
+ }
+ sleep(1);
+ }
+
+ if (i >= 60)
+ {
+ return -1;
+ }
+ //@todo delete add temp check for socket avilable end (20220606)
+
if (0 != system("ifconfig | grep -q ap0")) {
system("connmanctl enable wifi");
usleep(300*1000);
@@ -2287,7 +2302,7 @@
// CHECK_IDX(idx, CTRL_AP);
- if((fp=popen("wl country","r"))==NULL)
+ if((fp=popen("wl rssi","r"))==NULL)
{
perror("popen error!");
return -1;
@@ -2297,7 +2312,7 @@
perror("fread fail!");
return -1;
}
- *rssi = atoi(lynq_cmd_ret);
+ *rssi = atoi(lynq_cmd_ret) * -1;
return 0;
}