标签: corewlan

使用startMonitoringEventWithType:error:努力检测wifi SSID的变化

Apple似乎在Yosemite和CoreWLAN框架上引入了相当大的变化.我想使用它的新API,引用头文件:

/*!
 * @method
 *
 * @param type
 * A CWEventType value.
 *
 * @param error
 * An NSError object passed by reference, which upon return will contain the error if an error occurs.
 * This parameter is optional.
 *
 * @result
 * A BOOL value indicating whether or not an error occurred. YES indicates no error occurred.
 *
 * @abstract 
 * Register for specific Wi-Fi event notifications.
 * 
 * @discussion
 * Requires the <i>com.apple.wifi.events</i> entitlement.
 */
- (BOOL)startMonitoringEventWithType:(CWEventType)type error:(out …
Run Code Online (Sandbox Code Playgroud)

macos cocoa ssid corewlan osx-yosemite

11
推荐指数
1
解决办法
951
查看次数

你如何使用PyObjC关闭和打开Mac的无线接口?

你如何使用PyObjC关闭和打开Mac的无线接口?到目前为止,我的研究已经将我引向了Cocoa框架和PyObjC.在Mac开发人员网站,我发现一个无线接口管理应用程序演示了如何使用Cocoa框架来打开和关闭一台Mac的无线接口的例子在这里.此示例表明CoreWLAN Framework下的CWInterface是完成关闭和打开Mac无线接口的任务所必需的.然而,PyObjC似乎并不包括可可CoreWLAN框架在其包装这里.有关如何完成此任务的任何想法?我可以实现自己的PyObjc对象来调用CoreWLAN框架,如果是这样,那么如何做到这一点会有什么好资源?谢谢你的时间!一切都有帮助.

macos wireless cocoa pyobjc corewlan

5
推荐指数
1
解决办法
827
查看次数

沙盒coreWLAN?

我正在编写一个OS X应用程序,它取决于确定无线信号强度的能力,但我无法弄清楚用于沙箱的权利.

每当我使用

NSMutableArray *scanResults;
CWInterface *currentInterface = [CWInterface interface];
NSLog(@"currInterface: %@\n", currentInterface);
NSMutableDictionary *signalsDict = [[NSMutableDictionary alloc] init];
    NSError *err = nil;
    scanResults = [NSMutableSet setWithSet:[currentInterface scanForNetworksWithSSID:nil error:&err]];
Run Code Online (Sandbox Code Playgroud)

The operation couldn't be completed. (com.apple.coreWLAN.error error 1.)尽管在XCode中检查了所有权利,但我收到了错误.我遗失了哪些权利?

CoreWLANWirelessManager示例项目具有相同的问题.

objective-c corewlan osx-mountain-lion

5
推荐指数
1
解决办法
1450
查看次数

CoreWLAN或IOS 7的任何其他公共API

我正在寻找一种方法来从我的IOS-app扫描可用的Wi-Fi接入点(热点).

我所需要的只是热点名称的活动列表,设备可以连接到该列表.就像Safari在我们启动或激活它时显示Wi-Fi热点列表一样.

我想在App Store上发布应用程序,所以我不能使用任何类型的私有API(对吧?).不幸的是CoreWLAN.framework不适用于IOS(对吧?).

那么,有可能实现我的目标吗?我可以通过某种方式收集可用的接入点名称(SSID)吗?

api public objective-c ios corewlan

5
推荐指数
1
解决办法
1210
查看次数

在 OS X 中使用 Swift 显示所有可用的 WIFI 连接

我正在尝试显示所有可用的 WIFI 连接。它不起作用。这是我的代码:

import Foundation
import CoreWLAN

var cwInterface = CWInterface()

do {
    let routers = try cwInterface.scanForNetworksWithSSID(nil)
    print(routers)
} catch let error as NSError {
    print("Error: \(error.localizedDescription)")
}
Run Code Online (Sandbox Code Playgroud)

我没有得到任何结果。我做错了什么?

macos corewlan swift swift2

1
推荐指数
1
解决办法
2283
查看次数