Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: yogeshtyagi on April 05, 2016, 11:47:31 AM

Title: How to get mac address of BT Adapter
Post by: yogeshtyagi 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
Title: Re: How to get mac address of BT Adapter
Post by: Mike Petrichenko on April 05, 2016, 12:27:38 PM
What is result code of GetAddress?
Title: Re: How to get mac address of BT Adapter
Post by: yogeshtyagi on April 05, 2016, 12:29:29 PM
13
Title: Re: How to get mac address of BT Adapter
Post by: Mike Petrichenko 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.
Title: Re: How to get mac address of BT Adapter
Post by: yogeshtyagi on April 05, 2016, 12:40:34 PM
could you please post sample code for calling wcl api
Title: Re: How to get mac address of BT Adapter
Post by: Mike Petrichenko 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();
Title: Re: How to get mac address of BT Adapter
Post by: yogeshtyagi on April 05, 2016, 03:38:08 PM
Thanks for Help :)
Title: Re: How to get mac address of BT Adapter
Post by: Mike Petrichenko on April 05, 2016, 04:05:53 PM
You are very welcome.