|
@@ -502,7 +502,6 @@ int getLinkQuality()
|
|
|
char cmd[256];
|
|
|
char buf[512];
|
|
|
char tmp[512];
|
|
|
- char *q[2];
|
|
|
|
|
|
strcpy(cmd, "/root/iwconfig ");
|
|
|
strcat(cmd, Wifi.currentInterface);
|
|
@@ -513,13 +512,13 @@ int getLinkQuality()
|
|
|
{
|
|
|
while(fgets(buf, sizeof(buf), fp) != NULL)
|
|
|
{
|
|
|
- if(strstr(buf, "Quality") > 0)
|
|
|
+ if(strstr(buf, "Signal level") > 0)
|
|
|
{
|
|
|
- sscanf(buf, "%*s%s", tmp);
|
|
|
- substr(tmp, tmp, strspn(tmp, "Quality="), strlen(buf)-strspn(tmp, "Quality="));
|
|
|
+ sscanf(buf, "%*s%*s%*s%s", tmp);
|
|
|
+
|
|
|
+ substr(tmp, tmp, strspn(tmp, "Signal level="), strlen(buf)-strspn(tmp, "Signal level="));
|
|
|
|
|
|
- split(q,tmp,"/");
|
|
|
- Wifi.rssi = (atoi(q[0])*100)/atoi(q[1]);
|
|
|
+ Wifi.rssi = atoi(tmp);
|
|
|
|
|
|
result = PASS;
|
|
|
}
|
|
@@ -933,7 +932,7 @@ void proc_sta()
|
|
|
case STA_STATE_AP_CONNECTED:
|
|
|
getInterfaceInfo();
|
|
|
getLinkQuality();
|
|
|
- DEBUG_INFO("Wifi quality: %d\n", Wifi.rssi);
|
|
|
+ DEBUG_INFO("Wifi quality: %d dBm\n", Wifi.rssi);
|
|
|
ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi = Wifi.rssi;
|
|
|
|
|
|
if(isReachableInternet() == PASS)
|