Bluetooth ?

SoyEli

Active Member
Licensed User
Longtime User
Hello :)

Can you give a example of how to find out if bluetooth is
paired and connected ?

Thank you:
 

SoyEli

Active Member
Licensed User
Longtime User
Hello :)

I tried the "Serial library" and it does list the paired bluetooth but
it does not tell me if it's connected.
I need to know if the bluetooth is connected before trying to connect.

Thank You:

Sub LookForBlue()
Dim PairedDevices As Map
Dim l As List
Dim res As Int
PairedDevices = Myblue.GetPairedDevices
l.Initialize
For i = 0 To PairedDevices.Size - 1
l.Add(PairedDevices.GetKeyAt(i)) 'add the friendly name to the list
Next
res = InputList(l, "Choose device", -1) 'show list with paired devices
If res <> DialogResponse.CANCEL Then
Myblue.Connect(PairedDevices.Get(l.Get(res)))
End If
Msgbox(Connected,"Blue")
End Sub
--------------------------------------
Sub MyBlue_Connected (Success As Boolean)
If Success Then
connected = True
Else
connected = False
End If
End Sub
 
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
Thank you for your reply :)

as you can see above:
I did that,
It shows " if bluetooth IsEnabled " and " Paird ", But is it connected ?

I'm trying to make a app where the " TTS " running in the background will tell me the callers phonenumber only if the blutooth is NOT CONNECTED else stay silent.

Thank you again for all your help :)
 
Upvote 0
Top