Bug 774582 part2 - Unable to know if there is a user connected to Wifi tethering network. r=mrbkap

This commit is contained in:
Vincent Chang 2014-05-29 13:50:57 +08:00
Родитель 07345883f9
Коммит 49fae4c1ca
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -77,9 +77,18 @@ WifiHotspotUtils::sendCommand(struct wpa_ctrl *ctrl, const char *cmd,
} else if (ret < 0 || strncmp(reply, "FAIL", 4) == 0) {
return -1;
}
if (strncmp(cmd, "PING", 4) == 0) {
reply[*reply_len] = '\0';
// Make the reply printable.
reply[*reply_len] = '\0';
if (strncmp(cmd, "STA-FIRST", 9) == 0 ||
strncmp(cmd, "STA-NEXT", 8) == 0) {
char *pos = reply;
while (*pos && *pos != '\n')
pos++;
*pos = '\0';
}
return 0;
}