示例#1
0
        public WLAN_OPCODE_VALUE_TYPE QueryConnectionSettings(out string hostedNetworkSSID, out int maxNumberOfPeers)
        {
            wlanProperty <WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS> prop = new wlanProperty <WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS>(this._WlanHandle);
            WLAN_OPCODE_VALUE_TYPE opcode;
            var settings = prop.get(WLAN_HOSTED_NETWORK_OPCODE.wlan_hosted_network_opcode_connection_settings, out opcode);

            hostedNetworkSSID = settings.hostedNetworkSSID.ConvertToString();

            maxNumberOfPeers = (int)settings.dwMaxNumberOfPeers;
            return(opcode);
        }
示例#2
0
        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);
        }
示例#3
0
        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();
            }
        }