Search code examples
c#.netbluetooth32feet

c# Bluetooth Mac Address of our Adapter


I am using IntheHand 32feet library http://32feet.codeplex.com/ I am searching for a code to get local MAC Address of Bluetooth Adapter . I have tried may quick tweaks but not worked like

using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;

and

          BluetoothListener btListener;
btListener.Server.AddressFamily.ToString(); 

but doesn't work. Please suggest the way I can get the address


Solution

  • https://32feet.codeplex.com/wikipage?title=Local%20Radio%20Information

    BluetoothRadio myRadio = BluetoothRadio.PrimaryRadio;
    if (myRadio == null) {
        Console.WriteLine("No radio hardware or unsupported software stack");
        return;
    }
    RadioMode mode = myRadio.Mode;
    // Warning: LocalAddress is null if the radio is powered-off.
    Console.WriteLine("* Radio, address: {0:C}", myRadio.LocalAddress);