Ezurio 411B Bluetooth Data Module User Manual LWS UM BTM410 411 1009 indd
Ezurio Ltd Bluetooth Data Module LWS UM BTM410 411 1009 indd
Ezurio >
User Manual
BTM410/411 DATA MODULE USER MANUAL www.lairdtech.com Innovative Technology for a Connected World BTM410/411 Bluetooth® AT Data Module REVISION HISTORY www.lairdtech.com REVISION HISTORY Revision Description Laird Technologies BTM410/411 Bluetooth® AT Data Module TABLE OF CONTENTS CONTENTS BTM410/411 Bluetooth® Module ..4 Application Examples ..................36 Overview .............................................. 4 BTM410/411 Key Features ................... 4 RS232 Modem Signals ....................... 36 Modem Signaling over Bluetooth® ..... 37 Pure Cable Replacement Mode .......... 37 Audio Cable (Voice) ........................... 38 Specifications ................................5 Detailed Specifications ......................... 5 Pin Definitions ...................................... 7 Operating Parameters ...................8 Voltage Specifications .......................... 8 Configuring the BTM410/411 ........9 AT Command Set .............................. 10 Assumptions ...................................... 10 Commands ........................................ 10 Unsolicited Responses ........................ 30 Incoming Connections ........................ 31 Pairing and Trusted Devices ............... 32 Error Responses .................................. 33 Factory Default Mode ........................ 34 Miscellaneous Features ....................... 34 Disclaimers ......................................... 35 www.lairdtech.com Modem Control and Status Signals .... 39 Mechanical Drawings ..................40 Mechanical Details ............................. 40 Recommended PCB Footprint ............ 41 Notes for PCB Layout ......................... 41 Diagrams ............................................ 42 Ordering Information ..................44 Product Part Numbers ........................ 44 General Comments ............................ 44 Laird Technologies BTM410/411 Bluetooth® AT Data Module OVERVIEW AND KEY FEATURES The BTM410 and BTM411 Bluetooth® modules from Laird Technologies have been designed to meet the needs of developers who wish to add robust, short range Bluetooth data connectivity to their products. They are based on the market leading Cambridge Silicon Radio BC04 chipset, providing exceptionally low power consumption with outstanding range. They support the latest Bluetooth® Version 2.1 Specification, providing the important advantage of Secure Simple Pairing, which improves security and enhances the ease of use for end customers. With physical sizes as small as 12.5 x 18.0mm and best of class, low-power operation, these modules are the ideal choice for applications where designers need both performance and minimum size. For maximum flexibility in systems integration, the modules are designed to support a separate power supply for I/O. To aid product development and integration, Laird Technologies has integrated a complete Bluetooth protocol stack within the modules, including support for the Bluetooth Serial Port Profile. The modules are fully qualified as Bluetooth End Products, allowing designers to integrate them within their own products with no further Bluetooth Qualification. They can then list and promote their products on the Bluetooth website free of charge. Future releases include support for the Bluetooth Health Device Profile, making this module the ideal choice for manufacturers who are developing Continua Health Alliance compliant devices. A comprehensive AT command interface is included, which simplifies firmware integration. Combined with a low cost developers kit, this ensures that the choice of Laird Technologies Bluetooth modules guarantees the fastest route to market. FEATURES AND BENEFITS • Bluetooth® v2.1+EDR • Adaptive Frequency Hopping to cope with interference from other wireless devices • Secure Simple Pairing support • External or internal antenna options • Comprehensive AT interface for simple programming • Bluetooth® END Product Qualified • Compact size • Class 2 output – 4dBm • Low power operation • UART interface • Multi-point support • PCM and SCO for external codec • GPIO lines under AT control • Support for Serial Port Profile • Support for Health Device Profile (Q3 ‘09) • Wi-Fi co-existence www.lairdtech.com APPLICATION AREAS • • • • Embedded Devices Phone Accessories Security Devices Medical and Wellness Devices • Automotive Applications • Bluetooth® Advertising • ePOS Laird Technologies BTM410/411 Bluetooth® AT Data Module SPECIFICATIONS CATEGORIES Wireless Specification FEATURE IMPLEMENTATION Bluetooth® Version 2.1+EDR Transmit Class Class 2 Frequency 2.402 – 2.480 GHz 79 channels Frequency Hopping Adaptive Frequency Hopping +4 dBm at antenna pad – BTM410 +4 dBmi from integrated antenna – BTM411 (provisional) -27 dBm at antenna pad – BTM410 -27 dBmi from integrated antenna – BTM411 (provisional) -84dBm Channels Max Transmit Power Min Transmit Power Receive Sensitivity Antenna Modes UART Interface Range Up to 50 metres free space Data Transfer Rate Up to 300 kbps External Antenna 50 Ohm matched SMT pad – BTM410 Integrated Antenna (option) +0dBi multilayer ceramic – BTM411 (provisional) RS-232 bi-directional for commands and data 16550 compatible Configurable from 1,200 to 921,600bps Non-standard baud rates supported Serial Interface Baud Rate Bits General Purpose Interface Audio Parity Odd, even, none Stop bits 1 or 2 Default Serial parameters 9600,n,8,1 Levels Set by VDD_USB input Modem Control DTR, DSR, DCD, RI, RTS, CTS I/O 8 general purpose I/O pins Support 3 PCM Channels @ 64kbps SCO Channels Support SCO and eSCO Configurable as master or slave 8 bit A-law 8 bit μ-law 13 bit linear PCM Clock available when in slave mode V2.1 compliant. Fully integrated. GAP (Generic Access Profile) SDP (Service Discovery Profile) SPP (Serial Port Profile) HDO (Health Device Profile) – 2009 release Available over UART Point to point (cable replacement) Multipoint – max 3 slaves PCM Interface Protocols and Firmware Bluetooth Stack Profiles Firmware Upgrade Connection Modes www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module SPECIFICATIONS CATEGORIES Command Interface Current Consumption Supply Voltage FEATURE Multipoint Software Data Transfer Typically 32mA AT Instructions set Low Power Sniff Mode Less than 2.5mA Supply 3.0V – 3.3V DC I/O 1.7V – 3.3V DC (independent of Supply) USB & UART 1.7V – 3.6V DC (independent of Supply) 2-wire and 3-wire hardware coexistence schemes supported Surface Mount Pads Coexistence / Compatibility WLAN (802.11) Connections Interface External Antenna (BTM410) Physical Dimensions Weight Environmental Approvals Development Tools www.lairdtech.com Pad for 50 Ohm antenna 12.5mm x 18.0 x 1.6mm BTM410 12.5mm x 24.0mm x 1.6mm BTM411 (provisional) 3 grams Operating Temperature -30°C to +70°C Storage Temperature -40°C to +85°C Bluetooth CE & R&TTE Qualified as an END product Meets FCC requirements Modular Approval (Integrated Antenna option – BTM411) Meets CE and R&TTE requirements Lead free Lead-free and RoHS compliant Warranty 12 Months Development board and software tools DVK-BTM410 Dev Kit with BTM410 module fitted DVK-BTM411 Dev Kit with BTM411 module fitted FCC Miscellaneous IMPLEMENTATION Comprehensive control of connection and module operation S Registers for non-volatile storage of parameters Supports multiple connections Development Kit Laird Technologies BTM410/411 Bluetooth® AT Data Module SPECIFICATIONS PIN SIGNAL 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 Unused GND UART_CTS UART_RXD UART_RTS UART_TXD GND SPI_CSB SPI_MISO SPI_MOSI SPI_CLK VDD_USB VDD_IO VDD_IN GND PCM_IN PCM_SYNC PCM_CLK PCM_OUT RESET GPIO5 GPIO3 / UART_DCD GND Unused Unused Unused Unused GND ANT (BTM410) GND Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused GND GPIO2 / UART_RI GPIO9 /UART_ DTR GPIO10 / UART_DSR GND DD+ GPIO7 GPIO6 GPIO4 Note: www.lairdtech.com DESCRIPTION VOLTAGE SPECIFICATION Clear to Send I/P Receive data I/P Request to Send O/P Transmit data O/P VUSB VUSB VUSB VUSB SPI bus chip select I/P SPI bus serial O/P SPI bus serial I/P SPI bus clock I/P USB & UART supply voltage I/O supply voltage Main supply voltage VIO VIO VIO VIO PCM clock I/P PCM sync I/P PCM clock I/P PCM Data O/P Module reset I/P I/O for host I/O for host VIO VIO VIO VIO See note 2 VIO VIO Antenna connection (50 ohm matched) I/O for host I/O for host I/O for host VIO VIO VIO Not used for AT module variants Not used for AT module variants I/O for host I/O for host I/O for host VUSB VUSB VIO VIO VIO 1. Unused pins may have internal connections and must not be connected. 2. Reset input is active low. Input is pulled up to VDD_IN via 22k. Minimum reset pulse width is 5ms. Laird Technologies BTM410/411 Bluetooth® AT Data Module OPERATING PARAMETERS OPERATING PARAMETERS RECOMMENDED OPERATING CONDITIONS OPERATING CONDITION MIN MAX VDD_USB (USB compatibility not required) 1.7 3.6 VDD_USB (USB compatibility required) 3.1 3.6 VDD_IO 1.7 3.3 VDD_IN 3.0 3.3 VOLTAGE SPECIFICATIONS LOGIC LEVELS (VUSB) INPUT VOLTAGE LEVELS Vih Vil MIN TYP MAX 0.7VDD_IO 1.7in descriptions below this cannot be changed. 2. All responses from the 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 . 3. All Bluetooth addresses are represented by a fixed 12 digit hexadecimal string, case insensitive. 4. All Bluetooth Device Class codes are represented by a fixed 6 digit hexadecimal string, case insensitive. Commands This section describes all available AT commands. Many commands require mandatory parameters and some take optional parameters. These parameters are either integer values, strings, Bluetooth addresses or device classes. The following convention is used when describing the various AT commands. A 12 character Bluetooth address consisting of ASCII characters ‘0’ to ‘9’, ‘A’ to ‘F’ and ‘a’ to ‘f’. A 6 character Bluetooth device class consisting of ASCII characters ‘0’ to ‘9’, ‘A’ to ‘F’ and ‘a’ to ‘f’. A positive integer value. An integer value which could be positive or negative, which can be entered as a decimal value or in hexadecimal if preceded by the ‘$’ character. E.g. the value 1234 can also be entered as $4D2 A string delimited by double quotes. E.g. “Hello World”. The “ character MUST be supplied as delimiters. A 4 character UUID number consisting of ASCII characters ‘0’ to ‘9’, ‘A’ to ‘F’ and ‘a’ to ‘f’. 1. ^^^ {Enter Local Command Mode} When in data 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. By default the guard time is set to 100 milliseconds. Please refer to Section 5: Dropping Connections for more related information. In modems this escape sequence is usually “+++”. “^^^” is specified to avoid confusion when the module is providing access to a modem. Response: OK 2. !!! {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 specified 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 step 12) For this command to be effective S Register 536 must be set to 1. Response: OK 10 www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 3. AT Used to check the module is available. Response: OK 4. ATA {Answer Call} Accept an incoming connection, which is indicated by the unsolicited string RING 123456789012 every second. 123456789012 is the Bluetooth address of the connecting device. Response: CONNECT 123456789012 5. ATD , {Make Outgoing Connection} Make a connection to device with Bluetooth address and SPP profile . The is an optional parameter which specifies the UUID of the profile server to attach to, and if not supplied then the default UUID from S Register 101 is used. As this is a device which utilises the RFCOMM layer as described in the Bluetooth specification, it necessarily implies that only profiles based on RFCOMM can be accessed. If is not specified, then authentication is as per register 500, otherwise the connection will be authenticated. If is not specified, then encryption is as per register 501, otherwise the connection will have encryption enabled. The timeout is specified by S register 505. Response: CONNECT 123456789012 Or NO CARRIER Due to a known issue in the Bluetooth RFCOMM stack, it is not possible to make more than 65525 outgoing connections in a single power up session. Therefore if that number is exceeded, then the connection attempt will fail with the following response:Response: CALL LIMIT Or NO CARRIER In that case, issuing an ATZ to reset the device will reset the count to 0 and more connections are possible. The following RFCOMM based UUIDs are defined in the Bluetooth Specification:- 11 www.lairdtech.com PROFILE NAME UUID Serial Port 0x1101 LAN Access Using PPP 0x1102 Dialup Networking 0x1103 IrMC Sync 0x1104 OBEX Object Push 0x1105 OBEX File Transfer 0x1106 IrMC Sync Command 0x1107 Headset 0x1108 Cordless Telephony 0x1109 Intercom 0x1110 Fax 0x1111 Audio Gateway 0x1112 WAP 0x1113 WAP_CLIENT 0x1114 Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 6. ATD L {Remake Connection} Make a connection with the same device and service as that specified in the most recent ATD command. The modifiers are optional. An error will be returned if the ‘L’ modifier is specified AND a Bluetooth address. If both ‘L’ and ‘R’ modifiers are specified then an error will be returned. Response: CONNECT 123456789012 AE Or NO CARRIER 7. ATD R {Make Connection to peer specified in AT+BTR} Make a SPP connection with the device address specified in the most recent AT+BTR command. The service is as specified in S Register 101. The modifiers are optional. An error will be returned if the ‘R’ modifier is specified AND a Bluetooth address. If both ‘R’ and ‘L’ modifiers are specified then an error will be returned. Response: CONNECT 123456789012 AE Or NO CARRIER 8. 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: OK Or Response: ERROR nn 9. ATH {Drop Connection} Drop an existing connection or reject an incoming connection indicated by unsolicited RING messages. Response: NO CARRIER 10. ATIn {Information} This will return the following information about the Laird Technologies device. 12 www.lairdtech.com I0 The product name/variant. I1 The CSR firmware build number. I2 The Laird Technologies firmware build number. For internal use only. I3 The Laird Technologies firmware revision. I4 A 12 digit hexadecimal number corresponding to the Bluetooth address of the device. I5 The manufacturer of this device. I6 The maximum size of trusted device database. I7 The manufacturer of the Bluetooth chipset. I8 The chipset format. I9 0 if not in a connect state and 1 if in a connect state. Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 I11 The reason why a “NO CARRIER” resulted in the most recent attempt at making an outgoing connection. Where the response values are as follows: 0 = No prior connection 1 = Connection timeout 2 = Connection attempt cancelled 3 = Normal disconnection 4 = Peer device has refused connection 5 = Service profile requested not available on remote device 6 = Connection has failed 32 = ATH was entered 33 = Incoming connection aborted because too many rings 34 = Unexpected incoming connection 35 = Invalid address 36 = DSR is not asserted 37 = Call limit of 65531 connections has been reached 38 = Pairing in progress 39 = No link key 40 = Invalid link key 255 = Unknown Reason I12 I13 The last ERROR response number. The Sniff status is returned as follows:Response: a:b,c,d,e OK Where ‘a’ = 0 when not online and 1 when online and Sniff has been enabled, ‘b’ is the Sniff Attempt parameter, ‘c’ is the Sniff timeout parameter, ‘d’ is the minimum sniff interval and ‘e’ is the maximum sniff interval. All parameters ‘b’, ’c’, ’d’ and ‘e’ are given as Bluetooth slots which are 625 microseconds long converted from values of S Registers 561, 562, 563 and 564 respectively. I14 The current boot mode (Only for firmware 1.18.0 and newer) I15 The maximum length of an AT command, including the terminating carriage return (only for firmware 1.6.10 and newer) I16 The size of AT command input buffer I20 Returns the number of bytes pending to be sent in the rf buffer when a connection is up. I33 Version number of Multipoint application (Note: ATI is provided for compatibility in multipoint mode, other AT commands are not available). I42 State information. Where the response values are as follows: 13 = NotOpen 14 = OpenIdle 15 = Ringing 16 = OnlineCommand 172 to 177 = waiting for connectable and/or discoverable where the lowest significant digit equates to the value stored in S Register 512 or 555. Note when n=16, ATI9 will return 1. 13 www.lairdtech.com I101 The RSSI value in dBm. If a connection does NOT exist then a value of -32786 is returned. A value of 0 means the RSSI is within the golden range this is quite a large band, therefore RSSI is not always a useful indicator. Use ATI111 instead which returns the bit error rate. I111 Returns LinkQual which in the CSR chipset is defined as BER (bit error rate). This returns a value which is the number of bits in error out of 1 million. Hence a value of 0 is best, and larger values are worse. As the value approaches 1000 (BER = 0.1%) it is an indication that the link is very bad and a large number of Bluetooth packets are being lost. Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 For recognised values of n. All other values of n will generate an error. Response: As Appropriate OK Or Response: ERROR nn 11. 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 connection. Response: CONNECT 123456789012 Or Response: ERROR nn 12. ATSn=m {Set S Register} 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, 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 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. REGISTER DEFAULT RANGE COMMENT S0 Number of RING indication before automatically answering an incoming connection. A value of 0 disables autoanswer. If -1, then autoanswer on one RING and do NOT send RING/CONNECT response to the host. This emulates a serial cable replacement situation. -1..15 Setting values >= 0, resets S Register 504 to 0 and <0 forces 504 to 1. If S0 <> 0 and S100 <> 0 then S0 must be < S100. If a value is entered which violates this rule, then ERROR 29 is sent in response. If S504 =1 then this register will return -1, regardless of the actual value stored in non-volatile memory. S2 0x5E 0x20..0x7E 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. 0x5e 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 S100 15 0..15 Number of RING indications before an auto disconnection is initiated. A value of 0 disables this feature. If S0 <> 0 and S100 <> 0 then S0 must be < S100. If a value is entered which violates this rule, then ERROR 29 is sent in response. S101 $1101 0..$ffff S102 UUID of default SPP based profile when not specified explicitly in the ATD command. Defines a set of bits masks for enabling profile servers. Values can be ORed. 1 is the default and only value allowed for this module which enables Serial Port Profile S103 1..7 Boot Mode on cold boot. S126 0 .. 0xFFFF Primer for changing to Multipoint mode S127 0 .. 0xFFFF 0x100 for At mode 0x200 for Multipoint mode Other values are reserved 14 www.lairdtech.com S500 0..1 Authentication for outgoing connections. Set to 1 to Enable Authentication. S501 0..1 Encryption for outgoing connections. Set to 1 to Enable Encryption. S502 0..1 Authentication for incoming connections. Set to 1 to Enable Authentication. S503 0..1 Encryption for incoming connections. Set to 1 to Enable Encryption. Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 REGISTER DEFAULT RANGE COMMENT S504 Setting to 1 will force S0 to -1 and will suppress messages arising from connections or pairing. E.g. CONNECT, NO CARRIER, RING, PAIR etc. 0..1 Suppressing connection based messaged allows the device to be configured in cable replacement mode. S505 10 2..120 Minimum delay before abandoning connection attempt as a master. Referenced by ATD. In units of seconds. See S Registers 530 and 543 also. Please note that as disconnection time can vary, this register only guarantees the minimum delay. Note that for invalid addresses specified in the ATD command, the “NO CARRIER” response will be immediate. See S register 560 for specifying disconnect max timeout. S506 0..1 Enable/Disable echoes. The ATEn command also affects this. S507 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 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 For the Go blue Activator variant this can only be set to 0. S508 640 10..2550 Page Scan Interval in milliseconds. Minimum is 11.25ms so 10/11ms will give 11.25ms. S509 320 10..2550 Page Scan Window in milliseconds. Minimum is 11.25ms so 10/11ms will give 11.25ms. S510 640 10..2550 Inquiry Scan Interval in milliseconds. Minimum is 11.25ms so 10/11ms will give 11.25ms. S511 320 10..2550 Inquiry Scan Window in milliseconds. Minimum is 11.25ms so 10/11ms will give 11.25ms. S512 0..7 Specify power up state. When set to 0, AT+BTO is required to open the device for Bluetooth activity. When set to 1, it proceeds to a state as if AT+BTO was entered. When set to 2, it will be discoverable only, similar to issuing AT+BTQ. When set to 3, it will be connectable but not discoverable e.g. AT+BTG When set to 4, it will be connectable and discoverable e.g. AT+BTP. When set to 5, it will be like 2, but all UART RX traffic is discarded in absence of a connection while DSR is asserted. If DSR is not asserted, then it behaves exactly as per mode 2. When set to 6, it will be like 3, but all UART RX traffic is discarded in absence of a connection while DSR is asserted. If DSR is not asserted, then it behaves exactly as per mode 3. When set to 7, it will be like 4, but all UART RX traffic is discarded in absence of a connection while DSR is asserted. If DSR is not asserted, then it behaves exactly as per mode 4. Note that by implication, a change to this can only be seen after a power cycle AND if AT&W is actioned prior to the power cycle. If S Reg 554 is non-zero and this register is between 2 and 7 inclusive, then the value of S554 specifies the time in seconds that the device will remain in the specified mode after power up. On timeout, the device will fall back to the mode specified in S Register 555. S512 continued…. In some firmware builds, S Registers 565 to 569 inclusive are visible, which allows the start-up mode to depend on the state of RI line (Setting S Reg 565 forces the RI pin to be configured as an input). For this feature to be active, SReg 565 should be set to 1. In that case, on start-up, if RI is asserted, then the start-up mode is defined by S Reg 566 and if deasserted then S Reg 567. 15 www.lairdtech.com S513 0..1 Pairing Authentication, 1 = Enable S514 10 1..60 Pairing Timeout in seconds. This includes the time a host takes to supply the PIN number when PIN? messages are indicated. Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 REGISTER DEFAULT RANGE COMMENT S515 Default Device Class Code to be used with AT+BTO when it is not explicitly specified. When queried, the value is always printed as a hexadecimal number. 0x001F00 0.. 0xFFFFFF To change the device class of the module, after AT+BTO, use the command AT+BTC. S516 0x000000 0..0x2FFFFFF Default Device Class filter to be used with AT+BTI when it is not explicitly specified. When queried the value is always printed as a hex number. The seventh most significant digit, can be 0,1 or 2, and is used to specify the type of device class filter. When 0, it specifies no filtering. When 1, it specifies an AND mask and all 24 bits are relevant When 2, it specifies a filter to look for devices with matching major device class which occupies a 5 bit field from bits 8 to 12 inclusive (assuming numbering starts at bit 0). All other 19 bits MUST be set to 0. S517 20 2..61 Inquiry Length in units of seconds. This parameter is referenced by the AT+BTI command S518 0..255 Maximum number of responses from an inquiry request. This parameter is reference by the AT+BTI command. If this number is set too high, then AT+BTI will return ERROR 27. For a particular firmware revision, determine the effective maximum value by trial and error. That is, set to a high value, send AT+BTI and if ERROR 27 is returned, then retry with a smaller value. This effective max value will remain unchanged for that particular firmware build. S519 500 100..6000 When S507>0, and in a connection, DSR can be used to change from data to command state by deasserting the DSR line for less than the time specified in this register. This value is rounded down to the nearest 100ms S520 9600 1200..115200 Change to a standard baud rate. The effect is immediate and in fact the OK will be sent at the new baud rate. Only one of the following baud rates are accepted: 1200,2400,4800,9600,19200,28800,38400,57600,115200. S521 See Comment 1200..921600 Change baud rate to non-standard value. Laird Technologies’ modules support any baud rate. The only limitation is the integer arithmetic involved, which may adjust the applied rate slightly. If the internally computed baud rate is more than 2% offset from the desired input value, then an ERROR will be returned and the old baud rate will prevail. To inspect the actual baud rate, do ATS521? S521 should only be used for non-standard baud rates. For standard baud rates use S520. The effect is immediate and in fact the OK will be sent at the new baud rate. In the event that a non-standard baud rate is requested, it is entirely possible that the host is not capable of generating such a baud rate. In this case the device cannot be communicated with. If this happens, there is a procedure to recover from this situation which is described in section titled “Factory Default Mode” S522 1 = CTS/RTS hardware handshaking enabled S523 1..2 Number of Stop bits S524 0..2 Parity. 0=None, 1=Odd, 2=Even S526 1..3 This register specifies a 2 bit mask used to qualify how S Registers 520 to 524 are actioned. When bit 0 is 1, the new comms parameter affects the UART immediately. When bit 1 is 1, the new comms parameter is stored in non-volatile memory So for example, to change comms parameters, but have them come into effect only after subsequent power cycles, then this register should be set to 2, and likewise to affect immediately and yet not have it persist over a power cycle, the value should be set to 1. Must be set before the baud rate change. S530 16 www.lairdtech.com 1000 100..15000 Reconnect delay when configured as master in pure-cable-replacement mode. This value is rounded down to the nearest 100ms. See S Register 505 and 543 also Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 REGISTER DEFAULT RANGE COMMENT S531 Specifies the mode on connection establishment. 0..5 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 asynchronous response. 4 = LOCAL_COMMAND and on the rf side, the gpio is automatically sent when there is a change in input. See section 9.5 for more details. 5 = DEAMON mode S532 0..7 If non zero then on every connection, a SCO channel (audio) will be initiated. Bit 0 for HV1, Bit1 for HV2 and Bit2 for HV3. When the connection is lost, the SCO channel disappears along with it. S533 0..2 If set to 1 then GPIO5 follows RI state, if set to 2 then it follows the state of DSR and if 0 it is not driven and GPIO5 is available as a user I/O. This register will not necessarily be effective immediately after changing the value. It must be saved to non-volatile memory using AT&W and will operate as expected after an ATZ or a power cycle. S534 0..2 When set to 0, GPIO4 is available as user i/o If set to 1 then GPIO4 follows DCD state. If set to 2 then GPIO4 behaves as per setting 1, but in addition, when not in a connection, if the device is connectable or discoverable, then GPIO4 will blink. This register will not necessarily be effective immediately after changing the value. It must be saved to non-volatile store using AT&W and will operate as expected after an ATZ or a power cycle. S535 20 0..41 Link Supervision Timeout. If units go out of range, then a NO CARRIER message will be sent to the host after the time specified here S536 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. S538 0..1 If 1, then when a successful pairing occurs, it is automatically saved in the trusted device database – if it has room to store it. S539 0..1 When set to 1, in idle mode (S512=1), UART Rx characters are discarded if DSR is deasserted. S540 0 48..127 Sets the MTU in L2CAP configuration negotiations. The value of 0 is a special value which is taken to mean that the current value should remain. S541 -50..6 This sets the power level in dBm when inquiring or paging. Reading this register returns the value stored in non-volatile memory. S542 -50..6 As per S541, however reading this register returns the current power level as set in the base band. The read can be different from S541because the actual power is set using a lookup table and the base band rounds down to the nearest value in the table. S543 0..1 If this is set to 1, then incoming pairing attempts will be accepted (if a pin code has been pre-entered using AT+BTK) while in the wait phase of auto connect cycle initiated by the AT+BTR command. In addition to accepting pairing attempts, if the pairing is successful, then the new device is automatically set as the peer address for automatic connections (as if an explicit AT+BTR command was entered). S544 0..1 See S Register 505 and 530 also 17 www.lairdtech.com Configure the UART for either low latency or maximum throughput. A setting of 1 gives maximum throughput. Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 REGISTER DEFAULT RANGE COMMENT S551 This register specifies in each 4 bit nibble, how the outgoing modem status bits to the remote peer gets its value. Bluetooth allows for RTR, RTC, DV and IC bits to be exchanged over an RFCOMM connection. 0x3211 0xFFFF Nibble 0..3 specifies the source for RTC 4..7 specifies the source for RTR 8..11 specifies the source for DV (i.e. DCD) 12..15 specifies the source for IC (i.e. RI) Each nibble can take the following value:0 Always set to 0 1 Always set to 1 2 If DCD (pin 8 on module connector) is output then always 1 If DCD is input then 1 if DCD is asserted otherwise 0 3 If RI (pin 6) is output then always 0 If RI is input then 1 if RI is asserted otherwise 0 4 If DSR (pin 10) is asserted then 1 otherwise 0 In the event that a nibble specifies DSR as the source of its state, be aware that if, S Register 507 is anything other than 0, a de-assertion of DSR will cause the Bluetooth connection to be dropped. If bits 0..3 and 4..7 are set to 0, then some Bluetooth devices will use that as a signal to stop sending any data back. For example, Nokia 6310 stops responding. If this register is changed while in command and connected mode, then on going back online using the ATO command, a fresh signal will be sent to the peer to update the bits. S552 0x0122 0x0FFF This register specifies in each 4 bit nibble, how the DTR, DCD, RI output pins are controlled when in a Bluetooth connection Nibble 0..3 specifies the source for DTR 4..7 specifies the source for DCD 8..11 specifies the source for RI Each nibble can take the following value:0 Do NOT touch the I/O 1 Always deassert 2 Always assert 3 If RTC bit in CONTROL_IND is 1 then assert otherwise deassert 4 If RTR bit in CONTROL_IND is 1 then assert otherwise deassert 5 If DV bit in CONTROL_IND is 1 then assert otherwise deassert 6 If IC bit in CONTROL_IND is 1 then assert otherwise deassert If this register is changed while in command and connected mode, then on going back online using the ATO command, the modem output lines will get refreshed. S553 0x0201 0x0FFF This register specifies in each 4 bit nibble, how the DTR,DCD,RI output pins are controlled when NOT in a Bluetooth connection Nibble 0..3 specifies the source for DTR 4..7 specifies the source for DCD 8..11 specifies the source for RI In addition it also refers to S Register 552 to see if the relevant pin is an input or not to be touched. If the nibble in 552 is 0, then the relevant pin is an input. Each nibble can take the following value:0 Always deassert 1 Always assert 2 Assert if RING is being sent to the host 18 www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 REGISTER DEFAULT RANGE COMMENT S554 If S Register 512>=2 and <=7 then this register specifies a time in seconds for which the device will stay in the S512 mode after power up or reset. On timeout, it will abort the discoverable and/or connectable and fall back into S512=1 mode, when it is deaf and dumb. 0..900 Note that if AT+BTR has been used to specify a peer device, then on reverting to mode 1, it will attempt to make a connection to that peer device. A power cycle, reset via BREAK or ATZ is required to see the effects of change. S555 1..7 If S Register 554 is nonzero, then after the post reset window expires, the mode will revert to the mode specified in this register. This allows, for example, the device to be discoverable and connectable on power up (mode 4 or 7) and on window timer expiry to revert to connectable only (mode 3 or 6). A power cycle, reset via BREAK or ATZ is required to see effects of a change. In some firmware builds, S Registers 565 to 569 inclusive are visible, which allows the start-up mode to depend on the state of RI line (Setting S Reg 565 forces the RI pin to be configured as an input). For this feature to be active, SReg 565 should be set to 1. In that case, on start-up, if RI is asserted, then the start-up mode is defined by S Reg 568 and if deasserted then S Reg 569. S556 0..3 Allows GPIO or ADC values to be read via the minor class field in an inquiry response. When this value is non-zero, bits2 to 7 contain information as follow:1 :- ADC1 2 :- ADC2 3 :- GPIO1 to GPIO6 Set to 0 to disable this feature. This allows i/o information to be conveyed without a connection. S557 32 4..900 Specified in seconds, the update interval for the feature enabled via S Reg 556 S558 0..1 When 1, the following responses; “RING”, “NO CARRIER” and “CONNECT” are replaced by “BTIN”, “BTDOWN” and “BTUP” respectively. This will eliminate ambiguity when the module has a Bluetooth connection to an AT modem which also gives these responses. S559 0..3 This specifies a mask. When Bit 0 is 1, the response word “ERROR“ is replaced by “BTERR” and “OK” is replaced by “ok”. When Bit 1 is 1, then error responses do not include the error number and instead the error number can be retrieved using ATI12. S560 15 15..120 Disconnect timeout in seconds. This timer specifies how long to wait for confirmation from the peer device and/or the underlying stack that the connection has been successfully torn down. There can be instances where a confirmation does not arrive and so in this case this timer is used to ‘close off’ the procedure and put the state machine back into a proper mode for new operations. S561 0..1000 Sniff Attempt Time in units of milliseconds. 0 means disable. S562 0..1000 S563 0..1000 S564 0..1000 Sniff Maximum Interval in units of milliseconds. See section “Power Consumption and Reset” in the user guide for more details. S565 If set to 1, RI (Ring Indicate) line is configured as an input and forces the start-up mode (SReg512) and post-timeout on Start-up mode (SReg555) to be dependent on the state of RI. The RI conditional modes are defined by SRegs 566 to 569 inclusive. S566 If S565=1, and RI is asserted then this is the mode the device will start up in. S567 If S565=1, and RI is deasserted then this is the mode the device will start up in. S568 If S565=1, and RI is asserted then this is the mode the device will assume after the post-start-up timeout defined in SReg 554 instead of mode defined in SReg555 Time is specified with 15 seconds intervals. See section “Power Consumption and Reset” in the user guide for more details. Sniff timeout Time in units of milliseconds. 0 means disable. See section “Power Consumption and Reset” in the user guide for more details. Sniff Minimum Interval in units of milliseconds. 0 means disable. See section “Power Consumption and Reset” in the user guide for more details. 19 www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 REGISTER DEFAULT RANGE COMMENT S569 If S565=1, and RI is deasserted then this is the mode the device will assume after the post-start-up timeout defined in SReg 554 instead of mode defined in SReg555 S583 0xB 0 .. 0x1F This specifies the initial state of the following modem control lines sent to the peer Bit 0 := RTC (DTR/DSR) Bit 1 := RTR (RTS/CTS) Bit 2 := IC (Ring Indicate RI) Bit 3 := DV (DCD) Bit 4 := FC (Reserved) S584 0..1 Enable/Disable eSCO When changing the unit returns ERROR 14 it implies the device is either in a connection or waiting for a connection and so the new value cannot be accepted. For the former, drop the connection, then issue the command AT+BTX and then set the new value and for the latter issue the command AT+BTX prior to setting the register. S585 0..9 GPIO pin set to 0 to disable the feature S586 1000 100..5000 Pulse period in milliseconds (rounded down to nearest multiple of 50) S587 0..100 Duty cycle in percent (rounded to the nearest multiple of 4) S588 0..1 After a disconnection, there will be a cold reset S589 0..F Codec output gain S590 0..3 Codec input gain S591 0..1FF Default GPIO output states when not in a connection. This is used when virtual digital i/o cable replacement mode is in operation S592 0..1 Set this to 1 to reduce the trusted device database to just 1 record when autosaving of pairing is enabled via S reg 538 S593 0..1 Automatically append last 6 digits of local bluetooth address to the friendlyname which was set via AT+BTN or AT+BTF S600 0..65535 Number of times this module has gone through a reset cycle. This feature is enabled by S Reg 601. S601 0..1 If this is 1, then on reset S Reg 600 value will be incremented. S610 0..7FFF Set direction of digital I/O lines. This is a mask made up of 5 bits. Setting a bit to 1 makes that I/O line an output. GPIO1 is bit 0, GPIO2 is bit 1, up to bit 4 for GPIO5. S611 Set to 1 to invert the logic of GPIO outputs. For example, ATS621=1 will set the output pin to low and vice versa. S620 n/a 0..31 Read/Write to all 8 Digital lines in one atomic step. The value is returned as a 4 digit hexadecimal value with trailing 0s. S621 n/a 0..1 Read/Write to GPIO1 S622 n/a 0..1 Read/Write to GPIO2 S623 n/a 0..1 Read/Write to GPIO3 S624 n/a 0..1 Read/Write to GPIO4 S625 n/a 0..1 Read/Write to GPIO5 S626 n/a 0..1 Read/Write to GPIO6 – Not available in Bism1 S627 n/a 0..1 Read/Write to GPIO7 – Not available in Bism1 S628 n/a 0..1 Read/Write to GPIO8 – Not available in Bism1 S629 n/a 0..1 Read/Write to GPIO9 – Not available in Bism1 S631 n/a 0..65535 When GPIO1 is configured as an input, low to high transitions are counted. There is no software debouncing. External RC circuit may be required. S632 n/a 0..65535 When GPIO2 is configured as an input, low to high transitions are counted. There is no software debouncing. External RC circuit may be required. Writing any value to this register will initialise it to a certain value The counter wraps to 0 when it overflows beyond 65535. The counter wraps to 0 when it overflows beyond 65535. 20 www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 REGISTER DEFAULT RANGE COMMENT S641 n/a 0..65535 As per 631, but the action of reading the value will reset the count to 0. S642 n/a 0..65535 As per 632, but the action of reading the value will reset the count to 0. S701 n/a 0..65535 Read/Write to Analogue Line 0, when reading value is returned in decimal S702 n/a 0..65535 Read/Write to Analogue Line 1, when reading value is returned in decimal S711 n/a 0000..FFFF Read/Write to Analogue Line 0, when reading value is returned in hexadecimal S712 n/a 0000..FFFF Read/Write to Analogue Line 1, when reading value is returned in hexadecimal S721 Set direction of Analogue Line 0 S722 S1001 to S1010 13. ATSn? Set direction of Analogue Line 1 0.. 2^32 10 General Purpose 32 bit Registers for use by host. These are stored in non-volatile memory. {Read S Register Value} 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 14. ATSn=? {Read S Register – Valid Range} This will return the valid range of values for register n. For recognised values of n Response: Sn:(nnnn..mmmm) OK For unrecognised values of n Response: 15. ATX ERROR nn {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 is any string not more than 24 characters long. If a non-visual character is to be sent then insert the escape sequence \hh where hh are two hexadecimal digits. The 3 character sequence \hh will be converted into a single byte before transmission to the peer. Response: 16. ATY OK {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 will all pending data in the output rf buffer be flushed out. The parameter is any string not more than 24 characters long. If a non-visual character is to be sent then insert the escape sequence \hh where hh are two hexadecimal digits. The 3 character sequence \hh will be converted into a single byte before transmission to the peer. Response: 21 www.lairdtech.com OK Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 17. ATZ {Hardware Reset and emerge into 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 PS store 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 mode (see command ATI14). ATZ1 to ATZ4 instructs the module to reset and then emerge into the appropriate boot mode. Note that S Reg 103 specifies the boot mode from cold. Response: 18. AT&Fn OK and OK is returned after the RESET {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 specified 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. &F6 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: OK Or Response: 19. AT&F* ERROR nn {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: OK Or Response: ERROR nn 20. 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: OK Or Response: 21. AT&W ERROR nn {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: OK Or Response: 22 www.lairdtech.com ERROR nn Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 22. AT+BTAn {Control Audio Channel} Once a Bluetooth connection is active, and assuming the peer device is also a Laird Technologies device, this command is used to start/stop a SCO channel which will connect the PCM interfaces of the two peer devices. This means that if a codec is attached to the PCM pins, then 2-way audio can be established. +BTA0 Switch off the channel. +BTA1 Switch on the channel. On receipt of the command, the following response immediately follows. Response: OK The lower layers then go through the process of setting up the SCO channel, and as soon as a SCO link is established, the following response is asynchronously sent to the host. Response: AUDIO ON Or if the SCO failed to be established. Response: AUDIO FAIL On the peer device, the host will asynchronously get …. Response: AUDIO ON 23. AT+BTC {Set Device Class Code} 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. is a 6 digit hexadecimal number derived as per section “1.2 The Class of Device/Service Field” of the Bluetooth specification “Bluetooth Assigned Numbers”. The 24 bits are made of 4 fields briefly described as follows (bit 0 corresponds to the least significant bit):Bits 0-1 Format Type. This field currently only has a value of 00 (i.e. format type 1) Bits 2-7 These 6 bits define the Minor Device Class and the value is interpreted differently based on the Major Device class stored in the next 5 bits. Bits 8-12 These 5 bits define the Major Device Class as per Table 1.3 in “Bluetooth Assigned Numbers” Bits 13-23 This is an 11 bit field used as a mask to define the Major Service Class, as per Table 1.2 in “Bluetooth Assigned Number” Laird Technologies devices do not map to any predefined Major Service Class or Major Device Class and so the default devclass as shipped is 001F00, which means no Major Service Class and “Unclassified” Major Device class. Other examples of device class codes are follows:CODE (HEXADECIMAL) NAME 001F00 Unclassified None Unclassified n/a 200404 Headset Audio Audio Headset Response: MAJOR SERVICE MAJOR DEVICE MINOR DEVICE OK Or for an invalid value (usually a value which is not 6 hexadecimal characters long). Response: ERROR 08 24. AT+BTC? {Read Device Class Code} This command is used to read the current device class code. Response: 123456 OK 23 www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 25. AT+BTD {Remove Trusted Device} This command is used to remove the specified 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: 26. AT+BTD* OK {Remove All Trusted Devices} This command is used to remove all devices from the list of trusted devices in the non-volatile database. No confirmation will be asked for. So beware!!! WARNING: If you make an authenticated connection, the link key gets cached in the underlying stack. So if you subsequently delete the key using AT+BTD* and immediately request an authenticated connection to the same device, then the connection will be established. To ensure this does not happen, either send ATZ after the AT+BTD* OR send AT+BTD for each item in the trusted device database. Response: OK 27. AT+BTF= {Set Friendly Name} This sets the friendly name of this device as seen by other devices Response: OK 28. AT+BTF {Get Remote Friendly Name} This command gets the remote friendly name of the peer specified. Response: ,”Friendly Name” OK 29. AT+BTG {Enable Cautious Page Scanning ONLY} Enable page scanning and wait for a connection from device with Bluetooth address . If the specified address is 000000000000 then incoming connections are accepted from any device, is as per AT+BTP without an address. Inquiry Scans are disabled. This command also has variants which allow authentication and encryption to be explicitly specified. For example:AT+BTGU123456789012 AT+BTGY123456789012 AT+BTGUY123456789012 AT+BTGYU123456789012 Response: 30. AT+BTG OK {Enable Promiscuous Page Scanning ONLY} Enable page scanning only and wait for a connection from any device. Inquiry scans are disabled. Authentication and Encryption is as per S registers 502 and 503. Response: 31. AT+BTGU OK {Enable Promiscuous Page Scanning ONLY} Enable page scanning only and wait for a connection from any device. Inquiry scans are disabled. Authentication is enabled and encryption is disabled. Response: 24 www.lairdtech.com OK Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 32. AT+BTGY {Enable Promiscuous Page Scanning ONLY} Enable page scanning only and wait for a connection from any device. Inquiry scans disabled. Authentication is disabled and encryption is enabled. Response: 33. AT+BTGUY OK {Enable Promiscuous Page Scanning ONLY} Enable page scanning only and wait for a connection from any device. Inquiry scans are disabled. Authentication and encryption are both enabled. The order of U and Y is not significant. Response: OK 34. AT+BTI {Inquire} This will make the device perform an inquiry for device class code for delay milliseconds and max number of unique responses, where delay is specified by S register 517 and max is specified by S register 518. The is an optional parameter where the value specifies either a 6 digit device class code or a 2 digit major device class. If it is not specified, then the value is taken from S register 516. When is 6 hexadecimal characters long, it specifies an AND mask which is used to filter inquiry responses. When is 2 hexadecimal characters long, it forces the inquiry to filter responses to devices that match their major device class code to this value – which can only be in the range 00 to 1F. Response: 12346789012 12345678914 OK If the module is waiting for an incoming connection, (entered via AT+BTP, AT+BTG, AT+BTQ), then it will respond with ERROR 14. To perform the inquiry, send AT+BTX to put the module back into idle mode. Response: ERROR 14 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. 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. Response: ERROR 27 35. AT+BTIV {Inquire} As per AT+BTI but the response includes the device class code for all inquiry responses. Please refer to the ‘ERROR RESPONSE’ note in the description for AT+BTI . Response: 12346789012,123456 12345678914,123456 OK 25 www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 36. AT+BTIN {Inquire} As per AT+BTI but the response includes the device class code and friendly name for all inquiry responses. Please refer to the ‘ERROR ESPONSE’ note in the description for AT+BTI . The friendly name strings are in UTF-8 format as per the Bluetooth specification. Response: 12346789012,123456,”TDK SYSTEMS AT DONGLE 1” 12345678914,123456, “TDK SYSTEMS RS232” OK Note: Many releases of firmware will return the product name as LAIRD, e.g. Response: 12346789012,123456,”TDK SYSTEMS AT DONGLE 1” 12345678914,123456, “TDK SYSTEMS RS232” OK We strongly recommend that any software implementation that uses this command should check for LAIRD, EZURIO and TDK SYSTEMS to ensure backwards and forwards compatibility. 37. AT+BTK= {Set Passkey} This command is used to provide a passkey when PIN? 12345678 indications are received asynchronously. If a pairing is not in progress then the pin is written to non-volatile memory for future use. Specifying an empty string deletes the key from the non-volatile memory. The string length must be in the range 0 to 8, otherwise an error will be returned. Response: OK 38. AT+BTM {Set Incoming Peer Address} This command is used to store a peer address for incoming connections in non-volatile memory. A value of 000000000000 has the special meaning of invalid peer address. When S register 512 = 3, 4, 6 or 7 then it will wait for an incoming connection from the peer address specified. If the peer address is not 000000000000, then it waits for a connection from the specified master, otherwise will connect to anyone. Response: 39. AT+BTM OK {Delete Incoming Peer Address} This command is used to delete the peer address previously stored using AT+BTR . Response: 40. AT+BTM? OK {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: 12346789012 OK If the location is empty the response is as follows. Response: 00000000000 OK 41. AT+BTN= {Set Friendly Name in Non-volatile Memory} This sets the default friendly name of this device as seen by other devices. It will be stored in non-volatile memory. Use AT+BTF to make the name visible to other devices. 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. Response: 26 www.lairdtech.com OK Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 42. AT+BTN? {Read Friendly Name from Non-volatile Memory} Read the default friendly name from non-volatile memory. Response: ”My FriendlyName” OK 43. AT+BTO {Open and make Unit Detectable} After power up and ATZ, this command is sent so that RFCOMM is initialised and opened and the service name as specified in AT+BTN is exposed via the SDP registry. The value specifies an optional fixed length hexadecimal device class code. If it is not specified, then the device class code is taken from S Register 515. For this command to be effective, S Register 512 must be set to 0. Response: OK 44. AT+BTP {Enable Cautious Page/Inquiry Scanning} Enable page scanning and wait for a connection from device with Bluetooth address . If the specified address is 000000000000 then incoming connections are accepted from any device, is as per AT+BTP without an address. Inquiry scanning is also enabled. This command also has variants which allow authentication and encryption to be explicitly specified. For example:AT+BTPU123456789012 AT+BTPY123456789012 AT+BTPUY123456789012 AT+BTPYU123456789012 Response: 45. AT+BTP OK {Enable Promiscuous Page/Inquiry Scanning} Enable page scanning and wait for a connection from any device. Inquiry scanning is also enabled. Authentication and Encryption is as per S registers 502 and 503. Response: 46. AT+BTPU OK {Enable Promiscuous Page/Inquiry Scanning} Enable page scanning and wait for a connection from any device. Inquiry scanning is also enabled. Authentication is enabled and encryption is disabled. Response: 47. AT+BTPY OK {Enable Promiscuous Page/Inquiry Scanning} Enable page scanning and wait for a connection from any device. Inquiry scanning is also enabled. Authentication is disabled and encryption is enabled. Response: 48. AT+BTPUY OK {Enable Promiscuous Page/Inquiry Scanning} Enable page scanning and wait for a connection from any device. Inquiry scanning is also enabled. Authentication and encryption are both enabled. The order of U and Y is not significant. Response: 49. AT+BTQ OK {Enable Inquiry Scans ONLY} When inquiry scan is enabled, it implies that this device will respond to inquiries from other devices. Use AT+BTX to disable inquiries. Response: 27 www.lairdtech.com OK Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 50. AT+BTR {Set Outgoing Peer Address} This command is used to store a peer address for outbound connections in non-volatile memory. A value of 000000000000 has the special meaning of invalid peer address. 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 specified via S register 505) attempt to connect to the peer address specified. In this circumstance all commands 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, the device effectively becomes useless, as in this circumstance a host would want to get attention of the AT parser to send it new commands – probably one to delete the peer device. In this circumstance, a recovery is possible by one of two methods. The first method assumes that the DTR from the host is connected to the DSR line of the module and the second method assumes that this connection is absent. In the first method it is enough to deassert the DTR line from the host and that will abort the autoconnect cycle. The second method is initiated by resetting the device and then ensuring that the text string “AT+BT&BISM& ” is sent (where 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 confirms to the host of that fact by sending an “OK” response. Response: 51. AT+BTR OK {Delete Outgoing Peer Address} This command is used to delete the peer address previously stored using AT+BTR . Response: 52. AT+BTR? OK {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: 12346789012 OK If the location is empty the response is as follows. Response: 00000000000 OK 53. AT+BTS= {Set Service Name} This writes the name to non-volatile memory. 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 memory. An empty string (“”) will delete the string from non-volatile memory which will force the default service to be used. Response: OK If the service name cannot be set for any reason then an error response ERROR 11 is returned. 54. AT+BTS? {Read Service Name from Non-volatile Memory} Reads the default service name from non-volatile memory. Response: ”My ServiceName” OK 28 www.lairdtech.com Laird Technologies BTM410/411 Bluetooth® AT Data Module CONFIGURING THE BTM410/411 55. 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: OK Or Response: 56. AT+BTT? ERROR {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: 12346789012 12345678913 12345678914 OK 58. AT+BTW {Initiate Pairing} This initiates pairing with a device whose Bluetooth address is . An OK response is sent and when the PIN is required, asynchronous indications will be sent to the host in the form PIN? 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. The link key can be stored in a non-volatile database within the device. The list of trusted devices is managed using commands AT+BTT?, AT+BTT and AT+BTD. The AT+BTT? command produces a list of trusted Bluetooth addresses (link key is NEVER displayed) and AT+BTT is used to store the cached link key. The command AT+BTD123456789012 is used to remove the specified device from the database. 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 . See section 3.7 for more details. If AT+BTI or AT+BTP or AT+BTG or AT+BTQ or ATD is issued between the AT+BTW command and the subsequence 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: 59. AT+BTW? OK {List Cached Trusted Device} This command is used to list the cached trusted device. Response: