User's Manual

Enhanced Class 1 Bluetooth v2.1 Module
User’s Guide
Americas: +1-800-492-2320 Option 2
Europe: +44-1628-858-940
Hong Kong: +852-2923-0610
www.lairdtech.com/wireless
152
CONN-GUIDE-BT740_v0.2
14 AT APPLICATION EXAMPLES
14.1 Connection Management
Commands ATD, ATA, ATH, AT+BTP, and AT+BTG are all connection related and are discussed
generically in this section.
On connection, depending on the value of S Register 531, the module enters data pass through mode (S
Reg 531 = 0) or remains in command mode (S Reg 531 > 0).
In pass through mode, any data received from the host passes to the transmit buffer of the RF connection;
in the case of SPP (UUID=1101) and for all other profiles, it depends on whether a ‘canned’ mode is
provided. Data coming from the remote sends out to the host transparently even in canned mode.
A ‘canned’ mode, which exists for HID profile, is where the incoming character from the host translates
into appropriate multi-byte packets expected by the peer. For example, with HID standard keyboard
profile where each key press results in an 8 byte HID INPUT report to the host, the ASCII character
appropriately expands into the relevant 8 bytes denoting that the key was pressed and then immediately
another 8 byte report denotes that the same key was unpressed.
If a canned mode is not available for a profile, then module is not allowed to get into pass-through mode.
In command and online mode, the command ATX”data” forces the module to send data and conversely
any incoming data presents to the host in an RX”data” asynchronous response.
14.1.1 Incoming Connections
The module can be configured using the AT+BTP or AT+BTG command so that it scans for incoming
connections from other Bluetooth devices. It can also be configured via S Register 512 to be in this mode
by default on power up.
When the lower layers detect an incoming call, a RING 123456789012 string sends to the host every
second. The command ATA accepts the connection and ATH rejects it.
On connection, if the S0 Register is >=0 and S504=0 then confirmation to the host is in the following form:
CONNECT <bd_addr>,<uuid>,<
Where ‘<uuid>’ is the UUID of the profile that accepted the connection.
14.1.2 Dropping Connections
In a conventional telephony modem, a call normally terminates by first sending a +++ escape sequence
enveloped by an escape sequence guard time (of the order of 100 to 1000 milliseconds) to enter local
command + connected mode, and then the ATH command to force a disconnection.
The Laird modules provide a couple of ways of dropping a connection. One method is similar to the
above, but instead uses a ^^^ character sequence. This eliminates ambiguity when a data call is in
progress via a mobile phone which established using the mobile phone’s Bluetooth AT modem. The
second method involves the host deasserting the DTR modem control line (DSR modem status line from
the module’s viewpoint) for longer than 500 milliseconds.
The escape sequence to force the module from pass-through mode and into command is as follows: