Inside and Out…

An attempt to understand technology better…

WinToolZone.Bluetooth – Managed Bluetooth API for the desktop

Posted by Gaurav Khanna on July 5, 2006

One of the communication protocols not present in .NET Framework class libraries is Bluetooth. So today, I started to work on my implementation of a managed API for Bluetooth programming – WinToolZone.Bluetooth. I am authoring it using Managed C++ and leveraging the Microsoft Bluetooth stack APIs.

I just completed implementing the support for enumerating the Bluetooth radios on a machine. Below is a C# program that exemplifies how they can be enumerated:

using System;
using System.Collections.Generic;
using System.Text;
using WinToolZone;

namespace BTHCSClient
{
    class Program
    {
        static void Main(string[] args)
        {
            Bluetooth bth = new Bluetooth();
            if (bth.RefreshRadios())
            {
                foreach (BluetoothRadio radio in bth.Radios)
                {
                    Console.WriteLine("RadioName: {0}", radio.Name);
                    Console.WriteLine("Address: {0}", radio.Address.ToString());
                    Console.WriteLine("ManuID: {0}", radio.ManufacturerID);
                    Console.WriteLine("LMPSubversion: {0}", radio.LMPSubversion);
                    Console.WriteLine("DeviceClass: {0}", radio.DeviceClass);
                }
            }
            else
            {
                Console.WriteLine("Unable to enumerate BTH radios");
            }
        }
    }
}

Technorati : , , , , , ,
Del.icio.us : , , , , , ,
Buzznet : , , , , , ,
43 Things : , , , , , ,

Advertisements

One Response to “WinToolZone.Bluetooth – Managed Bluetooth API for the desktop”

  1. […] Blocked 0 spam comments blocked byAkismet « WinToolZone.Bluetooth – Managed Bluetooth API for the desktop Lessons in Exception Handling […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: