Ezurio 511B User Manual

BTM510/511 MULTIMEDIA MODULE
USER MANUAL
www.lairdtech.com
Innovative Technology for a Connected World
BTM510/511
Bluetooth® Multimedia Module
TABLE OF CONTENTS
CONTENTS
BTM510/511 Bluetooth® Module ..3
Overview .............................................. 3
BTM510/511 Key Features
Specications ................................4
Detailed Specications ......................... 4
Pin Denitions
...................................... 6
Operating Parameters ...................8
Voltage Specications .......................... 8
Notes for PCB Layout
Conguring the BTM510/511 ........9
References ........................................... 9
Glossary of Terms AT Command Set Assumptions Commands General AT Commands
............................... 10
.............................. 11
...................................... 11
........................................ 11
................... 3
........................... 8
..................... 11
General Bluetooth Hardware Unit Control Bluetooth Secure Simple Pairing Link Key Management
Miscellaneous...................................... 38
Appendix BT-MM Unsolicited Messages BT-MM Error Responses
®
........................................... 39
®
Control ............... 22
....................... 28
Proles ............................. 30
......................... 37
....................... 37
............ 39
..................... 39
Mechanical Drawings ..................41
Mechanical Details ............................. 41
Recommended PCB Footprint Diagrams
............................................ 42
............ 41
Ordering Information ..................45
Product Part Numbers ........................ 45
General Comments
............................ 45
2
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
OVERVIEW AND KEY FEATURES
The BTM510 and BTM511 are low-power Bluetooth® modules designed for adding robust audio and voice capabilities. Based on the market-leading Cambridge Silicon Radio BC05 chipset, these modules provide exceptionally low power consumption with outstanding range. Supporting the latest Bluetooth Version 2.1+EDR specication, these modules provide the important advantage of secure simple pairing that improves security and enhances easy use.
At only 14mm x 20mm, the compact size of the BTM510 makes it ideal for battery-powered or headset form factor audio and voice devices. With a 16-bit stereo codec and microphone inputs to support both stereo and mono applications, these modules also contain a full, integrated Bluetooth-qualied stack along with SPP, HFP 1.5, HSP, AVRCP, and A2DP
proles. Customers using these modules may list and promote their products free of charge
on the Bluetooth website.
The BTM510/511 modules include an embedded 32-bit, 64-MIPS DSP core within the BC05. This is integrated with the Bluetooth functionality which allows designers to add signicant product enhancements including features such as echo cancellation, noise reduction, and
audio enhancement using additional soft codecs. The availability of the 16MB of ash memory
in the module allows complex functionality to be included. DSP routines can be licensed through a number of specialist partners. Typical applications for these modules include Bluetooth stereo headsets, VoIP phones, and wireless audio links.
To speed product development and integration, Laird Technologies has developed a
comprehensive AT command interface that simplies application development, including
support for audio and headset functionality. Access to GPIO pins allows mapping for direct connection to actuator buttons on headsets. Combined with a low-cost development kit, Laird Technologies’ Bluetooth
FEATURES
• Fully featured Bluetooth® multimedia module
• Bluetooth® v2.1+EDR
• Supports mono and stereo
headset applications
• Adaptive Frequency Hopping to cope with
interference from other wireless devices
• 32bit Kalimba DSP for enhanced audio applications
• Support for Secure Simple Pairing
• External or internal antenna options
• HSP, HFP, A2DP, and AVRCP audio proles
• 16-bit stereo codec and microphone input
• Integrated audio ampliers for driving
stereo speaker
• Comprehensive AT interface for simple programming
• Bluetooth END product qualied
• Compact size
• Class 2 output – 4dBm
• Low power operation
• Wi-Fi co-existence hardware support
®
modules provide faster time to market.
APPLICATION AREAS
• High-quality stereo headsets
• Mono voice headsets
• Hands-free devices
• Wireless audio cable replacement
• MP3 and music players
• Phone accessories
• VoIP products
• Cordless headsets
• Automotive
3
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
SPECIFICATIONS
CATEGORIES FEATURE IMPLEMENTATION
Wireless Specication Standards Supported Bluetooth® v2.1 + EDR
Transmit Class Class 2
Frequency 2.402 – 2.480 GHz
Channels 79 channels Frequency Hopping Adaptive Frequency Hopping
Max Transmit Power +4 dBm @ antenna pad – BTM510
Min Transmit Power -27 dBm @ antenna pad – BTM510
Receive Sensitivity Better than -86 dBm
Data Transfer rate Up to 300kbps
Range Up to 50 meters free space (Data)
Antenna Modes External Antenna 50 Ohm matched SMT pad – BTM510
Integrated Antenna +0dB (provisional) multilayer ceramic – BTM511
UART Interface Serial Interface RS-232 bi-directional for commands and data 16550 compat-
Baud Rate Congurable from 1,200 to 921,600bps
Bits 8
Parity Odd, even, none
Stop bits 1 or 2
Default Serial parameters 9,600,n,8,1
Levels Set by VDD_USB pin
Modem Control DTR, DSR, DCD, RI, RTS, CTS
General Purpose Interface I/O 8 general purpose I/O pins
2
S Stereo Audio Digital Interface Bus
I
LED Two
Audio Codec Integrated stereo codec with -95dB SNR for DAC
Ampliers Direct drive for 22Ω Mono Speaker / 44Ω Stereo Speakers
Microphone Input with bias for low noise microphone
Sample Rates (DAC & ADC) 8, 11.025, 16, 22.05, 32 & 44.1kHz
®
Protocols & Firmware Bluetooth
Proles GAP (Generic Access Prole)
Protocols RFCOMM
Firmware Upgrade Available over UART
Stack V2.1 compliant. Fully integrated.
+4 dBmi from integrated antenna – BTM511 (provisional)
-27 dBmi from integrated antenna – BTM511 (provisional)
ible
Non-standard baud rates supported
SDP (Service Discovery Prole) SPP (Serial Port Prole)
HSP
HFP – Audio Gateway and Handsfree A2DP – Source and Sink AVRCP – Target and Controller
AVCTP AVDTP
4
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
SPECIFICATIONS
CATEGORIES FEATURE IMPLEMENTATION
Command Interface AT Instruction set Comprehensive control of connection and module operation,
DSP Kalimba DSP Integrated in BC05 32bit, 64MIPS, 16Mbps Flash Memory
Applications Available from partners
Current Consumption Data Transfer Typically < 35mA
Stereo Music Typically < 70mA (including speaker drive)
Low Power Sniff Mode Less than 1.5mA
Supply Voltage Supply 3.0V – 3.6V DC
I/O 1.7V – 3.6V DC
USB 1.7V – 3.6V DC
Coexistence / Compatibility WLAN (802.11) 2-wire and 3-wire hardware coexistence schemes supported
Connections External Antenna (option) Pad for 50 Ohm antenna – BTM510
Interface Surface Mount Pads
Physical Dimensions 14.0mm x 20.0 x 1.6mm - BTM510
Weight 3 grams
Environmental Operating Temperature -30°C to +70°C
Storage Temperature -40°C to +85°C
Approvals Bluetooth
FCC Meets FCC requirements
CE & R&TTE Meets CE and R&TTE requirements
Miscellaneous Lead free Lead-free within EU requirements and RoHS compliant
Warranty 12 Months
®
including extensions for Audio control. Direct mapping of GPIO to audio functions, e.g. Play, Volume, etc. S Registers for non-volatile storage of parameters
(shared)
14.0mm x 26.0mm x 1.6mm - BTM511 (provisional)
Qualied as an END product
Modular Approval (Integrated Antenna option – BTM511)
Development Tools Development Kit Development board and software tools
5
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
SPECIFICATIONS
PIN SIGNAL DESCRIPTION VOLTAGE
SPECIFICATION
1 PIO15 / DTR Host I/O VIO 2 PIO5/BT_STATE/BT_PRIORITY Host I/O, BT Co-existence VIO 3 PCM_IN PCM Data I/P VIO 4 PCM_OUT PCM Data O/P VIO 5 PCM_SYNC PCM Sync I/P VIO 6 PCM_CLK PCM CLK I/P VIO 7 LED_EXT1 Host I/O See Note 2 8 LED_EXT0 Host I/O See Note 2
9 GND 10 VDD_USB USB supply voltage 11 VDD_IO I/O supply voltage 12 VDD_IN Main supply voltage 13 GND 14 SPI_CSB SPI bus chip select I/P VIO 15 SPI_MISO SPI bus serial O/P VIO 16 SPI_CLK SPI bus clock I/P VIO 17 SPI_MOSI SPI bus serial I/P VIO 18 PIO2/DSR Host I/O VIO 19 PIO3/RI Host I/O VIO 20 PIO1/DCD Host I/O VIO 21 PIO0/BT_ACTIVE Host I/O, BT Co-existence VIO 22 GND 23 AUDIO_GND Audio ground 24 SPKR_A_N Speaker, channel A- (left) See note 3 25 SPKR_A_P Speaker, channel A+ (left) See note 3 26 SPKR_B_N Speaker, channel B- (right) See note 3 27 SPKR_B_P Speaker, channel B+ (right) See note 3 28 MIC_BIAS Microphone bias See note 4 29 MIC_BP_C Microphone, channel A- (left) See note 4 30 MIC_BN_C Microphone, channel A+ (left) See note 4 31 MIC_AP_C Microphone, channel B- (right) See note 4 32 MIC_AN_C Microphone, channel B+ (right) See note 4 33 Unused 34 ANT Antenna connection – BTM510 (50 ohm matched) 35 Unused 36 Unused 37 Unused 38 Unused 39 Unused 40 Unused 41 Unused 42 Unused 43 Unused 44 Unused 45 USB_D- VUSB 46 USB_D+ VUSB 47 GND 48 UART_RTS Request to Send O/P VUSB 49 UART_CTS Clear to Send I/P VUSB 50 UART_TX Transmit data O/P VUSB 51 UART_RX Receive data I/P VUSB 52 PIO7/RF_ACTIVE Host I/O, BT Co-existence VIO 53 PIO6/WLAN_ACTIVE Host I/O, BT Co-existence VIO 54 Reset Module reset I/P See Note 1
6
Laird Technologies
BTM510/511
MIC_AP
MIC_AN
Module
External Circuit
External Circuit
MIC_BIAS
15nH
15pF
15nH
15pF
AC
AC
Single ended Double e n ded
VDD
Module External Circuit
R
Bluetooth® Multimedia Module
SPECIFICATIONS
Note: 1. Reset input is active low. Input is pulled up to VDD_IN via 22k. Minimum reset pulse width is 5ms.
2. LED drive pins are open drain outputs and hence the external circuit to the right should be used.
The voltage on the module pad should be maintained below 0.5V in which case the Ron of the FET is around 20Ω. Provided that this
condition is met, then the current owing through the diode is:
F
led
I
VDD - V
=
R + 20
Where VF is the forward bias voltage of the LED.
3. The speaker output is capable of driving loads with a minimum impedance of 16Ω directly.
4. The audio inputs can operate in either line input mode or microphone
mode. The input circuit has a two stage amplier – the rst stage provides a xed 24dB gain and the second a variable gain of
between -3dB and 18dB. If an input gain of less than 24dB is selected, then the rst stage is switched out and the module is operating in line input mode.
When operating in microphone mode the
microphone should be biased as follows:
7
The input impedance on the microphone inputs (in microphone mode) is typically 6kΩ. In order to maintain the regulation on the MIC_BIAS pin, the current drawn must be in the range 0.2 – 1.23mA.
If the microphone draws less current than this, then an additional resistor to ground must be added to pre-load the microphone output. The audio input is designed for use with inputs of between 1μA and 10μA at 94dB SPL. If the biasing resistors are set to 1kΩ, this implies a microphone with a sensitivity in the range -40dBV to -60dBV.
The low pass lter elements formed by the inductor and capacitor are required to eliminate RF pick up on the microphone inputs and should be placed as close to the module as possible.
When operating in line input mode, the input can be connected directly to the module input pins
in either single or double ended conguration as follows:
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
OPERATING PARAMETERS
OPERATING PARAMETERS
RECOMMENDED OPERATING CONDITIONS
Operating Condition Min Max
VDD_USB
(USB compatibility not required)
VDD_USB
(USB compatibility required)
VDD_IO 1.7 3.3 VDD_IN 3.0 3.6
1.7 3.6
3.1 3.6
VOLTAGE SPECIFICATIONS
LOGIC LEVELS (VUSB)
Input Voltage Levels Min Typ Max
V
ih
V
il
Output Voltage Levels
(Iout = -4mA) 0.75VDD_USB VDD_USB
V
oh
(Iout = 4mA) 0 0.125
V
ol
LOGIC LEVELS (VIO)
Input Voltage Levels Min Typ Max
V
ih
V
il
Output Voltage Levels
(Iout = -4mA) 0.75VDD_IO VDD_IO
V
oh
(Iout = 4mA) 0 0.125
V
ol
0.625VDD_USB VDD_USB+0.3
-0.3 0.25VDD_USB
0.625VDD_IO VDD_IO+0.3
-0.3 0.25VDD_IO
LOGIC LEVELS (VUSB – USB TERMINALS D+, D-)
Input Voltage Levels Min Typ Max
V
ih
V
il
Output Voltage Levels (to correctly terminated USB cable)
2.8 VDD_USB
V
oh
V
ol
0.7VDD_USB
0.3VDD_USB
0 0.2
NOTES FOR PCB LAYOUT:
1. The RF output pin must be matched to a 50Ω strip-line or coplanar waveguide on the antenna-less version (BTM510).
2. Ensure that there are no exposed conductors under the module to avoid shorts to the test points on the module underside.
3. ThePCBfootprintisprovidedforguidanceonly.UsersmaywishtomodifythePCBlanddimensionstosuittheirspecic
manufacturing or process.
8
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
INTRODUCTION
This document describes the protocol used to control and congure the BTM Bluetooth device.
The protocol is similar to the industry standard Hayes AT protocol used in telephony modems which is appropriate for cable replacement scenarios, as both types of devices are connection oriented.
Just like telephony modems, Laird Technologies’ devices power up in an unconnected state and will only respond via the serial interface. In this state, the device will not even respond to Bluetooth inquiries. Then, just like controlling a modem, the host can issue AT commands which map to various Bluetooth activities. The conguration of the device can be saved, so that on a subsequent power up the device is discoverable or automatically connects.
The device has a serial interface which can be congured for baud rates from 1200 up to 921600 (default setting is 9600) and an RF communications end point. The latter has a concept of connected and unconnected
modes and the former will have a concept of command and data modes. This leads to the matrix of states shown below.
RF Unconnected RF Connected
Local Command Mode OK OK
Remote Command Mode ILLEGAL OK
Data Mode ILLEGAL OK
The combinations ‘Data and RF Unconnected Mode’ and ‘Remote Command and RF Unconnected Mode’ do not make sense and will be ignored.
Navigation between these states is done using the AT commands which are described in detail in subsequent sections.
9
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
GLOSSARY OF TERMS
Description
A2DP : Advanced Audio Distribution Prole
ACL : Asynchronous Connection-Oriented Link
ADC : Analogue to Digital Converter
AGHFP : Audio Gateway Hands-Free Prole
AT : Command prex, ‘Attention’
AVRCP : Audio/Video Remote Control Prole
BISM : Bluetooth Intelligent Serial Module
CoD : Class Of Device (also referred to as “device class”)
Codec : Device capable of encoding / decoding an analogue / digital signal
DAC : Digital to Analogue Converter
DSP : Digital Signal Processor
DUN : Dial-Up Network Prole
EIR : Extended Inquiry Response
eSCO : Enhanced Synchronous Connection Oriented Link (used for Audio)
FTP : File Transfer Prole
GOEP : Generic Object Access Exchange Prole
GPIO : General Purpose Input Output
HF : Hands-free Role of Hands-free Prole (“Hands-free Unit”)
HFG : Audio Gateway Role of Hands-free Prole (“Hands-free Gateway”)
HFP : Hands Free Prole
HID : Human Interface Device Prole
HS : Headset Role of Headset Prole (“Headset”)
HSG : Audio Gateway Role of Headset Prole (“Headset Gateway”)
HSP : Headset Prole
I/O (IO) : Input/Output
Mic : Microphone
MITM : Man In The Middle
OPP : Object Push Prole
PBAP : Phone Book Access Prole
PT : PASS THROUGH Command
PWM : Pulse Width Modulation
SBC : Sub Band Codec
SCO : Synchronous Connection Oriented Link (used for Audio)
SLC : Service Level Connection
SPP : Serial Port Prole
SSO : Serial Stream Oriented
SSP : Secure Simple Pairing
SUI : SUBUNIT INFO Command
Sxxx : S-Register No. xxx
TDL : Trusted Device List
UART : Universal Asynchronous Receiver / Transmitter
UI : UNIT INFO Command
10
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
OVERVIEW OF THE BTM PRODUCT FAMILY
BTM410 / BTM411
Chipset CSR BC4-Ext
Bluetooth version 2.1
Features SSP, EIR, SCO (1), eSCO (1)
Proles SPP
(1) external codec required
BTM510 / BTM511
Chipset CSR BC5MM-Ext
Bluetooth version 2.1
Features SSP, EIR, SCO, eSCO
Proles SPP, A2DP, AVRCP,HSP,HFP,DUN(DT)
BTM520 / BTM521
Chipset CSR BC5MM-Ext
Bluetooth version 2.1
Features SSP, EIR, SCO, eSCO
Proles SPP, A2DP, AVRCP,HSP,HFP,DUN(DT)
11
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
BTM - AT COMMAND SET
This section describes the AT Command Set for a BTM module. This section is structured in functional groups of AT commands related to module conguration, Bluetooth proles, hardware units and miscellaneous purposes.
Assumptions
1. All commands are terminated by the carriage return character 0x0D, which is represented by the string <cr> in descriptions below this cannot be changed.
2. All responses from the BTM device have carriage return and linefeed characters preceding and appending the response. These dual character sequences have the values 0x0D and 0x0A respectively and shall be represented by the string <cr,lf>.
3. All Bluetooth addresses are represented by a xed 12 digit hexadecimal string, case insensitive.
4. All Bluetooth Device Class codes are represented by a xed six digit hexadecimal string, case insensitive.
5. All prole specic commands are identied by the prex shown in Table 3.1
Prole Term AT-Command Prex
Serial Port Prole SPP AT+SP…
Advanced Audio Distribution Prole A2DP AT+AP…
Audio/Video Remote Control Prole AVRCP AT+AV…
Headset Prole HSP AT+HS…
Hands-Free Prole HFP AT+HF…
Dial-Up Network Prole DUN AT+DU…
Table 3.1: AT Command prex for proles
Command Syntax
The following syntax is employed throughout this document to describe optional or mandatory parameters for AT commands.
<bd_addr> A 12 character Bluetooth address consisting of ASCII characters ‘0’ to ‘9’, ‘A’ to ‘F’ and ‘a’ to ‘f’.
<devclass> A six character Bluetooth device class consisting of ASCII characters ‘0’ to ‘9’, ‘A’ to ‘F’ and ‘a’ to ‘f’.
n A positive integer value.
m An integer value which could be positive or negative, which can be entered as a decimal value or
<string> A string delimited by double quotes, e.g., “Hello World”. The “ character MUST be supplied as delimiters.
<uuid> A four character UUID number consisting of ASCII characters ‘0’ to ‘9’, ‘A’ to ‘F’ and ‘a’ to ‘f’.
in hexadecimal if preceded by the ‘$’ character, e.g., the value 1234 can also be entered as $4D2.
General AT Commands
1. AT
Used to check the module is available.
Response: <cr,lf>OK<cr,lf>
2. ATEn {Enable/Disable Echo}
This command enables or disables the echo of characters to the screen. A valid parameter value will be written to S Register 506.
E0 … Disable echo. E1 … Enable echo.
All other values of n will generate an error.
Response: <cr,lf>OK<cr,lf>
Or
Response: <cr,lf>ERROR nn<cr,lf>
12
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
3. ATZ<n> {Hardware Reset and Emerge Into Boot Mode ‘n’}
Forces the device through a hardware reset which means it will eventually come alive in the local command and unconnected mode. This allows changes to the non-volatile memory to take effect. The module will issue an OK response after the reset is complete and it is ready to receive commands once again.
ATZ and ATZ0 signify reset and emerge into the current boot mode (see command ATI14). ATZ1 to ATZ4 instructs the module to reset and then emerge into the appropriate boot mode. Note that S Register 103
species the boot mode from cold.
Boot modes are required to congure some low level device settings which cannot be congured by S registers and AT commands. Currently there are predened settings dening the PCM data format to be used with certain codec ICs (applies mainly to BC04).
Response after reset: <cr,lf>OK<cr,lf>
4. AT+BTC<devclass
This command is used to set the device class code which will be sent in subsequent inquiry responses. It can be read back using the AT+BTC? Command, as described below.
<devclass> is a six digit hexadecimal number derived as per “Bluetooth Assigned Numbers” [8].
The 24 bits are made of four elds briey described as follows (bit 0 corresponds to the least signicant bit):-
Bits 0-1: Format Type. This eld currently only has a value of 00 (i.e.,
Bits 2-7: Minor Device Class: The value of these six bits is interpreted
Bits 8-12: Major Device Class: Five bits, refer to Figure 1 and Table 3 in
Bits 13-23: Major Service Class: 11 bit eld, used as a mask to dene
> {Set Device Class Code Temporarily}
hex
format type 1).
differently based on the Major Device Class stored in the next
ve bits.
“Bluetooth Assigned Numbers” [8].
service classes, refer to Figure 1 and Table 2 in “Bluetooth Assigned Numbers” [8].
13
Laird Technologies devices do not map to any predened Major Service Class or Major Device Class and so the default devclass as shipped is 001F00, which means no Major Service Class and “Unclassied”
Major Device class.
Other examples of device class codes are follows:
Code (Hexadecimal) Name Major Service Major Device Minor Device
0x001F00 Unclassied None Unclassied n/a
0x200404 Headset Audio Audio Headset
There is a tool available in the Internet for creating a particular device class code: refer to [9].
A device class set by AT+BTC becomes visible immediately but will be lost on next power cycle.
Response: <cr,lf>OK<cr,lf>
Or for an invalid <devclass> value (usually a value which is not 6 hexadecimal characters long):
Response: <cr,lf>ERROR 08<cr,lf>
5. ATS515=<devclass
S Register 515 is used to set the device class code permanently. Use AT&W to save the setting to
non-volatile memory. The new value will become visible on next power cycle which can be initiated by ATZ. Refer to number 4 for more information about the device class code.
Response: <cr,lf>OK<cr,lf>
6. AT+BTC? {Read Device Class Code}
This command is used to read the current device class code.
Response: <cr,lf>123456
<cr,lf>OK<cr,lf>
> {Set Device Class Code Permanently}
hex
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
7. AT+BTF=”<string>” {Set Friendly Name Temporarily}
This sets the friendly name of this device as seen by other devices. The new name becomes immediately visible. Any name set by this command will be lost on next power cycle.
Please refer to S register 593 (Table 4.1) too.
Response: <cr,lf>OK<cr,lf>
8. AT+BTN=”<string>” {Set Friendly Name Permanently}
This sets the default friendly name of this device as seen by other devices. It will be stored in non-volatile memory. The new name will become visible to other devices on next power cycle. Use AT+BTF to make
the name visible immediately. Use AT+BTN? to read it back. An empty string (“”) will delete the string from non-volatile memory which will force the default name to be used which is “Laird BTM 789012”.
The digits in the default friendly name represent the last six digits of the local Bluetooth address.
Please refer to S register 593 (Table 4.1) too. If a new value of S593 needs to be retained permanently, save it to non-volatile memory by “AT&W”.
Response: <cr,lf>OK<cr,lf>
9. AT+BTN? {Read Friendly Name from Non-volatile Memory}
Read the default friendly name from non-volatile memory.
Response: <cr,lf>”My Friendly Name”<cr,lf>
<cr,lf>OK<cr,lf>
10. AT+BTF<bd_addr> {Get Remote Friendly Name}
This command gets the remote friendly name of the peer specied.
Response: <cr,lf><bd_addr>,”Friendly Name”
<cr,lf>OK<cr,lf>
11. AT+BTP {Make Device Discoverable and Connectable }
Make the device discoverable and connectable and wait for a connection from any device.
The setting remains valid until next reset or power cycle (unless not changed by any other AT command subsequently). For permanent discoverable/connectable settings, please refer to S Register 512.
Response: <cr,lf>OK<cr,lf>
12. AT+BTQ {Make Device Discoverable}
Make the device discoverable but not connectable. Being discoverable implies that this device will
respond to inquiries from other devices (inquiry scans enabled).
The setting remains valid until next reset or power cycle (unless not changed by any other AT command subsequently). For permanent discoverable/connectable settings, please refer to S Register 512.
Use AT+BTX to make the device not discoverable.
Response: <cr,lf>OK<cr,lf>
13. AT+BTG {Make Device Connectable}
Make the device connectable but not discoverable and wait for a connection from any device.
The setting remains valid until next reset or power cycle (unless not changed by any other AT command subsequently). For permanent discoverable/connectable settings, please refer to S Register 512.
Response: <cr,lf>OK<cr,lf>
14
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
14. AT+BTV<bd_addr>,<uuid> {SDP Query for Service }
This command is used to interrogate the SDP database of the peer device <bd_addr> for the service <uuid>. It results in an ACL connection and then an SDP transaction.
If the <uuid> service is present then
Response: <cr,lf>0
<cr,lf>OK<cr,lf>
If the <uuid> service is not present then
Response: <cr,lf>1
<cr,lf>OK<cr,lf>
If the device < bd_addr > cannot be reached, or is in non-connectable mode then
Response: <cr,lf>2
<cr,lf>OK<cr,lf>
If the SDP database is corrupt or invalid then
Response: <cr,lf>3
<cr,lf>OK<cr,lf>
If the device is not in idle mode then
Response: <cr,lf>4
<cr,lf>OK<cr,lf>
and in this case, the command AT+BTX may put the device into the correct idle mode.
15. ATIn {Information}
This will return the information about the Laird Technologies device and its status. Please refer to
Table 4.2 (Appendix) for a complete list of supported ATIn parameters.
For recognized values of n:
Response: <cr,lf>As Appropriate<cr,lf>OK<cr,lf>
For unrecognized values of n.
Response: <cr,lf>Laird Technologies Inc, UK, (c)2009<cr,lf>
AT Commands for S Registers
As with modems, the Bluetooth module employs a concept of registers which are used to store parameters, such as escape sequence character, inquiry delay time, etc.
For a list of general S registers please refer to page 17 and Table 4.1.
S registers associated with a particular prole or specic functions, are described in the appropriate prole section of this document.
The following AT commands allow the manipulation of S registers.
1. ATSn=m {Set S Register}
The value part ‘m’ can be entered as decimal or hexadecimal. A hexadecimal value is specied via a ‘$’ leading character. For example $1234 is a hexadecimal number.
When S register values are changed, the changes are not stored in non-volatile memory UNTIL the AT&W command is used. Note that AT&W does not affect S registers 520 to 525 or 1000 to 1010 as they are updated in non-volatile memory when the command is received.
2. ATSn? {Read S Register Value}
This will return the current value of register n.
For recognized values of n
Response: <cr,lf>As Appropriate<cr,lf>OK<cr,lf>
For unrecognized values of n
Response: <cr,lf>ERROR nn<cr,lf>
15
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
3. ATSn=? {Read S Register – Valid Range}
This will return the valid range of values for register n.
For recognized values of n
Response: <cr,lf>Sn:(nnnn..mmmm)<cr,lf>OK<cr,lf>
For unrecognized values of n
Response: <cr,lf>ERROR nn<cr,lf>
4. AT&Fn {Set S Register Defaults}
This command will only work when the device is in local command and unconnected mode. Depending on the value of ‘n’, it installs S Register values appropriate for various power modes ranging from minimum power consumption to maximum.
Legal values of ‘n’ are as per the following table. All other values of n will generate a syntax error response. If ‘n’ is not specied then a default value of 0 is assumed where the baud rate is NOT changed.
&F0 (Default) Medium power consumption, UART baud rate unchanged
&F1 Minimum power consumption, UART baud rate set to 9600
&F2 Minimum power consumption, UART baud rate set to 38400
&F3 Minimum power consumption, UART baud rate set to 115200
&F4 Medium power consumption, UART baud rate set to 115200
&F5 Maximum power consumption, UART baud rate set to 115200
The new values are NOT updated in non-volatile memory until the AT&W command is sent to
the device.
Response: <cr,lf>OK<cr,lf>
Or
Response: <cr,lf>ERROR nn<cr,lf>
5. AT&F* {Clear Non-Volatile Memory}
The AT&F* variant of the command installs values in S registers as per command AT&F4 and then all other user parameters in non-volatile memory are erased. This means that the trusted device database is cleared, and so are parameters related to the following commands: AT+BTR, AT+BTN, AT+BTS.
Response: <cr,lf>OK<cr,lf>
Or
Response: <cr,lf>ERROR nn<cr,lf>
6. AT&F+ {Clear Non-Volatile Memory}
This command erases all user parameters in non-volatile memory except S Registers 520 to 525. This means that the trusted device database is cleared, and so are parameters related to the following
commands: AT+BTR, AT+BTN, AT+BTS.
Response: <cr,lf>OK<cr,lf>
Or
Response: <cr,lf>ERROR nn<cr,lf>
16
7. AT&W {Write S Registers to Non-Volatile Memory}
Writes current S Register values to non-volatile memory so that they are retained over a power cycle.
Response: <cr,lf>OK<cr,lf>
Or
Response: <cr,lf>ERROR nn<cr,lf>
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
General S Registers
Please refer to Appendix, Table 4.1 for a list of supported S Registers.
The main purpose of S Registers is to make the device conguration persistent. All S Registers can be saved to non-volatile memory by AT&W.
In some cases, an AT command and an S register exist for one and the same setting. In the majority of those cases the AT command’s setting will be lost on next power cycle whereas the S register can be saved and is still available after power cycle. This rule applies to many but not to all of those cases.
AT Commands for Inquiry
1. AT+BTI<devclass> { Inquire}
This will make the device perform an inquiry for delay seconds and max number of unique responses,
where delay is dened by S register 517 and max is specied by S register 518.
The <devclass> is an optional parameter where the value species either a six digit device class code or a two digit major device class. If it is not specied, the value is taken from S register 516.
When <devclass> is six hexadecimal characters long, it species an AND mask which is used to lter inquiry responses. When <devclass> is two hexadecimal characters long, it forces the inquiry to lter responses to devices that match their major device class code to this value – which can only be in
the range 00 to 1F.
The response format to AT+BTI is dened by S Register 330 by bitmask. This is device address, device class, friendly name, receiver strength indicator and extended inquiry data. Please refer to Figure 3.1 and Table 3.2.
For S330=1:
Response: <cr,lf>12346789012
<cr,lf>12345678914
<cr,lf>OK<cr,lf>
A Bluetooth inquiry process is such that for a single inquiry request a device could respond many times. To ensure that an address is sent to the host only once for a particular AT+BTI, an array of addresses is created at the start of each AT+BTI and is lled as responses come in. This array of addresses is stored in dynamic memory and as such if the memory allocation fails then the inquiry procedure is aborted and in that case an error response is sent to the host. To clarify, a single AT+BTI will never return the same Bluetooth address more than once. But as long as the responding device is active, all AT+BTI commands will always return it.
As the inquiry process is driven by randomness, it is not guaranteed that each discoverable device is
always found on the rst attempt. Sometimes more than one inquiry processes might be necessary to nd a particular device. The probability also depends on the inquiry scanning intervals of the device
being searched for.
The inquiry process can be sped up if the friendly name is not required (ag not set in S330) as part of the inquiry response or if a <dev_class> lter is used.
17
Bit 7 6 5 4 3 2 1 0
Reserved for future usage EIRD RSSI FN COD ADR
Default 0 0 0 0 0 0 0 1
Figure 3.1: S Register 330 controlling inquiry response format
Field Description
0 – ADR 1 – display Bluetooth device address on inquiry result
0 – do not display Bluetooth device address on inquiry result; if any further bit is set, a comma is inserted as
separator
1 – COD 1 – display class of device on inquiry result
0 – do not display class of device on inquiry result; if any further bit is set, a comma is inserted as separator
2 – FN 1 – display friendly name on inquiry result
0 – do not display friendly name on inquiry result; if any further bit is set, a comma is inserted as separator
3 – RSSI 1 – display RSSI value on inquiry result
0 – do not display RSSI value on inquiry result; if any further bit is set, a comma is inserted as separator
4 – EIRD 1 – display eird on inquiry result
0 – do not display eird on inquiry result
Table 3.2: Field Descriptions for S Register 330
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
Inquiry Response Format
The format of an inquiry result will be:
<cr,lf><bd_addr>,<dev_class>,<friendly_name>,<rssi>,<eir_data><cr,lf>
<bd_addr> = 12 digit, hexadecimal;
<dev_class> = six digit, hexadecimal;
<friendly_name> = printable ASCII character, enclosed by ‘ “ ‘
<rssi> = signed two digits decimal
<eir_data> = printable ASCII character whenever possible, otherwise a byte is displayed as ¬2 digit hexadecimal with preceding ‘\’, enclosed by ‘ “ ‘
For example the data block 01 41 42 43 44 02 03 45 46 04 0A 0D will be presented as
“\01ABCD\02\03456\04\0A\0D”
No validation is performed on incoming EIR data.
If a higher signicant ag is set and a lower signicant bit is not set in S 330, for each disabled item a comma is printed.
Example: S330 = 9 (ADDR enabled, COD and FN disabled, RSSI enabled)
Inquiry Response:
<cr,lf>123456789012,,,-54
<cr,lf>123456789014,,,-54
<cr,lf>OK<cr,lf>
2. AT+BTIV<devclass> { Inquire }
As per AT+BTI but the response comprises for all inquiry responses:
1. the Bluetooth device address
2. device class code
S register 330 is not referenced.
18
3. AT+BTIN<devclass> { Inquire }
As per AT+BTI but the response comprises for all inquiry responses:
1. the Bluetooth device address
2. device class code
3. friendly name
S register 330 is not referenced.
4. AT+BTIR<devclass> { Inquire }
As per AT+BTI but the response comprises for all inquiry responses:
1. the Bluetooth device address
2. device class code
3. friendly name
4. rssi (receiver signal strength indicator)
S register 330 is not referenced.
5. AT+BTIE<devclass> { Inquire }
As per AT+BTI but the response comprises for all inquiry responses:
1. the Bluetooth device address
2. device class code
3. friendly name
4. rssi (receiver signal strength indicator)
5. extended inquiry data
S register 330 is not referenced.
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
6. AT+BTE=”<EIR-Data>” {Set Up Outgoing EIR Data}
This command sets up outgoing EIR (extended inquiry response) data.
Format: <EIR-Data> = printable ASCII character whenever possible, otherwise a two digit hexadecimal
with preceding ‘\’ presenting one byte. Please note that the given data is written to baseband as it is (raw data) and no checks on the data format is performed. Hence, the user is responsible for writing data that corresponds to the extended inquiry response data format as described in the Bluetooth
Specication Version 2.1 + EDR [1], vol3, Part C – Generic Access Prole, 8 Extended Inquiry Response Data Format (page 1305 in the .pdf-le).
Response: <cr,lf>OK<cr,lf>
7. AT+BTE? {Query Outgoing EIR Data}
This command prints the outgoing EIR data that is currently set up
Response:
<cr,lf>
<EIR-Data>
<cr,lf>OK<cr,lf>
Secure Simple Pairing (SSP)
Secure Simple Pairing (SSP) has been introduced since Bluetooth 2.1 + EDR. It aims to increase the security
provided by a Bluetooth link whilst making the pairing process more user friendly.
There are white papers about SSP available through the Internet (provided by the Bluetooth SIG and other com­panies), explaining the mechanisms and backgrounds of SSP. They can be found by searching the Internet for, e.g., “Bluetooth Secure Simple Pairing”. Please familiarize with those documents to get a better understanding
of SSP and the following settings.
1. Security Level (S320)
The security level is dened in the BT2.1+EDR specication [1], vol3, Generic Access Prole (Table 5.7). There are 4 Levels providing different levels of security:
Security Level Characteristics Comment
Level 3 • MITM protection (MITM = “Man in the
Middle” attack)
• Encryption
• User interaction
Level 2 • No MITM protection
• Encryption
Level 1 • No MITM protection
• (No) Encryption (1)
• Minimal user interaction
Level 0 • No MITM protection
• No Encryption
• Minimal user interaction
(1) Although encryption is not necessary for security level 1, encryption will always be enabled because this specication mandates encryption for all services other than SDP (service discovery).
Table 3.3: Security Levels
The security level is dened by S Register 320 and is referenced at boot time only. Hence the register must be saved by “AT&W “ and the module must be power cycled (or “ATZ”) subsequently.
S320 = 3 will overwrite the setting of S Register 322 (enable MITM).
The security level will remain the same until next power cycle and is valid for all proles and services of the module. For SDP (service discovery prole), security level 0 is always assigned internally.
High security
Medium Security
Low Security
Permitted only for service discovery
19
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
2. IO-Capability (S321)
S-Register 321 denes the IO-capability of the device. The setting is used for IO-capability negotiations prior to SSP in order to identify whether the IO-capabilities of both devices are sufcient for MITM protection (if required). Table 3.4 lists possible values.
S321 IO-Capability Comment
0 Display only The device has the capability to display or communicate a
six digit decimal number.
1 Display yes no The device has the capability to display or communicate
a six digit decimal number and at least two buttons that can be easily mapped to ‘yes’ and ’no’ or a mechanism
whereby the user can indicate either ‘yes’ or ‘no’ (e.g., pressing a button within a certain time limit).
2 Keyboard only The device has a numeric keyboard that can input
numbers ‘0’ through ‘9’ and a conrmation. The device
has also at least two buttons that can be easily mapped to ‘yes’ and ’no’ or a mechanism whereby the user can
indicate either ‘yes’ or ‘no’ (e.g., pressing a button within a certain time limit).
3 No input no output The device does not have the ability to indicate ‘yes’ or
‘no’, and the device does not have the ability to display or communicate a 6 digit decimal number.
4 Reject IO-Cap requests IO-capability requests prior to SSP are rejected.
Table 3.4: IO capabilities
3. Force Man-In-The-Middle Protection (MITM, S322)
Protection against MITM-attacks can be enabled by S332. This S-Register only applies if the security level (S320) is less than 3. In case of security level (S320) = 3, MITM protection is always enabled and this S 322 is ignored.
A new value written to S322 applies immediately. No power cycle is required.
A link key created with MITM protection is named “authenticated link key”.
A link key created without MITM protection is named “unauthenticated link key”.
4. Disable Legacy Pairing (S323)
If the remote device is a legacy device (BT2.0 or earlier), legacy pairing with usage of PIN codes will be initiated. Legacy Pairing can be disabled by S-Register 323 = 1. Then pairing with legacy devices
will always fail.
5. SSP Timeout (S324)
The SSP timeout [s] is dened by S-Register 324. The timeout must be at least 60s to meet the BT specication requirements [1]. This time is required to be sufcient for the user to compare or read
and input a 6 digit number. A time of 90 seconds is recommended which is the default value.
6. SSP Input Commands
Table 3.5 lists all AT commands related to SSP input operations.
AT Command Operation Comment
AT+BTBY Accept pairing request Representing ‘yes’ input
AT+BTBN Reject pairing request Representing ‘no’ input
AT+BTB012345 Enter six digit passkey displayed by remote device Representing keyboard input
Table 3.5: SSP Input commands
20
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
7. AT+BTW<bd_addr> {Initiate SSP}
This command initiates secure simple pairing (dedicated bonding) with a device whose Bluetooth address is <bd_addr>. The correct term for this command’s action with respect to the Bluetooth
specication 2.1+EDR [1] is “Dedicated Bonding”.
Dedicated bonding means the exchange of link keys (pairing) without creating a connection to a particular prole or service immediately.
The remote device must be a Bluetooth 2.1 device, otherwise (BT2.0 or earlier) legacy pairing will occur automatically if S323=0. For legacy pairing please refer to page 23.
The “OK” response is sent immediately on receipt of the AT+BTW command. Depending on the
combination of IO-capabilities of both devices, one of the asynchronous messages from Table 3.7 might appear during the pairing process. Please refer to that table for the required actions.
On pairing completion, an unsolicited message in the form PAIR n <bd_addr> will be sent to the host.
8. S Registers for Secure Simple Pairing
The following table lists all S Registers for Secure Simple Pairing. For the registers’ details please refer to their descriptions above.
Register Default Range Comment
S320 2 1..3 Security Level: see [1], vol3, Generic Access Prole - Table 5.7
needs subsequent ‘AT&W’ and power cycle to take effect value = 3 overwrites S322
S321 1 0..4 Set IO capability:
0 – display only 1 – display yes no 2 – keyboard only 3 – no input no output 4 – reject IO-cap requests
S322 0 0..1 Force man-in-the-middle-protection (MITM):
0 – disabled 1 – enabled referenced only if security level (S320) < 3
S323 0 0..1 Disable legacy (pre-BT2.1) Pairing:
0 – legacy pairing enabled 1 – legacy pairing disabled
S324 90 1..255 Secure Simple Pairing timeout in s
This value must be at least 60 in order to meet the recom-
mendation of BT2.1 specication
Table 3.6: S-Registers for Secure Simple Pairing (SSP)
21
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
9. Asynchronous SSP Messages
Table 3.7 lists asynchronous messages which occur if MITM is enabled. The actually sent message depends on the combination of the IO capabilities of both ends. The combination of IO capabilities
of both devices can also be insufcient for MITM protection. In that case the pairing will fail (PAIR 2 <BdAddr>). Please refer Table 5.6 in BT2.1+EDR specication [1], vol3, Generic Access Prole for sufcient combinations of IO-capabilities for MITM (=authenticated link key).
Message Action / Comment
PAIR ? <BdAddr>,”<friendlyname>”,<Passkey>
Example:
PAIR ? 0016A4000002,”Laird BTM
000002”,863611
PASSKEY ? <BdAddr>,”<friendlyname>”
Example:
PASSKEY ? 0016A4000001,”Laird BTM 000001”
PAIR N <BdAddr>,”<friendlyname>”,<Passkey>
Example:
PASSKEY N 0016A4000002,”Laird BTM
000002”,164585
PAIR 0 <BdAddr> <nn> Successfully paired with device of <BdAddr>.
PAIR 1 <BdAddr> Pairing timeout
PAIR 2 <BdAddr> Pairing failed
PAIR 3 <BdAddr> Pairing failed (too many repeat attempts)
PAIR 4 <BdAddr> Pairing rejected by remote device
PAIR 5 <BdAddr> Pairing failed (unit keys not supported)
PAIR 6 <BdAddr> Pairing failed (SSP not supported)
PAIR 7 <BdAddr> Pairing failed (already busy with pairing)
(1) If both devices have a “KeyboardOnly” capability, no pass key can be displayed. In that case, the
user is required to invent and enter the identical 6 digit numeric passkey at both ends.
Table 3.7: Asynchronous messages for SSP
Passkey compare request:
Expecting the user to compare the passkey
displayed on both ends and to conrm a match by “AT+BTBY” at both ends or reject by “AT+BTBN” if passkey does not match.
Passkey request:
Expecting the user to enter the passkey displayed by the remote device. Use AT+BTB<passkey>,
example: AT+BTB012345 *see(1) below
Passkey notication:
Display BdAddr, friendly name and passkey to user.
Expecting the user to enter the passkey from this message at the remote device’s numeric keyboard.
<nn> (optional) indicates the status of auto­matic storage to trusted device list. Value 0 = success; settings controlled by S325 to S328.
Please refer to section 2.3, page 82.
22
10. Known SSP Issues
a.) General Bonding (automatic pairing on link setup if devices have not been paired previously) does not work with legacy devices (BT2.0 and earlier). If the remote device is BT2.0 or earlier, initiate dedicated bonding (AT+BTW<BdAddr>) prior to connection establishment.
b.) Outgoing General Bonding (automatic pairing on link setup if devices have not been paired previously) with MITM does not work with two BTM devices, because any UART input on the initiating device is not accepted until the link has been established. Workaround: initiate dedicated bonding (AT+BTW<BdAddr>) prior to connection establishment.
c.) If the link key of previously paired devices is not available any more in the remote device but still available in the trusted device list (TDL) of the local device (query by AT+BTT?), pairing will fail. In that
case remove the device address from the local TDL using AT+BTD<BdAddr> and reinitiate pairing
from the local device (AT+BTW<Bd_addr>).
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
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 conrms 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 qualied 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 specied 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.
23
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
AT Commands Managing Trusted Devices
1. AT+BTT? {List Trusted Device}
This command is used to list the contents of the trusted device database. The link key is NOT displayed so the response is as shown below. If the list is empty then just the OK response is sent otherwise an OK is used to terminate the list. Use the command ATI6 to read the maximum size of the trusted device database.
Response: <cr,lf>12346789012
<cr,lf>12345678913
<cr,lf>12345678914
<cr,lf>OK<cr,lf>
2. AT+BTT {Add Trusted Device}
This command is used to store the cached link key in the non-volatile database. If the database is full, it will respond with an ERROR. If the device is already in the database, then the key is replaced. If the link key cache is empty, that is, a pairing has not been performed since the device was powered, then the response will be an ERROR.
Response: <cr,lf>OK<cr,lf>
Or
Response: <cr,lf>ERROR<cr,lf>
3. AT+BTD<bd_addr> {Remove Trusted Device}
This command is used to remove the specied device from the list of trusted devices in the non-volatile database. If the device is not in the database, then the response will still be an OK.
Response: <cr,lf>OK<cr,lf>
24
4. AT+BTD* {Remove All Trusted Devices}
This command is used to remove all devices from the trusted device list (TDL) in the non-volatile database. No conrmation will be asked for. So beware!!!
WARNING: If you make a connection, the link key gets cached in the underlying stack. So if you subsequently delete the key using AT+BTD* and immediately request a connection to the same device, then the connection will be established. To ensure this does not happen, send ATZ after the AT+BTD*.
Response: <cr,lf>OK<cr,lf>
5. AT+BTW? {List Cached Trusted Device}
This command is used to list the cached trusted device.
Response: <cr,lf>12346789012
<cr,lf>OK<cr,lf>
If the cache is empty the response is as follows.
Response: <cr,lf>OK<cr,lf>
AT Commands for Serial Stream Oriented Proles (SSO)
The Serial Port Prole (SSP) and the Dial-up Networking Prole (DUN) belong to the group of Serial Stream Oriented proles (SSO).
When activated, an SSO prole claims one UART for its data stream and assumes all data at the UART to be transmitted over or received from RF 1:1. Hence, as there is only one UART available on a BTM device, the UART is not available for other proles, services or module control purposes.
One approach of managing data and control over UART is to congure local command mode with S531=3.
In this mode, incoming RF data is presented by the asynchronous message RX<string>. Outgoing data is sent by ATX<string> or ATY<string>.
With this approach it is possible to manage several non-SSO connections (e.g., A2DP, AVRCP) and at maximum one SSO connection (SSP or DUN). An attempt to connect a second SSO prole while already
one SSO connected will result in Error 65.
Any incoming connection request to an SSO prole will be rejected if one SSO is already connected.
The following section describes AT- commands related to SSO-proles.
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
1. ATX”<string>” {Send Data in Local Command and Connected Mode}
This command is used to send data to the remote device when in local command and connected mode.
The parameter <string> is any string not more than 29 characters long whereby a non-printable
character (\hh, see below) counts three characters. This restriction results from the maximum AT command length which is 34 (query by ATI15). The difference of 5 is caused by “ATX” (three characters) and the enclosing quotation marks (two characters).
If the maximum string length is exceeded, ERROR 05 (syntax error) will occur.
If a non-visual character is to be sent then insert the escape sequence \hh where hh are two hexadecimal digits. The three character sequence \hh will be converted into a single byte before transmission to the peer.
Response: <cr,lf>OK<cr,lf>
Or
<cr,lf>ERROR 05<cr,lf> (e.g. <string> too long)
2. ATY”<string>” {Send Data in Local Command and Connected Mode}
This command is similar to ATX in syntax and functionality, except that the string is only copied to the output rf buffer. Only when an empty string is presented, all pending data in the output rf buffer
will be ushed out.
The parameter <string> is any string not more than 29 characters long whereby a non printable
character (\hh, see below) counts three characters. This restriction results from the maximum AT command length which is 34 (query by ATI15). The difference of 5 is caused by “ATX” (three characters) and the enclosing quotation marks (two characters).
If the maximum string length is exceeded, ERROR 05 (syntax error) will occur.
If a non-visual character is to be sent then insert the escape sequence \hh where hh are two hexadecimal digits. The three character sequence \hh will be converted into a single byte before transmission to the peer.
Response: <cr,lf>OK<cr,lf>
Or
<cr,lf>ERROR 05<cr,lf> (e.g. <string> too long)
3. ^^^ {Enter Local Command Mode}
When in data and connected mode and when S 507 is set to 0 or 1, the host can force the device into a command and connected mode so that AT Commands can be issued to the device. The character in
this escape sequence is specied in the S2 register, so it can be changed. In addition, the escape sequence guard time is specied by S Register 12. By default the guard time is set to 100 milliseconds.
Leaving data mode by “^^^” has a severe penalty on data throughput, because each incoming character needs to be checked for ‘^’ with respect to the guard time.
Alternatively, a de-assertion of the DTR/DSR line can be used as the only trigger to leave data mode (S507=2). This gives a signicant higher data throughput because data is passed directly between UART and RF without character checking. Please refer to Section 6, page 26 for more information.
In modems this escape sequence is usually “+++”. “^^^” is specied to avoid confusion when the module is providing access to a modem.
Response: <cr,lf>OK<cr,lf>
4. !!! {Enter Remote Command Mode}
When in data and connected mode, the host can force the remote device into a command and connected mode so that AT Commands can be issued to the device remotely. The escape sequence guard time is specied by S Register 12 and is the same as per the ^^^ escape sequence. By default the guard time is set to 100 milliseconds. The remote device issues ATO as normal to return to data
mode (Refer to 5). For this command to be effective S Register 536 must be set to 1.
Response: <cr,lf>OK<cr,lf>
25
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
5. ATO {Enter Data Mode} (letter ‘o’)
Return to data mode. Assume that the module is in data mode after OK is received. Responds with an error if there is no Bluetooth SSO connection.
Response:
<cr,lf> CONNECT 123456789012,<<cr,lf> (if it was an incoming connection)
<cr,lf> CONNECT 123456789012,><cr,lf> (if it was an outgoing connection)
Or
Response: <cr,lf>ERROR nn<cr,lf>
6. Dropping SSO Connections
In a conventional telephony modem, a call is normally terminated by rst sending a +++ character sequence enveloped by an escape sequence guard time (of the order of 100 to 1000 milliseconds)
to enter local command and connected mode and then the ATH command.
Laird Technologies BTM devices provide a variety of ways of dropping a connection. One method is similar to the above, but instead a ^^^ character sequence is used. This is to eliminate ambiguity when a data call is in progress via a mobile phone which was established using the mobile phone’s Bluetooth AT modem. The second method involves the host dropping the DTR (DSR from the module’s viewpoint) handshaking line.
Being able to drop a connection using the escape sequence ^^^ has a severe penalty on data throughput. In fact, the data rate is of the order of 85kbps instead of about 300kbps. To cater for
this performance hit, the device’s connection drop capability is congurable to be in one of two modes.
One mode allows for a connection to be dropped using either method, and 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 (Appendix, Table 4.1).
To reiterate, the escape sequence is as follows:-
<Guard time><Esc Chr><Guard time><Esc Chr><Guard time><Esc Chr><Guard time>
This means that even when a le transfer is occurring and it happens to be full of <Esc Chr> characters then it is not going to drop into command mode because, when transferring, a le it is going to happen as fast as possible and so the inter character gap is going to be signicantly shorter than the <Guard time>.
The <Esc Chr> character can be changed via the S2 register and the <Guard time> interval can be
specied via the S12 register (Appendix, Table 4.1).
26
7. SSO - Asynchronous Messages
RX<string>
This response is sent to the host when the unit is in online-command mode and S Register 531 is set to 3 and data arrives from a peer.
If the data from the string contains non-visual characters (for example ASCII 0 to 31 and ASCII 128 to 255), then those characters are translated into a three character escape sequence starting with ‘\’.
For example the embedded <cr><lf> sequence would be sent as the six character string \0D\0A.
If the data contains the character ‘“’ then it is sent as \22.
If the data contains the character ‘\’ then it is sent as \5C.
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
8. SSO – S Registers
The following table lists S registers for SSO proles.
Register Default Range Description
S2 94 32..126 Escape sequence character. It is not ‘+’ by default as a
Bluetooth serial link can be used to connect to a mobile phone which exposes an AT command set, which will in turn use ‘+’ as default. So if both used ‘+’, there will be confusion.
94 is the character ‘^’.
S12 100 40..5000 Escape sequence guard time in milliseconds, with a
granularity of 20ms. New values are rounded down to the nearest 20ms multiple.
S507 0 0..2 When set to 0, a connection can be dropped using ^^^
escape sequence only and the state of DSR line is ignored. When set to 1, a connection can be dropped using EITHER the
^^^ escape sequence OR the DSR handshaking line. When set
to 2, a connection can only be dropped using a deassertion of DSR. Mode 2 provides for the highest data transfer rate.
If the status of the DSR line is to be conveyed to the remote device as a low bandwidth signal then this register MUST be set to 0, otherwise a deassertion of DSR will be seen as a request to drop the Bluetooth connection.
This register affects S Register 536 – see details of 536.
S531 0 0..4 Species the mode on connection establishment.
0 = Normal, that data is exchanged between UART and RF. 1 = LOCAL_COMMAND. UART input is parsed by the AT
interpreter and RF data is discarded. 2 = REMOTE_COMMAND. RF input is parsed by the AT
interpreter and UART data is discarded. If S Reg 536 is not 1 then this register cannot be set to 2 and an ERROR will be returned.
3 = LOCAL_COMMAND. UART input is parsed by the AT
interpreter and incoming RF data is sent to the host using the RX<string> asynchronous response.
4 = LOCAL_COMMAND and on the rf side, the gpio is automatically sent when there is a change in input (digital I/O cable replacement mode).
S536 0 0..1 When set to 1, a remote device can ‘capture’ the AT parser of
this unit by it sending this module an escape “!!!” sequence.
The inter character timing is set via S Register 12.
If S Register 507 is >= 2, then reading this register will always
return 0 and writing 1 will result in ERROR 33.
Table 3.8: S Registers for SSO proles
27
AT Commands for a Selected Peer Device
This section describes AT commands to make the BTM Bluetooth device connectable for one particular remote device only or to connect to a particular remote device on reset or on power cycle automatically.
1. AT+BTP<bd_addr> {Make Device Discoverable and Selectively Connectable}
Make the BTM device discoverable (for all devices) and connectable for the device with the Bluetooth address <bd_addr> only. Connection requests from any other devices will be rejected.
If <bd_addr> is 000000000000 then incoming connections are accepted from any device, as per AT+BTP without an address.
The setting remains valid until next reset or power cycle (unless not changed by any other AT command subsequently). For permanent discoverable/connectable settings, please refer to S Register
512 and AT+BTM<bd_addr>
Response: <cr,lf>OK<cr,lf>
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
2. AT+BTG<bd_addr> {Make Device Selectively Connectable Only}
Make the BTM device connectable for the device with the Bluetooth address <bd_addr> only. Connection requests from any other devices will be rejected.
If the specied address is 000000000000 then incoming connections are accepted from any device, is as per AT+BTP without an address.
The BTM device is not discoverable.
The setting remains valid until next reset or power cycle (unless not changed by any other AT command subsequently). For permanent discoverable/connectable settings, please refer to S Register 512 and
AT+BTM<bd_addr>
Response: <cr,lf>OK<cr,lf>
3. AT+BTM<bd_addr> {Set Incoming Peer Address}
This command is used to store a peer address for incoming connections in non-volatile memory. Only the device with Bluetooth address <bd_addr> will be permitted to make a connection to the BTM device. Connection requests from other devices will be rejected.
The new setting applies immediately and will retain over a power cycle (unless not changed by any other AT command subsequently).
When S register 512 = 3, 4, 6 or 7 then the BTM device will wait for an incoming connection from the peer address specied. If <bd_addr> is 000000000000, then incoming connections from any
devices are permitted.
Response: <cr,lf>OK<cr,lf>
4. AT+BTM {Delete Incoming Peer Address}
This command is used to delete the peer address previously stored using AT+BTM<bd_addr>.
If the BTM device was connectable for the selected device before this command, it will be connectable for any device immediately after this command.
Response: <cr,lf>OK<cr,lf>
5. AT+BTM? {Read Incoming Peer Address}
This command is used to display the peer address stored in non-volatile memory, used to put the module in pure cable replacement mode.
Response: <cr,lf>12346789012
<cr,lf>OK<cr,lf>
If the location is empty, the response is as follows.
Response: <cr,lf>00000000000
<cr,lf>OK<cr,lf>
6. AT+BTR<bd_addr> {Set Outgoing Peer Address}
This command is used to store a peer address for outbound connections in non-volatile memory.
This command is used to set up a module in pure cable replacement mode. If S register 512 = 1 and the peer address is NOT 000000000000, then it will periodically (time specied via S register 505) attempt to connect to the peer address specied. In this circumstance all data from the host are
buffered in the receive buffer, until a Bluetooth connection is established with the peer device and it then sends the buffer across. This means that if the peer device is not in the vicinity and will never be there and S507=1 or 2, the device effectively becomes useless, as in this circumstance the module is not listening for commands arriving on the UART.
In this circumstance, a recovery is possible by one of two methods. The rst method assumes that the DTR from the host is connected to the DSR line of the module and S507=1. The second method assumes that this connection is absent and S507=1 or 2.
In the rst method it is enough to deassert the DTR line from the host and that will abort the autoconnect cycle. No “OK” is sent in response. Hence it is up to the host to send a character regularly (e.g., one per second) until the BTM device echoes all buffered characters to the host (provided echo is enabled). Once the BTM device echoes characters, it is in command mode.
28
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
The second method is initiated by resetting the device and then ensuring that the text string
“AT+BT&BISM&<cr>” is sent (where <cr> is the carriage return character). There is special code which looks out for this magic command and terminates the autoconnect cycle if it sees it and conrms to the host of that fact by sending an “OK” response.
Response: <cr,lf>OK<cr,lf>
7. AT+BTR {Delete Outgoing Peer Address}
This command is used to delete the peer address previously stored using AT+BTR<bd_addr>.
Response: <cr,lf>OK<cr,lf>
8 AT+BTR? {Read Outgoing Peer Address}
This command is used to display the peer address stored in non-volatile memory, used to put the device in pure cable replacement mode.
Response: <cr,lf>12346789012
<cr,lf>OK<cr,lf> If the location is empty the response is as follows.
Response: <cr,lf>00000000000
<cr,lf>OK<cr,lf>
Bluetooth Proles
This section covers S-Registers and AT-Commands that are related to supported Bluetooth Proles on BTM.
1. ProleActivation
In order to activate available proles and advertise them to potential client devices, S-Register 102 is used. Per default, only SPP is activated (value=1). Other supported proles can be activated by setting
the appropriate Flag in S-Register 102. Once S-Register 102 has been written, the changed value needs
to be saved to non-volatile memory (“AT&W”) and subsequently a reset (“ATZ”) or power cycle is required. Please note that “AT&W” saves the content of all S Registers to non-volatile memory.
2. SPP(SerialPortProle)
The serial port prole (SPP) is used for serial data transmission with a remote device in both directions. It behaves like a wireless replacement for a serial cable.
SSP belongs to the group of serial stream oriented proles (SSO) so please refer to page 24 too.
In order to use SPP, the prole must be enabled in S102 (value=1). If it was not enabled earlier, set the S register accordingly and issue AT&W followed by ATZ.
2.1 SPP Example
This section gives an example on how an SPP connection between two Laird Technologies BTM devices can be established. It is assumed that two devices A and B are connected to a terminal program, e.g., Ezurio Terminal on a PC. The example sequence of AT commands is listed in Table 3.9. Figure 3.2 through to Figure 3.5 are presenting appropriate screenshots with Ezurio Terminal.
Phase Dev. AT Command Comment
Preparation A AT&F* Restore factory default settings
ATS102=1 Enable Serial Port Prole (SPP)
AT&W Store settings
ATZ Reset
Preparation B AT&F* Restore factory default settings
ATS102=1 Enable Serial Port Prole (SPP)
ATS0=1 Automatic response after one “RING”
AT&W Store settings
ATZ Reset
AT+BTP Make device temporary connectable and discoverable
ATI4 Query Bluetooth device address of local device <BdAddr_DevB>
29
Laird Technologies
BTM510/511
Bluetooth® Multimedia Module
AT COMMAND SET REFERENCE
Phase Dev. AT Command Comment
Initiate connection
Connected A,B <data> Any character entered on one end is displayed at the
Enter command mode
Disconnect AT+SPH Response “NO CARRIER…” (A and B): disconnection
A AT+SPD<BdAddr_DevB> Initiate SPP connection from device A to device B.
Asynchronous messages:
“PAIR 0…” (pairing successful, A and B)
“RING…” (B only)
“CONNECT…” (connected, A and B)
other end.
A or B^^^ Response “OK” :
Command mode conrmed, now AT commands are expected at the UART; UART data from host is not sent
across to remote device.
conrmed.
Table 3.9: SPP Example Command Sequence
30
Figure 3.2: SPP example - Preparation of Device A
Figure 3.3 SPP example – Preparation of Device B
Laird Technologies
Loading...
+ 86 hidden pages