I was working on to Enable/Disable it Wifi on Motorola MC17 device. After some effort I found the solution to enable/Disable it wifi Radio. I am Using Symbol.Fusion dll to get toggle wifi radio. there are some other ways also to Like P/invoke with .NET etc. Here I will put both ways . You can take the reference of that. Here I am putting source code for your reference.
- public class WiFiRadio
- {
- WLAN myCommandModeWlan = null;
- public WiFiRadio()
- {
- InitializeWiFi();
- }
- public void InitializeWiFi()
- {
- try
- {
- myCommandModeWlan = new WLAN(FusionAccessType.COMMAND_MODE);
- }
- catch (OperationFailureException ex)
- {
- System.Windows.Forms.MessageBox.Show("Command mode is in use", "WiFiMgr");
- }
- }
- public void ToggleWiFi(bool enableWiFi)
- {
- try
- {
- if (myCommandModeWlan != null)
- {
- if (enableWiFi)
- {
- myCommandModeWlan.Adapters[0].PowerState = Adapter.PowerStates.ON;
- }
- else
- {
- myCommandModeWlan.Adapters[0].PowerState = Adapter.PowerStates.OFF;
- }
-
- }
-
- }
- catch (OperationFailureException ex)
- {
- System.Windows.Forms.MessageBox.Show("Command mode is in use", "WiFiMgr");
- }
- }
- public bool GetCurrentStatus()
- {
- if (myCommandModeWlan.Adapters[0].PowerState == Adapter.PowerStates.ON)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
Note: You Need To Take The Reference Of Symbol.fusion dll.