Author Topic: How to get mac address of BT Adapter  (Read 14641 times)

yogeshtyagi

  • Guest
How to get mac address of BT Adapter
« on: April 05, 2016, 11:47:31 AM »
Hi,
  I am trying to get mac address of BT Adapter


   using (var radios = new wclBluetoothRadios())
            {
                var dis = new wclBluetoothDiscovery();
                dis.EnumRadios(radios);
                if (radios.Count > 0)
                {
                    var Radio = radios[0];
                    string bbc = string.Empty;
                    var abc = Radio.GetAddress(ref bbc);
                }
                return null;
            }

but it return empty string, Please help me

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: How to get mac address of BT Adapter
« Reply #1 on: April 05, 2016, 12:27:38 PM »
What is result code of GetAddress?

yogeshtyagi

  • Guest
Re: How to get mac address of BT Adapter
« Reply #2 on: April 05, 2016, 12:29:29 PM »
13

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: How to get mac address of BT Adapter
« Reply #3 on: April 05, 2016, 12:31:18 PM »
That means WCL_E_TRANSPORT_NOT_AVAILABLE - there is no supported Bluetooth API. Probably you did not call wclAPI.Load.

yogeshtyagi

  • Guest
Re: How to get mac address of BT Adapter
« Reply #4 on: April 05, 2016, 12:40:34 PM »
could you please post sample code for calling wcl api

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: How to get mac address of BT Adapter
« Reply #5 on: April 05, 2016, 12:42:49 PM »
The demo code is available in APIDemo and BluetoothDiscoveryDemo applications. Both use wclAPI.Load and wclAPI.Unload (which are required).

In few word any application uses WCL must have wclAPI class instance which shouldbe initialized before any WCL usage

private
  wclAPI API;

FormLoad
  API.Load();

when you finished usiing WCL (usualy in FormClose) call

API.Unload();

yogeshtyagi

  • Guest
Re: How to get mac address of BT Adapter
« Reply #6 on: April 05, 2016, 03:38:08 PM »
Thanks for Help :)

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: How to get mac address of BT Adapter
« Reply #7 on: April 05, 2016, 04:05:53 PM »
You are very welcome.

 

Sitemap 1 2 3 4 5 6 7