Post

Replies

Boosts

Views

Activity

Reply to is there any way to find the "guest wifi network" connected?
import Cocoa import CoreWLAN class Discovery { var currentInterface: CWInterface var interfacesNames: [String] = [] var networks: Set = [] // Failable init using default interface init?() { if let defaultInterface = CWWiFiClient.shared().interface(), let name = defaultInterface.interfaceName { self.currentInterface = defaultInterface self.interfacesNames.append(name) self.findNetworks() } else { return nil } } // Init with the literal interface name, like "en1" init(interfaceWithName name: String) { self.currentInterface = CWInterface(interfaceName: name) self.interfacesNames.append(name) self.findNetworks() } // Fetch detectable WIFI networks func findNetworks() { do { self.networks = try currentInterface.scanForNetworks(withSSID: nil) } catch let error as NSError { print("Error: \(error.localizedDescription)") } } // Fetch current connected wifi network func getCurrentConnectedWifiNetwork() -> [String: Any] { var currentNetwork: [String: Any] = [:] currentNetwork["ssid"] = currentInterface.ssid() currentNetwork["security"] = currentInterface.security().rawValue currentNetwork["channelNumber"] = currentInterface.wlanChannel()?.channelNumber currentNetwork["IPAddress"] = getIPAddress(interfaceName: currentInterface.interfaceName!) currentNetwork["rssi"] = currentInterface.rssiValue() return currentNetwork }I have created the "Discovery" class to get the connected wifi network details (SSID, Security, Channel Number, IPAddress, RSSI) and From viewController calling the below function.if let discoveryObject = Discovery() { let currentConnectedWifi = discoveryObject.getCurrentConnectedWifiNetwork() print("\nConnected wifi network: \n\n\(currentConnectedWifi)\n") }The console log for the network "NETGEAR10" (not a guest wifi network)["channelNumber": 13, "IPAddress": "192.168.1.4", "security": 4, "ssid": "NETGEAR10", "rssi": -36]Now, created a guest wifi network name as "NETGEAR_Guest" and the details are,["rssi": -38, "channelNumber": 13, "ssid": "NETGEAR_Guest", "security": 4, "IPAddress": "192.168.1.4"]I need to know what exact metadata is available to identify the guest network in CoreWLAN andhelp is much needed. Thank you.
Feb ’20
Reply to is there any way to find the "guest wifi network" connected?
What do you mean by “guest network”?Let me tell you in detail, I have logged into a "Netgear" router (via router address 192.168.1.1) and Click on Guest network Enable guest network - Enable SSID Broadcast - Click on apply. Now, the network "NETGEAR_Guest" is created.I will connect my mac to "NETGEAR_Guest" .So I want to know the currently connected network is Guest network or other network. I tried with CoreWLAN framework but i don't see any parameter that defines the network type as i explained earlier.Is this possible? Please let me know.
Feb ’20
Reply to How to check if my network connected to mobile hotspot as Wifi
I appreciate your reply Meaton.Yes, NWPathMonitor delegates whenver the network status changes and it works in iOS.I have created a Cocoa(macOS) application and using NWPathMonitor, is it possible to get to know when MacBook Air WiFi connected to my cellular network via hotspot enabled.My Cocoa app should identify whenever the network connected via Wi-Fi or via Celluar (hotspot enabled) network.let monitor = NWPathMonitor(requiredInterfaceType: .wifi) let queue = DispatchQueue.global(qos: .background) monitor.start(queue: queue) monitor.pathUpdateHandler = { path in if path.status == .satisfied { print("Connected") } }if i change the requiredInterfaceType as ".cellular". am not getting the path.status as .satisfied. It always says interface type as .wifi even if i connected via cellular hotspot.
Feb ’20