Inside and Out...

An attempt to understand technology better...

  Home  |   Contact  |   Syndication    |   Login
  160 Posts | 0 Stories | 12 Comments | 181 Trackbacks

News


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.
Disclaimer

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.

Twitter





Tag Cloud


Archives

Post Categories

Image Galleries

Links

[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();
   2:              
   3:      // EnumRadios(bth);
   4:   
   5:      if (bth.RefreshDevices(false, true, true, true, true, null) == false)
   6:      {
   7:           Console.WriteLine("Unable to enum devices");
   8:           return;
   9:      }
  10:   
  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());
  21:                  
  22:      }

And below is an output screenshot:

Bluetooth device enumeration output using WinToolZone.Bluetooth
posted on Thursday, March 29, 2007 2:39 PM
Comments have been closed on this topic.