Geeks With Blogs

WinToolZone - Spelunking Microsoft Technologies
I work as a developer on the Common Language Runtime (CLR) team, specifically in the areas of exception handling and CLR hosting.

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Inside and Out... An attempt to understand technology better...

[Originally posted on 6th July 2006]

WinToolZone.Bluetooth, the managed Bluetooth API for the desktop that I am working on, now has the support for enumerating devices as well. The snippet below exemplifies it:

   1:  Bluetooth bth = new Bluetooth();
   3:      // EnumRadios(bth);
   5:      if (bth.RefreshDevices(false, true, true, true, true, null) == false)
   6:      {
   7:           Console.WriteLine("Unable to enum devices");
   8:           return;
   9:      }
  11:      foreach (BluetoothDevice device in bth.Devices)
  12:      {
  13:           Console.WriteLine("Devicename: {0}", device.Name);
  14:           Console.WriteLine("LastSeen: {0}", device.LastSeen.ToString());
  15:           Console.WriteLine("LastUsed: {0}", device.LastUsed.ToString());
  16:           Console.WriteLine("Connected: {0}", device.IsConnected.ToString());
  17:           Console.WriteLine("Remembered: {0}", device.IsRemembered.ToString());
  18:           Console.WriteLine("Authenticated: {0}", device.IsAuthenticated.ToString());
  19:           Console.WriteLine("DeviceClass: {0}", device.DeviceClassID);
  20:           Console.WriteLine("Address: {0}\n", device.Address.ToString());
  22:      }

And below is an output screenshot:

Bluetooth device enumeration output using WinToolZone.Bluetooth Posted on Thursday, March 29, 2007 2:39 PM .NET Framework , Embedded Development , Development | Back to top

Comments on this post: WinToolZone.Bluetooth - Added device enumeration support

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Gaurav Khanna | Powered by: