/// <summary> /// Calls WiFiManager.GetFoundAPs() to get scan result and return a list /// that contains Wi-Fi AP information /// </summary> /// <returns>APInfo list with scan results</returns> public List <APInfo> ScanResult() { Logger.Log("ScanResult()"); try { _apList = WiFiManager.GetFoundAPs(); List <APInfo> apInfoList = new List <APInfo>(); foreach (var item in _apList) { apInfoList.Add(new APInfo { Name = item.NetworkInformation.Essid, State = item.NetworkInformation.ConnectionState.ToString(), }); } return(apInfoList); } catch (Exception e) { Logger.Log(e.ToString()); return(null); } }
public void init() { this.wlanManager = new WiFiManager(); this.wlanManager.HostedNetworkAvailable += new EventHandler(wlanManager_HostedNetworkAvailable); this.wlanManager.HostedNetworkUnavailable += new EventHandler(wlanManager_HostedNetworkUnavailable); this.wlanManager.HostedNetworkStarted += new EventHandler(wlanManager_HostedNetworkStarted); this.wlanManager.StationJoin += new EventHandler <WiFiManager.EventStationJoin>(wlanManager_StationJoin); this.wlanManager.StationLeave += new EventHandler <WiFiManager.EventStationLeave>(wlanManager_StationLeave); }
/// <summary> /// Checks if info about given Access Point is stored in /// Wi-Fi Configurations /// </summary> /// <param name="apName">Access Point name</param> /// <returns>True if Access Point is stored, false otherwise</returns> public bool IsAPInfoStored(string apName) { try { var configurations = WiFiManager.GetWiFiConfigurations(); return(configurations.Any(c => c.Name == apName)); } catch (Exception e) { return(false); } }
/// <summary> /// Call WiFiManager.GetFoundAPs() to get scan result and return a list that contains Wi-Fi AP information /// </summary> /// <returns>scan result by a list of Wi-Fi AP information</returns> public List <APInfo> ScanResult() { LogImplementation.DLog("ScanResult()"); try { // Call Tizen C# API apList = WiFiManager.GetFoundAPs(); // return a list that contains Wi-Fi ESSID return(GetAPList()); } catch (Exception e) { LogImplementation.DLog(e.ToString()); } return(null); }
/// <summary> /// Call WiFiManager.DeactivateAsync() to turn off Wi-Fi interface /// </summary> /// <returns>Task to do DeactivateAsync</returns> public Task Deactivate() { LogImplementation.DLog("Deactivate()"); // Call Tizen C# API return(WiFiManager.DeactivateAsync()); }
/// <summary> /// Call WiFiManager.ScanAsync() to scan /// </summary> /// <returns>Task to do ScanAsync</returns> public Task Scan() { LogImplementation.DLog("Scan()"); // Call Tizen C# API return(WiFiManager.ScanAsync()); }
/// <summary> /// Get the ESSID of the AP that this device is connected to /// </summary> /// <returns>ESSID of the connected Wi-Fi AP</returns> public String ConnectedAP() { // Call Tizen C# API return(WiFiManager.GetConnectedAP().NetworkInformation.Essid); }
/// <summary> /// Call WiFiManager.ActivateAsync() to turn on Wi-Fi interface /// </summary> /// <returns>Task to do ActivateAsync</returns> public async Task Activate() { LogImplementation.DLog("Activate()"); // Call Tizen C# API await WiFiManager.ActivateAsync(); }
void wlanManager_StationLeave(object sender, WiFiManager.EventStationLeave e) { if (Peers.ContainsKey(e.MACAddress)) Peers[e.MACAddress].leaveWiFi(); }
public void init() { this.wlanManager = new WiFiManager(); this.wlanManager.HostedNetworkAvailable += new EventHandler(wlanManager_HostedNetworkAvailable); this.wlanManager.HostedNetworkUnavailable += new EventHandler(wlanManager_HostedNetworkUnavailable); this.wlanManager.HostedNetworkStarted += new EventHandler(wlanManager_HostedNetworkStarted); this.wlanManager.StationJoin += new EventHandler<WiFiManager.EventStationJoin>(wlanManager_StationJoin); this.wlanManager.StationLeave += new EventHandler<WiFiManager.EventStationLeave>(wlanManager_StationLeave); }
/// <summary> /// Calls WiFiManager.DeactivateAsync() to turn off Wi-Fi interface /// </summary> /// <returns>Task to do DeactivateAsync</returns> public Task Deactivate() { return(WiFiManager.DeactivateAsync()); }
void wlanManager_StationJoin(object sender, WiFiManager.EventStationJoin e) { if (!Peers.ContainsKey(e.pStation.MacAddress)) Peers.Add(e.pStation.MacAddress, new NetworkPeerService()); Peers[e.pStation.MacAddress].updateWiFi(e.pStation); }
/// <summary> /// Calls WiFiManager.ScanAsync() to scan for APs /// </summary> /// <returns>Task to do ScanAsync</returns> public Task Scan() { Logger.Log("Scan()"); return(WiFiManager.ScanAsync()); }
/// <summary> /// Calls WiFiManager.ActivateAsync() to turn on Wi-Fi interface /// </summary> /// <returns>Task to do ActivateAsync</returns> public async Task Activate() { await WiFiManager.ActivateAsync(); }
/// <summary> /// Calls WiFiManager.DeactivateAsync() to turn off Wi-Fi interface /// </summary> /// <returns>Task to do DeactivateAsync</returns> public Task Deactivate() { Logger.Log("Deactivate()"); return(WiFiManager.DeactivateAsync()); }
/// <summary> /// Calls WiFiManager.ActivateAsync() to turn on Wi-Fi interface /// </summary> /// <returns>Task to do ActivateAsync</returns> public async Task Activate() { Logger.Log("Activate()"); await WiFiManager.ActivateAsync(); }
/// <summary> /// Gets the ESSID of the AP device is connected to /// </summary> /// <returns>ESSID of the connected Wi-Fi AP</returns> public string ConnectedAP() { return(WiFiManager.GetConnectedAP()?.NetworkInformation.Essid ?? null); }
/// <summary> /// Gets the currently connected AP /// </summary> public void GetConnectedAP() { currentAP = WiFiManager.GetConnectedAP(); }
/// <summary> /// Calls WiFiManager.ScanAsync() to scan for APs /// </summary> /// <returns>Task to do ScanAsync</returns> public Task Scan() { return(WiFiManager.ScanAsync()); }