Can I pair in vSP Mode with AT Interface Application
Is it possible to bond devices in vSP mode when using the AT Interface application.
In
order to enable the devices to pair and bond in vSP mode, when working
with the AT Interface sample application, you must make the initial
connection in non-vSP mode, using the command, AT+LCON
Once the devices have connected you can pair using the command, AT+PAIR hdlx
command to pair. The pairing will automatically be stored in the
bonding database., Then disconnect the devices and you can now reconnect
in vSP mode using the command ATD
See example with comments following // below:
ati 0 //Calls Device name
BL654
OK
ati 3 //Calls the firmware version on the module
29.5.7.2
OK
ati 4 //Calls the BT ADDR of the module
01F192652D3FB1
OK
ati 2009 //Calls number of devices in Bonding Database
0
OK
at+lcon 01D1C4A981E5E7 //Connects in non-vsp mode with specified BT ADDR
connect 1,01D1C4A981E5E7,15000,6000000,0
OK
at+pair 1 //Pairs with connection handle created when devices connected
OK
encrypt 1
PI:1, 0, 0, 5, 3
at+ldsc 1 //Disconnects the devices
OK
discon 1,22
ati 2009 //Confirms one device is stored in the bonding database
1
OK
at+bndt 01D1C4A981E5E7 //Confirms the BT_ADDR specified is bonded and stored in database
1,1,01D1C4A981E5E7
OK
atd 01D1C4A981E5E7 //Connects in vSP Mode (encrypted)
ENCRYPT
CONNECT 0, 01D1C4A981E5E7,15000,6000000,0