예제 #1
0
 static bool?ConvertToNullableBoolean(DOT11_RADIO_STATE source)
 {
     return(source switch
     {
         DOT11_RADIO_STATE.dot11_radio_state_on => true,
         DOT11_RADIO_STATE.dot11_radio_state_off => false,
         _ => (bool?)null,
     });
예제 #2
0
        private static bool TurnInterfaceRadio(Guid interfaceId, DOT11_RADIO_STATE radioState)
        {
            using (var client = new Base.WlanClient())
            {
                var phyRadioState = new WLAN_PHY_RADIO_STATE {
                    dot11SoftwareRadioState = radioState,
                };

                return(Base.SetPhyRadioState(client.Handle, interfaceId, phyRadioState));
            }
        }
예제 #3
0
        private static bool?ConvertToNullableBoolean(DOT11_RADIO_STATE source)
        {
            switch (source)
            {
            case DOT11_RADIO_STATE.dot11_radio_state_on:
                return(true);

            case DOT11_RADIO_STATE.dot11_radio_state_off:
                return(false);

            default:
                return(null);
            }
        }
예제 #4
0
        private void OnWlanSoftwareRadioStateChanged(object sender, DOT11_RADIO_STATE state)
        {
            switch (state)
            {
            case DOT11_RADIO_STATE.dot11_radio_state_unknown:
                Debug.WriteLine("dot11_radio_state_unknown");
                break;

            case DOT11_RADIO_STATE.dot11_radio_state_on:
                Debug.WriteLine("Software radio_state_on");
                break;

            case DOT11_RADIO_STATE.dot11_radio_state_off:
                Debug.WriteLine("Software radio_state_off");
                break;
            }
        }
예제 #5
0
        internal static bool TurnInterfaceRadio(Base.WlanClient client, Guid interfaceId, DOT11_RADIO_STATE radioState)
        {
            if (interfaceId == Guid.Empty)
            {
                throw new ArgumentException(nameof(interfaceId));
            }

            using (var container = new DisposableContainer <Base.WlanClient>(client))
            {
                var phyRadioState = new WLAN_PHY_RADIO_STATE {
                    dot11SoftwareRadioState = radioState,
                };

                return(Base.SetPhyRadioState(container.Content.Handle, interfaceId, phyRadioState));
            }
        }