User's Manual

Class 1 Bluetooth v2.0 Module
User’s Guide
Americas: +1-800-492-2320 Option 2
Europe: +44-1628-858-940
Hong Kong: +852-2923-0610
www.lairdtech.com/bluetooth
52
One mode allows for a connection to be dropped using either method; the other mode allows for a
connection drop using the DTR method only. By default, the device is in the former mode. This mode is
selected using the S507 register. See 錯誤! 不到參照來源。 for more information on S Registers.
To reiterate, the escape sequence is as follows:
<Guard time><Esc Chr><Guard time><Esc Chr><Guard time><Esc Chr><Guard time>
Even when a file transfer is occurring and it happens to be full of <Esc Chr> characters, it is not going to
drop into command mode because, when transferring a file, it is going to occur as fast as possible; this
means that the inter character gap is going to be significantly shorter than the <Guard time>.
The <Esc Chr> character can be changed via the S2 register and the <Guard time> interval can be
specified via the S12 register.
6.7 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 requires 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 is 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 is searched automatically
and if one exists, it is provided without host interaction. If the link key is not present, then the connection
attempt is terminated and a NO CARRIER response is given to the ATD command.
A typical session to pair an Ericsson T68i (for example) to a serial module would be:
1. Make the T68i discoverable and send AT+BTI to the serial module. This results in inquiry
responses from all devices. Make a note of the Bluetooth address of the phone e.g. 123456789012.
2. On the T68i start pairing procedure by selecting “Phone accepts” in the relevant Bluetooth menu.
3. Send command AT+BTW123456789012 to the serial module.
4. Confirm that you get an OK response and then PIN? responds on a two second interval.
5. Enter a pin code on the phone (such as 12345768).
6. Enter the command AT+BTK=”12345678”.
The phone confirms success and likewise the serial module responds with OK.
7. On success, the serial module sends an unsolicited message in the form of PAIR 0 <bd_addr>.
8. Send AT+BTT to the serial module so that the pairing information is stored in the non-volatile
database.
9. Confirm that the link key has been stored by sending the command AT+BTT?. This results in a list
of all devices paired with the module.
If two Laird devices need to be paired, then it can be accomplished as follows:
To device 1 send ATI4, it responds with the local Bluetooth address (e.g., 123456789001).
To device 1 send AT+BTP. It becomes discoverable and connectable.
To device 2 send AT+BTW123456789001 and it responds with OK.
Both devices display PIN? asynchronous responses.
To both modules. send AT+BTK=”12345678.