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

Offline yogeshtyagi

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
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: 3055
  • Karma: 1000
    • Soft Service Company
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?

Offline yogeshtyagi

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
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: 3055
  • Karma: 1000
    • Soft Service Company
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.

Offline yogeshtyagi

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
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: 3055
  • Karma: 1000
    • Soft Service Company
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();

Offline yogeshtyagi

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
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: 3055
  • Karma: 1000
    • Soft Service Company
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 8 9