23
www.lairdtech.com
Laird Technologies
BTM510/511
Bluetooth
®
Multimedia Module
AT Commands for Legacy Pairing
1. AT+BTW<bd_addr>
{Initiate Pairing}
Provided the remote device is a Bluetooth 2.0 device or earlier and legacy pairing is not disabled
(S323 = 0), this command is used to initiate legacy pairing with the device with <bd_addr>.
Legacy pairing refers to the mechanism of entering an identical PIN key on both ends.
If the PIN is required (if not set earlier by AT+BTK=”<PIN>”), asynchronous indications will be sent
to the host in the form PIN? <bd_addr> where the address confirms the device with which the pairing
is to be performed. To supply a PIN, use the AT+BTK command.
For a successful pairing, the link key is stored in a volatile cache which is overwritten every time a
new pairing is initiated using this command. If S register 325=1, the link key is automatically saved
to the non-volatile trusted device list. Otherwise (S325=0) the link key can be added to the trusted
device list by AT+BTT. Please refer to below under AT Commands managing Trusted Devices for
further AT commands related to trusted device list.
The “OK” response is sent immediately on receipt of the AT+BTW command. On pairing completion,
an unsolicited message will be sent to the host which will be in the form PAIR n <bd_addr>.
If AT+BTI or AT+BTP or AT+BTG or AT+BTQ or ATD is issued between the AT+BTW command and
the subsequent PAIR asynchronous response, then an ERROR response will be sent to those commands
as the device is not in a mode from where such commands can be actioned.
Response: <cr,lf>OK<cr,lf>
2. AT+BTK=”<string>”
{Set Passkey}
This command is used to provide a PIN passkey. The PIN is stored in non-volatile memory for future use.
If this command is used as response to a “PIN? 12345678” asynchronous message, the PIN provided by
this command will not be stored in non-volatile memory.
Specifying an empty string deletes the PIN from the non-volatile memory. The string length must be in
the range 0 to 8, otherwise an error will be returned.
Response: <cr,lf>OK<cr,lf>
3. Legacy Pairing – Asynchronous Messages
PIN?
This response is sent to the host during a pairing negotiation.
The fully qualified string is PIN? 012345678901 where 012345678901 is the Bluetooth address of the
peer device. In response, the host must supply a pin code which is entered using the AT+BTK command.
If the peer does not supply the address in the message exchange, then the address is specified as
000000000000 – and the pairing will proceed as normal.
PAIR n <bd_addr>
This response is sent to the host on termination of a pairing process. If pairing was successful then
‘n’ = 0, if a timeout occurred then ‘n’=1 and for all other unsuccessful outcomes the value will be 2.
The parameter <bd_addr> is the address of the peer device if available.
PAIR 0 <bd_addr> MM
This response is sent to the host on termination of a successful pairing process. The optional MM is
sent only if the according S Register 325..328 is set to 1 to automatically save the link key (see Section
2, page 82). The value MM indicates the result of the save operation and a value of 00 implies success,
otherwise the value corresponds to an error code.
AT COMMAND SET
REFERENCE