BTGetPaired$()


BTGetPaired$({delimiter$})

This function returns an array of strings containing all the paired Bluetooth devices. If no devices are paired a one element array will be returned with the value of "none". The strings returned contain the device name and address separated by delimiter$. If delimiter is not specified it defaults to a comma.


Example:


dim pairs$(0)
pairs$() = BTGetPaired$()

If pairs$(0) = "none" Then
Print "No paired devices found"
End
Endif

List pairs$(), device$
name$ = ItemExtract$(device$, 0)
address$ = ItemExtract$(device$, 1)



Screenshot from above code



The following code will give a better looking paired device list.


Dim Pairs$(0)

pairs$()=BTGetPaired$("\n")

If pairs$(0) = "none" Then
Print "No paired devices found"
End
Endif

TextAlign 0
TextSize 18
TextColorA 0,100,0

List pairs$(), device$

name$ = ItemExtract$(device$, 0, "\n")
address$ = ItemExtract$(device$, 1, "\n")



Screenshot from above code



Bluetooth On|Off


Bluetooth device pairing


BTClose


BTConnect


BTDiscoverable


BTGetAddress$()


BTGetError$()


BTGetName$()


BTGetSize()


BTGetState()


BTListen


BTRead$()


BTRead


BTReadln


BTReadUTF


BTWrite


BTWriteln


BTWriteUTF







Become a Patron