Esempio n. 1
0
 internal WirelessDevice(WirelessManager parent, RDD info)
 {
     this.parent = parent;
     this.type   = info.DeviceType;
     deviceName  = info.pszDeviceName;
     displayName = info.pszDisplayName;
     this.state  = info.dwState;
 }
Esempio n. 2
0
        internal int SetWirelessState(WirelessDeviceType type, WirelessState state)
        {
            int    stateResult = -1;
            IntPtr devList;
            int    result = GetWirelessDevices(out devList, 0);
            IntPtr pThis  = devList;

            while (pThis != IntPtr.Zero)
            {
                RDD r = (RDD)Marshal.PtrToStructure(pThis, typeof(RDD));

                if (r.DeviceType == type)
                {
                    stateResult = ChangeRadioState(pThis, state, SAVEACTION.RADIODEVICES_PRE_SAVE);
                }

                pThis = r.pNext;
            }

            result = FreeDeviceList(devList);
            return(stateResult);
        }