RN-BT-DATA-UGChapter 1. Introduction1.1OVERVIEW This document contains the software command reference and advanced configuration settings for Roving Networks Bluetooth data modules. The document is applicable to all Bluetooth data modules modules (such as the RN41 and RN42), and USB dongles. Commands and settings that are specific to a single product or product family are iden- tified as such in the document. You configure Roving Networks Bluetooth devices over the Bluetooth link or over the module’s UART using a simple ASCII command language. Set commands configure the module and get commands echo the current configuration. Configuration settings modified with set commands do not take effect until the module has been rebooted, even though the get command may show otherwise. This document assumes that you have a working knowledge of Bluetooth operation and communications. To configure the Roving Networks modules you need a Blue- tooth-enabled PC (either built-in or using a USB Bluetooth dongle). You can only con- figure one module at a time. Once configured, module settings are saved (independent of power down) until they are explicitly changed or the factory defaults are restored. NOTICE TO CUSTOMERSThe commands and applications described in this document apply to Roving Networks Bluetooth data modules, e.g., RN41 and RN42. For Bluetooth audio module configuration information (e.g., RN52), refer to the Bluetooth Audio Module Command Reference User’s Guide.1.2EVALUATION BOARDS & REFERENCE DESIGNS Roving Networks provides a variety of boards, kits, and reference designs that you can use for evaluation and prototyping. The RN-41-EK and RN-42-EK evaluation boards are field-ready, Bluetooth SIG quali- fied prototyping platforms for the RN41 and RN42 modules, respectively. The boards have the flexibility to connect directly to PCs via a standard USB interface (via the FTDI chipset) or to embedded processors through the TTL UART interface. The status LEDs, dipswitches, and signal headers enable demonstrations and proofs of concept. The Bluetooth HID reference design is implemented in the RN42HID-I/RM module. The Bluetooth HID profile is typically used in applications such as keyboards, mice, and game controllers. To demonstrate the basic capability of the Bluetooth HID profile, Rov- ing Networks has developed a Bluetooth reference design implemented in the RN42HID-I/RM module. The reference design operates in three modes: • Presenter mode—Used for presentation software such as Microsoft Powerpoint • Music mode—Music controller for products such as the iPod, iPhone, and iPad • Custom mode—You can configure each button to send a sequence of up to 4 keys www.rovingnetworks.com Version 1.0r 3/26/13 page 5 Advanced Information Document Outline Chapter 1. Introduction 1.1 Overview 1.2 Evaluation Boards & Reference Designs 1.3 Command Mode vs. Data Mode Figure 1-1: Data & Command Modes 1.3.1 Configuring the Module over the UART Port 1.3.2 Remote Configuration Using Bluetooth 1.3.3 Enter Command Mode Table 1-1: Serial Port Settings Figure 1-2: View Current Settings 1.4 Operating Modes 1.5 Using Dipswitches & GPIO Pins for Configuration Table 1-2: Dipswitch & GPIO Settings Table 1-3: GPIO Assignments 1.6 Making a Bluetooth Connection 1.6.1 Discovery Figure 1-3: Discover the Bluetooth Module 1.6.2 Pairing Figure 1-4: Pair with the Bluetooth Module Figure 1-5: Bluetooth COM Port Settings 1.6.2.1 Pairing with a Computer or Smart Phone 1.6.3 Connecting Figure 1-6: PC’s Bluetooth Radio MAC Address Figure 1-7: Terminals A & B 1.6.4 Security Modes Chapter 2. Command Reference 2.1 Command Syntax Table 2-1: Command Types 2.2 SET Commands 2.2.1 S7,<flag> Table 2-2: 7-Bit Data Mode Values 2.2.2 SA,<value> Table 2-3: Set Authentication Values 2.2.3 SB,<value> Table 2-4: Set Break Values 2.2.4 SC,<value> 2.2.5 SD,<value> 2.2.6 SE,<value> 2.2.6.1 Firmware version 5.40 & Higher 2.2.6.2 Firmware Prior to Version 5.40 Table 2-5: Set Encryption Enable 2.2.7 SF,1 2.2.8 SH,<value> Table 2-6: HID Flag Register Bits 2.2.9 SI,<hex value> 2.2.10 SJ,<hex value> 2.2.11 SL,<char> Table 2-7: UART Parity Values 2.2.12 SM,<value> Table 2-8: Mode Values 2.2.13 SN,<string> 2.2.14 SO,<string> 2.2.15 SP,<string> 2.2.16 SQ,<mask> Table 2-9: Special Configuration Settings Values 2.2.17 SR,<hex value> 2.2.18 SS,<string> 2.2.19 ST,<value> Table 2-10: Configuraion Timer Settings 2.2.20 SU,<value> 2.2.21 SW,<value> 2.2.22 SX,<flag> Table 2-11: Bonding Values 2.2.23 SY,<hex value> Table 2-12: Power Settings (August 2012 and Later) Table 2-13: Power table (before August 2012) 2.2.24 SZ,<value> 2.2.25 S~,<value> Table 2-14: Profile Values 2.2.26 S-,<string> 2.2.27 S?,<flag> Table 2-15: Role Switch Values 2.2.28 S$,<char> 2.2.29 S|,<value> 2.3 GET Commands 2.3.1 D 2.3.2 E 2.3.3 GB 2.3.4 GF 2.3.5 GK 2.3.6 GR 2.3.7 G& 2.3.8 G<char> 2.4 Change & Action Commands 2.4.1 $$$ 2.4.2 --- 2.4.3 + 2.4.4 & 2.4.5 C 2.4.6 C,<address> 2.4.7 CF,<address> 2.4.8 CFI 2.4.9 CFR 2.4.10 CT,<address>,<value> 2.4.11 F,1 2.4.12 H 2.4.13 I,<value 1>,<value 2> 2.4.14 IN<value 1>,< value 2> 2.4.15 IQ 2.4.16 IS<value> 2.4.17 IR<value> 2.4.18 J 2.4.19 K, 2.4.20 L 2.4.21 M 2.4.22 O 2.4.23 P,<char> 2.4.24 Q 2.4.25 R,1 2.4.26 T,<flag> Table 2-16: T Command Values 2.4.27 U,<value 1>,<value 2> 2.4.28 V 2.4.29 W 2.4.30 Z 2.5 GPIO Commands 2.5.1 S@,<hex value> 2.5.2 S&,<hex value> 2.5.3 S%,<hex value> 2.5.4 S^,<hex value> 2.5.5 S*,<hex value> 2.5.6 Controlling the GPIO Pins 2.5.7 Setting GPIO Pin Power-Up Values 2.5.8 Setting GPIO8, GPIO9, GPIO10 & GPIO11 Chapter 3. Advanced Topics 3.1 Power Management Table 3-1: Power Management Methods 3.1.1 Optimizing Inquiry (Discovery) & Page (Connection) Windows 3.1.2 Sniff Mode 3.1.3 Enabling Deep Sleep 3.1.4 Disabling Output Drivers 3.1.5 Lowering Transmit Power Table 3-2: Power Settings 3.2 Configuration Timer Settings Table 3-3: Configuration Timer Settings 3.3 Interfacing to a Microprocessor 3.3.0.1 How do I know the module is ready for command mode? 3.3.0.2 Which hard signals should I connect? 3.4 HCI Mode 3.4.1 HCI over UART 3.4.2 HCI over USB 3.5 Profile Settings & Features Table 3-4: Profile Change Values 3.6 Using GPIO Pins as Modem Control Signals 3.7 Design Concerns 3.7.1 Hardware Signals 3.7.1.1 Reset Circuit 3.7.1.2 Factory Reset GPIO4 3.7.1.3 Connection Status Table 3-5: GPIO5 Status Table 3-6: GPIO2 Status 3.7.1.4 Using the SPI Bus for Flash Upgrades 3.7.1.5 Hardware Connections & Power 3.7.2 LED Status Table 3-7: Green LED Status 3.7.3 Optimizing for Latency or Throughput 3.7.4 Limitations of 7-Bit Data Mode 3.7.5 Common Issues 3.7.5.1 My Bluetooth client can see the FireFly module and its serial service, but I can’t connect 3.7.5.2 How do I change the client’s COM port? 3.7.5.3 How do I connect to more than one FireFly module from the same client at the same time? 3.7.6 Discovery & Connection Example Sequence 3.7.7 Auto-Pairing/Auto-Connection Table 3-8: GPIO Pin/Dipswitch Settings for Auto-Pairing/Connection 3.8 Serial Adapter Configuration Figure 3-1: DB9 Connector Pins Table 3-9: DB9 Connector Pin-Out 3.9 Null Modem & Flow Control Jumpers Figure 3-2: RN422, RN240, RN270 & RN274 Jumpers Figure 3-3: RN220XP Jumpers 3.10 Dipswitch Settings Figure 3-4: DipSwitches Table 3-10: Switch Functions Chapter 4. Applications 4.1 Instant Cable Replacement 4.1.1 Hardware Pairing Using Dipswitches Figure 4-1: Cable Replacement DipSwitch Settings for Pairing Figure 4-2: Setting DipSwitch 2 for Deployment 4.1.2 Software Pairing Using Commands Chapter 5. HID Profile 5.1 Overview Figure 5-1: Typical HID Environments 5.2 HID Firmware Overview 5.2.1 Operational Modes 5.2.2 Profile Configuration 5.2.3 Device Discovery & Pairing 5.2.4 HID Flag Register Table 5-1: HID Flag Register Bits 5.2.4.1 Bit 9 5.2.4.2 Bit 8 5.2.4.3 Bits 7-4 5.2.4.4 Bit 3 5.2.4.5 Bits 2-0 5.3 HID Reports Table 5-2: Data Interpretation 5.3.1 Translation Mode 5.3.2 Keyboard Shorthand Mode 5.3.3 Raw Report Mode 5.3.4 Special Reports & Modes 5.3.4.1 Output Reports Table 5-3: Status Byte Definitions 5.3.4.2 Apple Virtual Keyboard 5.3.4.3 Key Map Register 5.3.4.4 Disconnect Key 5.3.4.5 Consumer Report Table 5-4: Data Byte Format 5.3.4.6 Scan Code Tables: UART (ASCII) to HID Report Table 5-5: UART-to-HID Scan Code Table 5-6: ASCII to HID Report (to Host) Scan Codes 5.4 HID References Appendix A. Factory Defaults Table A-1: Factory Default Settings Appendix B. Command Quick Reference Guide Table B-1: Set Commands Table B-2: Get (Display) Commands Table B-3: Action Commands (Part 1 of 2) Table B-4: GPIO Commands Appendix C. Firmware Revision History C.1 Version 6.15 (3/26/2013) C.2 Version 6.12 (Limited Release) C.3 Version 6.11 C.4 Version 6.10 C.4.1 HID Firmware Known Issues C.5 Version 4.77 (8/10/2009) C.6 Version 4.74 (3/7/2009) Appendix D. Document Information Conventions Used in this Guide Recommended Reading Document Revision History