Bluetooth Serial Module AT Command Set Doc No: Date : Author : XRBLU020-001SW-0 3 Feb 2003 Mahendra Tailor Issue No : 1.9 Page 1 of 38 Bluetooth Serial Module AT Command Set Prepared by : Mahendra Tailor Signature : Authorised by: Signature : © 2003 COPYRIGHT TDK Systems Europe Ltd This document is issued by TDK Systems Europe Limited (hereinafter called TDK) in confidence, and is not to be reproduced in whole or in part without the prior written permission of TDK.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 2 of 38 Change History Issue 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 3 of 38 Contents 1. Introduction 2. AT Command Set 6 2.1 Assumptions ....................................................................................................................................6 2.2 Commands ......................................................................................................................................6 2.2.1 AT........................................
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 2.2.47 2.2.48 2.2.50 2.2.49 2.2.51 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 4 of 38 AT+BTD {Remove Trusted Device} ......................................................17 AT+BTD* {Remove All Trusted Device} .................................................................17 AT+BTR {Set Peer Address}.................................................................17 AT+BTR? {Display Peer Address}...........................
Bluetooth Serial Module AT Command Set Date : 1. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 5 of 38 Introduction This document describes the protocol used to control and configure TDK’s Bluetooth Serial Module. The protocol is similar to the industry standard Hayes AT protocol used in telephony modems due to the fact that both types of devices are connection oriented.
Bluetooth Serial Module AT Command Set Date : 2. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 6 of 38 AT Command Set 2.1 Assumptions The CSR (Cambridge Silicon Radio) BC2 chipset in the TDK Modules is memory resource limited therefore it is NOT proposed that there be full implementation of the AT protocol as seen in modems. The claim made for this device is that it will have a protocol similar to an AT modem.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Response: Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 7 of 38 OK note OK is returned before the RESET 2.2.3 ATEn {Enable/Disble Echoes} It affects S Register 506. Set n=0 to disable echoes and n=1 to enable. All other values will generate an error. Response: OK 2.2.4 AT&Fn {Set S Reg Defaults} This command will only work when the device is in idle mode.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Response: Or Response: 2.2.6 ATIn Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 8 of 38 OK ERROR nn {Information} This will return information about the module. For example, version numbers, manufacturer etc For n=0, the response describes the product.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 2.2.7 ATSn=m Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 9 of 38 {Set S Register} There is a concept of registers which are used to store parameters, such as escape sequence character, inquiry delay time etc, as listed in detail below. The value part ‘m’ can be entered as decimal or hexadecimal. A hexadecimal value is specified via a ‘$’ leading character. For example $1234 is a hex number.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 521 115200 300.. 921600 522 523 524 525 1 1 0 See Comment 1 1..2 0..2 0..1 530 1000 100.. 15000 531 532 0 0 0..1 0..3 533 1 0..2 534 1 0..1 535 20 0..41 540 0 0 48-127 1001 to 1010 610 620 0 n/a 0..31 0..31 621 622 623 624 625 626 627 628 n/a n/a n/a n/a n/a n/a n/a n/a 0..1 0..1 0..1 0..1 0..1 0 0 0 1.9 Doc No : XRBLU020-001SW-0 If Sreg 525=1, then the max baudrate is limited to 115200 Change baudrate.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 2.2.8 ATSn? Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 11 of 38 {Query S Register} This will return the current value of register n. For recognised values of n Response: As Appropriate OK For unrecognised values of n Response: ERROR nn 2.2.9 ATD {Make Connection} Make a connection to device with Bluetooth addess . Authentication and Encryption is as per S registers 500 and 501.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 2.2.15 ^^^ Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 12 of 38 {Enter Command Mode} When in online and connected mode, 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 specified in the S2 register , so can be changed. In addition, the escape sequence guard time is specified by S Register 12.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 13 of 38 ERROR RESPONSE 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 filled as responses come in.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Response: Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 14 of 38 OK 2.2.27 AT+BTGY {Enable Promiscuous Page Scanning ONLY} Enable page scanning only and wait for a connection from any device. Inquiry scans disabled Response: OK 2.2.28 AT+BTGUY {Enable Promiscuous Page Scanning ONLY} Enable page scanning only and wait for a connection from any device. Inquiry scans are disabled.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 2.2.33 AT+BTPY Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 15 of 38 {Enable Promiscuous Page Scaning + Inquiry Scans} Enable page scanning and wait for a connection from any device. Inquiry scanning is also enabled. Authentication is disabled but Encryption is enabled. Response: OK 2.2.34 AT+BTPUY {Enable Promiscuous Page Scaning + Inquiry Scans} Enable page scanning and wait for a connection from any device.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 2.2.40 AT+BTS= 1.9 Doc No : XRBLU020-001SW-0 Page 16 of 38 {Set Service Name} This writes the name to non-volatile storage area. It will be used after ATZ, power cycle or AT+BTO if it has not been issued yet. Use AT+BTS? to read it back from non-volatile store. Response: OK If the service name cannot be set for any reason then an error response ERROR 11 is returned. 2.2.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 2.2.45 AT+BTT? Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 17 of 38 {List Trusted Devices} 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.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 2.2.49 AT+BTR? Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 18 of 38 {Display Peer Address} This command is used to display the peer address stored in non-volatile storage, used to put the module in pure cable replacement mode. Response: 12346789012 OK If the location is empty the the response is as follows. Response: 00000000000 OK 2.2.
Bluetooth Serial Module AT Command Set Date : 3. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 19 of 38 Unsolicited Responses The ‘AT’ Protocol is a command/response type of protocol. This means that the TDK Serial Module will normally only respond to AT commands. Under special circumstances, unsolicited responses will be sent to the host. They are described in the following subsections. 3.
Bluetooth Serial Module AT Command Set Date : 4. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 20 of 38 Incoming Connections The serial module can be configured using the AT+BTP or AT+BTG command so that it will scan for incoming connections from other Bluetooth devices. When the lower layers detect an incoming call, a RING 123456789012 string is sent to the host every second. The command ATA is used to accept the connection and ATH to reject it.
Bluetooth Serial Module AT Command Set Date : 5. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 21 of 38 Dropping Connections In a conventional telephony modem, a call is normally terminated by first sending a +++ character sequence enveloped by an escape sequence guard time (of the order of 100 to 1000 milliseconds) and then the ATH command. This device will provide a couple of ways of dropping a connection.
Bluetooth Serial Module AT Command Set Date : 6. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 22 of 38 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.
Bluetooth Serial Module AT Command Set Date : 7. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 23 of 38 Error Responses All error responses from the device will be in the form ERROR nn, where nn will be a number in the range 00 to 99. There shall be leading 0s if the error value is less than 10.
Bluetooth Serial Module AT Command Set Date : 8. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 24 of 38 Pin Out The TDK Bluetooth Serial Module is physically accessed via a 40 way mini-pci connector.
Bluetooth Serial Module AT Command Set Date : 9. 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 25 of 38 RS232 Signal Pin Mapping Just as a telephony modem has control and status lines, the TDK serial module also provides for 3 control and status lines as per the table below. The direction column is as seen from the module’s viewpoint.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 26 of 38 10. Power Consumption and Reset 10.1 Reset The module can be reset by the host without the need of any i/o using a BREAK signal. The module has been configured to reset when the RX line detects a break condition for durations greater than 100 milliseconds. 10.2 Power Consumption The current drain from the Vcc power input line is dependent on various factors.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Connected Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 27 of 38 Max data transfer All current consumption values in the table below assume that the connection status indication functionality of the Leds has been disabled by setting S Registers 533 and 534 to 0. All current values are in milliamps.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 28 of 38 11 Pure Cable Replacement Mode 11.1 Data Cable The module has the capability of being preset into a pure 5-wire data cable replacement mode. The 5 wires being RX,TX,CTS,RTS and GND. This mode requires no changes to a host application since the Bluetooth connection is automatically setup on power up and will retry when the connection drops.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 29 of 38 When the units are next power cycled, the slave unit will wait for the master to connect to it and the master will continually look for the slave. If a connection attempt fails, the master will wait for 2 seconds before reattempting a connection. This 2 second delay can be varied by issuing it an ATS530 command with an appropriate value in the range 100ms to 15000ms.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 30 of 38 12. Frequently Asked Questions 1. I know my mobile phone’s Bluetooth address and have successfully paired as detailed in Chapter 6. When I try to make a connection using ATD it always fails? Mobile phones are very security conscious, so always insist on authenticated connections. So to make a connection, use the ATDU variant of the command. 2.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 31 of 38 9. After a successful connection, I want to remain in command mode so that I can send more AT commands and then when done, go to online mode by issuing the ATO command Set S Register 531 to 1 10. When in connected and online mode, I want to drop into command mode using the more usual +++ escape sequence instead of ^^^ Set S Register 2 to 43 11.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 32 of 38 13. Development Motherboard TDK have developed a motherboard which allows the serial module to be connected directly to a PC. This motherboard provides RS232 level conversion and a standard 9 way D-Type connector.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 33 of 38 The pin-out for the 9 way serial connector is as per the table below, and the direction is as seen from the serial modules point of view. Pin No.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 34 of 38 In the case of a peripheral which has a 5 wire uart interface consisting of RX,TX, and GND and the hardware handshaking flow control lines CTS and RTS. The cabling between it and the serial module should be as shown in the diagram below. The RTS/CTS flow control will be handled by the serial module.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 35 of 38 14. Use Cases 14.1 Example 1: Light Switch Controller 14.1.1 Background A small microcontroller controlling a single light switch. The microcontroller’s serial port is connected to the serial module and a digital output line drives a relay which controls a light. The remote host sends the text “ON” to switch on the relay and “OFF” to switch it off. 14.1.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 36 of 38 14.2 Example 2: Remote Data Logger 14.2.1 Background A data logger on a remote site gathers data which is then transferred to a central site via a Bluetooth enabled phone.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 37 of 38 14.3 Example 3: Trusted Device Management 14.3.1 Background Bluetooth provides for secure connections through the use of link keys. The link keys are 128 bit entities which are uniquely created for each BT device via the device’s Bluetooth address. Since all BT addresses are unique, this results in unique keys.
Bluetooth Serial Module AT Command Set Date : 3 Feb 03 Issue No : 1.9 Doc No : XRBLU020-001SW-0 Page 38 of 38 14.3.5 Store link key in trusted device database (full) This process assumes that the procedure described in “Obtain a new link key” has been done and there exists a link key in the cache, and that the database is full. AT Command AT+BTT ATI6 AT+BTT? AT+BTD123456789016 AT+BTT Response ERROR 8 OK 123456789015 123456789016 ….