In Linux, I need to periodically wake from suspend, check to see if a desired network is available, and either continue the wake up sequence if it is there, or suspend again if it is not present. I'm looking for guidance on how to best choose whether or not to suspend again.
I currently have the WLAN drivers loaded, go to suspend, and wake on a timer. It then detects the desired network and associates with it as shown on the console debug log within about 270ms. However there are two problems with this. 1. It's information just printed to the console, and not so easy to access for control flow decisions. 2. There isn't anything clearly printed when we fail to detect the desired network.
Is there a good way from within a program to quickly query whether the channel scanning process failed to find the desired network, so I can return to the suspend state?
Thanks in advance,
Chris