Exemplo n.º 1
0
void StationClass::staticScanCompleted(void *arg, STATUS status)
{
	BssList list;
	if (status == OK)
	{
		if (WifiStation.scanCompletedCallback )
		{
			bss_info *cur = (bss_info*)arg;

			while (cur != NULL)
			{
				list.add(BssInfo(cur));
				cur = cur->next.stqe_next;
			}
			WifiStation.scanCompletedCallback(true, list);
		}

		debugf("scan completed: %d found", list.count());
	}
	else
	{
		debugf("scan failed %d", status);
		if (WifiStation.scanCompletedCallback )
			WifiStation.scanCompletedCallback(false, list);
	}
}
Exemplo n.º 2
0
void networkScanCompleted(bool succeeded, BssList list) {
	if (succeeded) {
		for (int i = 0; i < list.count(); i++)
			if (!list[i].hidden && list[i].ssid.length() > 0)
				networks.add(list[i]);
		scanStatus = 2;
	}
	networks.sort([](const BssInfo& a, const BssInfo& b){ return b.rssi - a.rssi; } );
}