有没有办法在不使用shell脚本的情况下检索活动/非活动网络连接? CWInterface仅提供有关WiFi网络的信息,而OS X上不提供CNCopyCurrentNetworkInfo。
答案 0 :(得分:1)
CWInterface* wifi = [[CWWiFiClient sharedWiFiClient] interface];
int secType = (int)[wifi security];
int channel = (int) [[wifi wlanChannel] channelNumber];
int rssi = [wifi rssiValue];
NSString *ssid = [wifi ssid];
NSString *bssid = [wifi bssid];