Post not yet marked as solved
Post marked as unsolved with 1 replies, 289 views
Hello,
I try to get the WiFi SSID, from the iPhone, with the CNCopyCurrentNetworkInfo function. I become as interface "en0" and the error message:
[43481:8106022] [] nehelper sent invalid result code [1] for Wi-Fi information request
I don't no where is the problem. My function for the SSID request is this one:
for i in 0..<CFArrayGetCount(interface) {
let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interface, i)
print(interface)
let rec = unsafeBitCast(interfaceName, to: AnyObject.self)
if let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)" as CFString), let interfaceData = unsafeInterfaceData as? [String : AnyObject] {
// connected wifi
print("BSSID: \(interfaceData["BSSID"]), SSID: \(interfaceData["SSID"]), SSIDDATA: \(interfaceData["SSIDDATA"])")
} else {
// not connected wifi
}
}
}
if you have any idea where is my problem pleas help me.
With best regards
Niklas