Wireless Communication Library Support Forum
Frameworks => Bluetooth Framework => Topic started by: TcomGregg on December 01, 2008, 01:56:26 PM
-
We would like to use the same adapter (Radio) each ad every time and discover a single device and get its information.
Will the VB sub routine below accomplish this?
Private Sub DeviceDiscovery()
Dim RAddress AS String = "(00:11:E0:03:15:8B)" '***Adapter MAC Address
Dim RName AS String = "TrendNet Adapter" '***Adapter Name
Dim Radio AS wclnet.wclBluetoothRadio = RName & "," & RAddress '***Builds Radio String
'****Start of Device Discovery
Try
wclBluetoothDiscovery.Discovery(Radio)
Finally
End Try
Dim DName AS String = "" '***Device Name
'****Get Device Information
Try
DName = Device.Name(Radio)
Catch ex As Exception
DName = ex.Message
End Try
Dim DAddress AS String = "" '***Device Address
Try
DAddress = Device.Address(Radio)
Catch ex AS Exception
DAddress = ex.Message
End Try
End Sub
Thank You
Gregg
-
You should read device's information (line Name and other things) inside OnDiscoveryComplete event handler (when you have devices discovered).
If you need to use the same adapter always you need to know the API used by it. Then you can create the Radio object and use it in your application.
But the better way is to enumerate radios and the check is required radio exists in the list. Also it is good idea to monitor AfterLoad/AfterUnload/OnChanged events of the wclAPI component becasue dongle can be removed or turned off.