问题描述
我尝试收集有关CWInterface当前状态的信息(已连接的bssid,可用的访问点...),并定期(每5-10秒)通过udp将它们发送到服务器.
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.
我的问题是一段时间(某些采集/发送间隔不同的测试在30到50分钟之间)之后,CWInterface停止返回数据.
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接口]返回nil
- [CWInterface interfaceNames]返回具有0个条目的NSSet
- [[CWInterface接口] scanForNetworksWithSSID:nil& error]也返回0的NSSet条目
- [CWInterface interface] returns nil
- [CWInterface interfaceNames] returns a NSSet with 0 entries
- [[CWInterface interface] scanForNetworksWithSSID:nil &error] also returns a NSSet with 0entries
我在做什么错了?
我完全没有主意...
I'm totaly out of ideas...
推荐答案
好,因为我已经评论了自己的问题,所以我将框架从CoreWlan更改为私有Apple80211.framework.
OK as I already commented my own question I changed the framework from CoreWlan to the private Apple80211.framework.
这很有用.
我的应用程序现在运行大约一个四分之一小时,然后每隔几秒钟扫描一次.
My Application now runs for about one and a quater hour and scanning every few seconds.
有关使用Apple80211的两个负面点是:
Two negative points about using Apple80211 are:
- 没有有关如何使用它的公共文档(我使用了 http://code.google.com/p/iphone-wireless/(也适用于Mac OS X)
- 扫描现在持续约5秒钟,这是相当长的时间,但是嘿,它起作用了...
- 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...
这篇关于CWInterface不返回任何数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!