User guide

6. Pairing and Trusted Devices
When authentication is enabled via S register 500 or when using the ‘u’ modifier in the ATD and
AT+BTP commands, a connection attempt will require a link key for the peer device. The link key
can be obtained prior to connection by invoking the AT+BTW and AT+BTK commands. A new link
key can be obtained as often as required and is stored in a volatile cache. At any time, this cached
link key can be added to the trusted devices database using the AT+BTT command. A trusted
device can be deleted using the AT+BTD command. To view a list of trusted device issue the
command AT+BTT?.
In addition, if S Register 538 is set to 1, then on a successful pairing, the link key will be
automatically saved to the trusted device database. In that case, the asynchronous
message PAIR 0 <bd_addr> has an error code appended at the end to convey the result
of the save operation.
When a connection attempt requires a link key, the trusted device database will be searched
automatically and if one exists will be provided without host interaction. If the link key is not
present, then the connection attempt will be terminated and a NO CARRIER response will be given
to the ATD command.
A typical session to pair, say an Ericsson T68i, to a serial module would be:
Make the T68i discoverable and send AT+BTI to the serial module. This will result in
inquiry responses from all devices. Make a note of the Bluetooth address of the phone e.g.
123456789012
On the T68i start pairing procedure by selecting “Phone accepts” in the relevant Bluetooth
menu.
Send command AT+BTW123456789012 to the serial module
Confirm that you get an OK response and then PIN? responses on a 2 second interval.
Enter a pin code on the phone. Say it is 12345768
Then enter the command AT+BTK=”12345678”.
The phone will confirm success and likewise the serial module will respond with OK
On success the serial module will send an unsolicited message in the form of PAIR 0
<bd_addr>
Send AT+BTT to the serial module so that the pairing information is stored in the non-
volatile database.
Confirm that the link key has been stored by sending the command AT+BTT?. This will
result in a list of all devices paired with the module.
If two EZURiO devices need to be paired, then it can be accomplished as follows:-
To device 1 send ATI4, it will respond with the local Bluetooth address. E.g. 123456789001
To device 1 send AT+BTP. It will become discoverable and connectable.
To device 2 send AT+BTW123456789001 and it will respond with OK
Then on both devices you will see PIN? asynchronous responses
To both modules send AT+BTK=”12345678”
On success the serial module will send an unsolicited message in the form of PAIR 0
<bd_addr>
The pairing link key, is at this stage, in volatile memory, so send AT+BTT to both.
The two units now have pairing information which will survive a power cycle.
DSH_50003_v1v3 AT Command Reference 29 of 33