WiFi Radio Toggle in smart device (Symbol.Fusion dll)

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.

  1. public class WiFiRadio    
  2. {    
  3.     WLAN myCommandModeWlan = null;    
  4.     public WiFiRadio()    
  5.     {    
  6.         InitializeWiFi();    
  7.     }    
  8.     public void InitializeWiFi()    
  9.     {    
  10.         try    
  11.         {    
  12.             myCommandModeWlan = new WLAN(FusionAccessType.COMMAND_MODE);    
  13.         }    
  14.         catch (OperationFailureException ex)    
  15.         {    
  16.             System.Windows.Forms.MessageBox.Show("Command mode is in use""WiFiMgr");    
  17.         }    
  18.     }    
  19.     public void ToggleWiFi(bool enableWiFi)    
  20.     {    
  21.         try    
  22.         {    
  23.             if (myCommandModeWlan != null)    
  24.             {    
  25.                 if (enableWiFi)    
  26.                 {    
  27.                     myCommandModeWlan.Adapters[0].PowerState = Adapter.PowerStates.ON;    
  28.                 }    
  29.                 else    
  30.                 {    
  31.                     myCommandModeWlan.Adapters[0].PowerState = Adapter.PowerStates.OFF;    
  32.                 }    
  33.     
  34.             }    
  35.     
  36.         }    
  37.         catch (OperationFailureException ex)    
  38.         {    
  39.             System.Windows.Forms.MessageBox.Show("Command mode is in use""WiFiMgr");    
  40.         }    
  41.     }    
  42.     public bool GetCurrentStatus()    
  43.     {    
  44.         if (myCommandModeWlan.Adapters[0].PowerState == Adapter.PowerStates.ON)    
  45.         {    
  46.             return true;    
  47.         }    
  48.         else    
  49.         {    
  50.             return false;    
  51.         }    
  52.     }    
  53. }    
Note: You Need To Take The Reference Of Symbol.fusion dll.

 

Next Recommended Reading How to Find CLSID of a DLL