コード例 #1
0
ファイル: Station.cpp プロジェクト: 0xPIT/Sming
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);
	}
}
コード例 #2
0
ファイル: utils.cpp プロジェクト: Bravo13/esp_hello_world
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; } );
}