public WLAN_HOSTED_NETWORK_REASON SetConnectionSettings(string hostedNetworkSSID, int maxNumberOfPeers) { WLAN_HOSTED_NETWORK_REASON failReason; WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS settings = new WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS(); settings.hostedNetworkSSID = WiFiUtils.ConvertStringToDOT11_SSID(hostedNetworkSSID); settings.dwMaxNumberOfPeers = (uint)maxNumberOfPeers; wlanProperty <WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS> prop = new wlanProperty <WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS>(this._WlanHandle); prop.set(WLAN_HOSTED_NETWORK_OPCODE.wlan_hosted_network_opcode_connection_settings, settings, out failReason); return(failReason); }
public void enableHosted() { wlanProperty <bool> prop = new wlanProperty <bool>(this._WlanHandle); // if (!prop.get(WLAN_HOSTED_NETWORK_OPCODE.wlan_hosted_network_opcode_enable)) if (this._HostedNetworkState == WLAN_HOSTED_NETWORK_STATE.wlan_hosted_network_unavailable) { Trace.TraceInformation("WiFi AdHoc Enabling"); prop.set(WLAN_HOSTED_NETWORK_OPCODE.wlan_hosted_network_opcode_enable, true); } else { onHostedNetworkAvailable(); } }