Paul
Tue Aug 23 10:29:48 CDT 2005
In the WiFi case, you'd have to get the collection of known adapters, then
check the IsWireless property. I can't guarantee that this will indicate
that something is WiFi, or that every WiFi adapter will indicate this as
true (particularly if Wireless Zero Config is not supported by the driver),
but it's as good as you're going to do.
Paul T.
"Peter Foot [MVP]" <feedback@nospam-inthehand.com> wrote in message
news:OICfOG%23pFHA.2696@TK2MSFTNGP09.phx.gbl...
> If your devices are Windows Mobile devices then IrDA support is a
> mandatory part of the platform spec so all devices will support it. For
> generic CE devices you could search the installed drivers in the
> registry - HKLM\Drivers\BuiltIn\IrCOMM
>
> Bluetooth is slightly mroe complicated since the device may have either
> Microsoft's own stack, or a third-party one or none at all. The MS stack
> exposes the method
>
> [DllImport("Btdrt.dll", SetLastError=true)]
>
> public static extern int BthGetHardwareStatus(ref HardwareStatus
> pistatus);
>
> /// <summary>
>
> /// Specifies the current status of the Bluetooth hardware.
>
> /// </summary>
>
> public enum HardwareStatus : int
>
> {
>
> /// <summary>
>
> /// Status cannot be determined.
>
> /// </summary>
>
> Unknown = 0,
>
> /// <summary>
>
> /// Bluetooth radio not present.
>
> /// </summary>
>
> NotPresent = 1,
>
> /// <summary>
>
> /// Bluetooth radio is in the process of starting up.
>
> /// </summary>
>
> Initializing = 2,
>
> /// <summary>
>
> /// Bluetooth radio is active.
>
> /// </summary>
>
> Running = 3,
>
> /// <summary>
>
> /// Bluetooth radio is in the process of shutting down.
>
> /// </summary>
>
> Shutdown = 4,
>
> /// <summary>
>
> /// Bluetooth radio is in an error state.
>
> /// </summary>
>
> Error = 5,
>
> }
>
>
>
> Which will return NotPresent if the stack is available but bluetooth radio
> is not. Broadcom stack is notitorious for having poor support for Radio
> control with their APIs, some OEMs such as HP provide their own API for
> controlling the radio state:-
>
>
http://www.peterfoot.net/ToggleBluetoothOnAnIPaqDevice.aspx
>
> In theory calling this function on an iPaq without Bluetooth should give
> you a trappable error code, but I don't have a device to try on myself.
>
>
>
> WiFi is yet another kettle of fish. The OpenNETCF SDF
> (www.opennetcf.org/sdf/) has Adapter and AdapterCollection classes which
> provide access to network adapters, you can also grab the source from
> vault.netcf.tv (username guest, password guest)
>
> Peter
>
>
> --
> Peter Foot
> Windows Embedded MVP
>
http://www.inthehand.com |
http://www.peterfoot.net |
>
http://www.opennetcf.org
>
>
>
> "Miguel" <miguelsanders@telenet.be> wrote in message
> news:1124788163.073555.22290@o13g2000cwo.googlegroups.com...
>> Is there a way to programmatically obtain the presence of Infrared /
>> Bluetooth and Wifi.
>> I simply want to know whether these features are available, not doing
>> magical stuff with them :)
>>
>> Regards
>>
>> Miguel
>>
>
>