问题
I try to collect some information about the current state of the CWInterface(connected bssid, available access points...) and send them periodic (every 5-10 sec) via udp to a server.
My Problem is that after some time (between 30 and 50 min in some tests with different collection/sending interval) the CWInterface stops returning data.
- [CWInterface interface] returns nil
- [CWInterface interfaceNames] returns a NSSet with 0 entries
- [[CWInterface interface] scanForNetworksWithSSID:nil &error] also returns a NSSet with 0 entries
What am I doing wrong?
I'm totaly out of ideas...
回答1:
OK as I already commented my own question I changed the framework from CoreWlan to the private Apple80211.framework.
This seams to work.
My Application now runs for about one and a quater hour and scanning every few seconds.
Two negative points about using Apple80211 are:
- There is no public documentation about how to use it (I used the documentation from http://code.google.com/p/iphone-wireless/ which also works for Mac OS X)
- The scans now last about 5 seconds which is prety long but hey it works...
来源:https://stackoverflow.com/questions/9943833/cwinterface-returning-no-data