Roving Networks reserves the right to make corrections, modifications,
and other changes to its products, documentation and services at any
time. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
Roving Networks assumes no liability for applications assistance or customer’s product design. Customers are responsible for their products and
applications that use Roving Networks components. To minimize customer product risks, customers should provide adequate design and operating safeguards.
Roving Networks, Inc.
102 Cooper Court
Los Gatos, CA 95032
+1 (408) 395-5300
www.rovingnetworks.com
www.rovingnetworks.comVersion 1.0r 3/26/13page 2
Roving Networks products are not authorized for use in safety-critical
applications (such as life support) where a failure of the Roving Networks
product would reasonably be expected to cause severe personal injury or
death, unless officers of the parties have executed an agreement specifically governing such use.
Appendix A. Factory Defaults
Appendix B. Command Quick Reference Guide
Appendix C. Firmware Revision History
C.1 Version 6.15 (3/26/2013) ............................................................................. 75
C.2 Version 6.12 (Limited Release) ................................................................... 75
C.3 Version 6.11 ................................................................................................. 75
www.rovingnetworks.comVersion 1.0r 3/26/13page 3
C.4 Version 6.10 ................................................................................................. 75
C.5 Version 4.77 (8/10/2009) ............................................................................. 76
C.6 Version 4.74 (3/7/2009) ............................................................................... 76
Appendix D. Document Information
RN-BT-DATA-UG
Chapter 1. Introduction
1.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 identified 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 Bluetooth-enabled PC (either built-in or using a USB Bluetooth dongle). You can only configure 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.
RN-BT-DATA-UG
NOTICE TO CUSTOMERS
The 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 qualified 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, Roving 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.comVersion 1.0r 3/26/13page 5
Advanced Information
For more information on available evaluation boards and reference designs, refer to the
UART
Bluetooth Interface
Bluetooth
Module
Command
Mode
$$$$$$
A
B
User Data
Bluetooth
Host
A
B
Roving Networks web site.
1.3COMMAND MODE VS. DATA MODE
The Bluetooth module operates in two modes: data mode (default) and command
mode. While in data mode, the module operates as a data pipe. When the module
receives data, it strips the Bluetooth headers and trailers and passes the user data to
the UART port. When data is written to the UART port, the module constructs the Bluetooth packet and sends it out over the Bluetooth wireless connection. Thus, the entire
process of sending/receiving data to the host is transparent to the end microprocessor.
See Figure 1-1.
FIGURE 1-1:DATA & COMMAND MODES
RN-BT-DATA-UG
The default configuration for the Bluetooth module is:
• Bluetooth slave mode
• Bluetooth pin code 1234
• Serial port 115,200 Kbps baud rate, 8 bits, no parity, 1 stop bit
• Serial port flow control disabled
• Low power mode off
You configure the module by putting it into command mode (see “Enter Command
Mode” on page 8) and sending ASCII commands over the UART port or the Bluetooth
link. You reboot the module so that the settings take effect. Once you change the configuration parameters, they persist until you change them or you perform a factory
reset.
There are two ways to configure the Bluetooth module:
• Local configuration using your computer’s serial port
• Via Bluetooth
www.rovingnetworks.comVersion 1.0r 3/26/13page 6
Advanced Information
RN-BT-DATA-UG
You need a terminal emulator to complete the setup.
Note:Use either the TeraTerm (Windows OS) or CoolTerm (Mac OS-X) terminal
emulator program.
1.3.1Configuring the Module over the UART Port
Connect the module to your computer. You can connect using the RS-232 DB9 port or
via a USB cable. For example, if you are using the RN-41-EK evaluation board, connect it to your computer using a USB cable.
With the Bluetooth module connected and powered on, run a terminal emulator and
open the COM port to which the cable is connected. The terminal emulator’s communication settings should be the default serial port settings:
• Baud rate 115,200 kbps
•8 bits
•No parity
• 1 stop bit
• Hardware flow control enabled
Note:You can use local configuration at any time when the module does NOT
have a Bluetooth connection, as well as under certain conditions. If the
module is in configuration mode and a connection occurs, the module exits
configuration mode and data passes back and forth from the remote module.
Once a connection is made, you can only enter command mode if the boot-up configuration timer has not expired (60 seconds). To remain in configuration mode, set the
configuration timer to 255. See “Configuration Timer Settings” on page 44 for more
information.
Note:If the module is in Auto-Connect Master Mode, you cannot enter command
mode when connected over Bluetooth. See “Operating Modes” on page 10
for more information on the various operating modes.
Refer to “Enter Command Mode” on page 8” for information on entering command
mode from a terminal emulator.
1.3.2Remote Configuration Using Bluetooth
It is often useful to configure the module remotely over a Bluetooth connection. Before
performing remote configuration using Bluetooth, first pair the Bluetooth module with
your computer. For PCs with Bluetooth capability and running Windows, click Blue-
tooth devices in the system tray at the bottom right of your computer screen. Select
Add a Bluetooth device and follow the on-screen instructions. For Mac OS-X, click
the Bluetooth icon, select Set up Bluetooth device, and follow the on-screen instructions.
Once a connection is made, you can only enter command mode if the boot-up configuration timer has not expired (60 seconds). To remain in configuration mode, set the
configuration timer to 255. See “Configuration Timer Settings” on page 44 for more
information.
www.rovingnetworks.comVersion 1.0r 3/26/13page 7
Advanced Information
RN-BT-DATA-UG
When you are finished configuring, reset the module or send the --- command, which
causes the module to exit configuration mode and allows data to pass normally.
Note:Configuration mode (local or remote) is NEVER enabled when the module
is in auto-mode and is connected over Bluetooth.
1.3.3Enter Command Mode
To enter command mode, launch a terminal emulator and specify the module’s default
settings. Ta bl e 1 -1 shows the serial port settings.
TABLE 1-1:SERIAL PORT SETTINGS
SettingValue
PortCOM port to which you attached the module
Baud rate115200
Data rate8 bits
PatiryNone
Stop bits1
Flow controlNone
Type
$$$ into the terminal emulator to enter command mode.
The module returns the string
CMD, which indicates that your connection and terminal
settings are correct. While in command mode, the module accepts ASCII bytes as commands. When you enter a valid command, the module returns
invalid command and
? for unrecognized commands. Type h <cr> to see a list of com-
AOK. It returns ERR for an
mands.
A quick check to confirm that you are in command mode is to type the
X <cr> command
after entering command mode. This command shows the a summary of the module’s
current settings, such as the Bluetooth name, device class, and serial port settings.
See Figure 1-2.
To return to data mode, type
--- <cr> or reset the module and re-connect.
Note:The module supports a fast data mode. In this mode, the module does not
go into command mode even if it receives $$$. If you do not enter command
mode within the configuration window (60 seconds), the module enters fast
data mode. See “ST,<value>” on page 26 and “Configuration Timer Set-
tings” on page 44 for more information on setting the configuration window.
www.rovingnetworks.comVersion 1.0r 3/26/13page 8
Advanced Information
FIGURE 1-2:VIEW CURRENT SETTINGS
RN-BT-DATA-UG
www.rovingnetworks.comVersion 1.0r 3/26/13page 9
Advanced Information
1.4OPERATING MODES
The Bluetooth module has several operating modes, which you set using the SM command in command mode.
Note:In all master modes, the module cannot be discovered or configured
remotely over Bluetooth.
• Slave Mode (SM,0)—Default mode, in which other Bluetooth devices can discover
and connect to the module. You can also make outbound connections in this
mode.
• Master Mode (SM,1)—In this low-speed connection mode, the module makes
connections when a connect command (
contain the Bluetooth address of the remote device. If a device is not specified,
the module uses the stored remote address. The connection can be broken if the
special break character or string is sent (use the
character). This mode is useful when you want the module to initiate connections
(not receive them). In this mode, the module is NOT discoverable or connectable.
• Trigger Mode (SM,2)—In this low-speed connection mode, the module makes
connections automatically when a character is received on the serial port (UART).
The connection continues as long as characters are received on either end. The
module has a configurable timeout (which you set using the
disconnects the module after the specified number of seconds of inactivity (1 to
255) or a configurable break character is received.
• Auto-Connect Master Mode (SM,3)—In this mode, the module makes connec-
tions automatically on power-up and re-connects when the connection is lost. This
mode can be set by command, or by setting the external dipswitch 3 during power
up (evaluation kits) or by driving GPIO6 high (Bluetooth modules). If an address is
not stored, the module performs an inquiry process and the first device found that
matches the COD is stored. In this mode, high-speed data is passed without being
interpreted; therefore, the connection cannot be broken via commands or software break characters. If a disconnect occurs, the module attempts to re-connect
until successful.
• Auto-Connect DTR Mode (SM,4)—This mode must be set by command. It oper-
ates like Auto-Connect Master Mode, except that you control connection and disconnection with dipswitch 3 (evaluation kits) and GPIO6 (Bluetooth modules).
Turning the dipswitch on or driving GPIO6 high initiates the auto-connect process;
turning the dipswitch off or driving GPIO6 low causes a disconnect.
• Auto-Connect ANY Mode (SM,5)—This mode must be set by command. This
mode operates like Auto-Connect DTR Mode, except that each time the dipswitch
or GPIO is set, an inquiry is performed and the first device found is connected.
The stored address is NOT used, and the address found is never stored.
• Pairing Mode (SM,6)—In this mode, the module attempts to connect with the
remote device matching the store remote address. You set the remote address
using the
SR command.
RN-BT-DATA-UG
C) is received. This command can also
SO command to set the break
ST command) that
www.rovingnetworks.comVersion 1.0r 3/26/13page 10
Advanced Information
RN-BT-DATA-UG
1.5USING DIPSWITCHES & GPIO PINS FOR CONFIGURATION
The Bluetooth modules have dipswitches (for evaluation kits) or GPIO pins (for modules) that you can use to configure the module. See Tab le 1 - 2.
TABLE 1-2:DIPSWITCH & GPIO SETTINGS
Dipswitch
Function
Factory Reset1GPIO4Off = disabled, on = armed.
Auto Discovery/
Pairing
(Adpaters &
Evaluation
Boards)
2GPIO3Off = disabled, on = enabled.
GPIO Pin
(Modules)
Settings (OFF = 0 VDC/ON = 3 VDC)
Set this dipswitch/GPIO pin on power up to arm the reset function. Then
toggle the module off and on three times to reset all settings to the factory defaults (other than the Bluetooth name).
You use these settings in conjunction with dipswitch 3/GPIO6. If
dipswitch 3/GPIO6 are also set, the module performs a device inquiry
scan, searching for a partner device with a special matching class
(0x55AA). Once it finds this device, it stores the address into the remote
address field and auto-connects to the remote device.
If dipswitch 3/GPIO6 are NOT set, the module enters slave mode with
the special matching class and waits for the master to find it. This mode
is usually set once on both ends of a module pair (for instant cable
replacement) and then removed.
Auto-Connect3GPIO6Off = disabled, on = enabled.
This setting is equivalent to Auto-Connect Master Mode in software. The
module connects to the stored address. If dipswitch 2/GPIO3 is also set,
a new discovery/pairing can be made.
If connected via the CFR command, toggling the dipswitch off-on-off terminates the current connection.
Baud Rate4GPIO7Off = stored setting (115 K), on = 9,600.
This setting is used to configure 9,600 or a software selected (default =
115 K) baud rate. If the dipswitch is off, the module uses the stored
baud rate setting. When the dipswitch is on, the baud rate is set to 9,600
regardless of the software setting.
www.rovingnetworks.comVersion 1.0r 3/26/13page 11
Advanced Information
RN-BT-DATA-UG
Ta bl e 1 -3 describes the GPIO pin assignments for Roving Networks Bluetooth hard-
ware. Refer to “GPIO Commands” on page 37 for more information on the commands
you use to configure the GPIO pins.
selected AND if bit 9 in HID flag is set
(SH,<value>)
1.6MAKING A BLUETOOTH CONNECTION
By default, the Bluetooth module acts as a slave and the PC or smartphone is the master. You connect to the Bluetooth module using the Bluetooth device manager, which
varies depending on your smartphone or computer’s operating system. In all cases, the
process is the same:
• Discovery—In the discovery phase, the Bluetooth module broadcasts its name,
profile support, and MAC address. It is ready for other devices to pair with it. Discovery is only availoable in slave mode.
• Pairing—During pairing, the Bluetooth module and the Bluetooth master validate
the pin code. If the pin code validates successfully, they exchange security keys
and a channel hopping pseudo-random sequence. Successful pairing results in
the module and master establishing link keys.
• Connecting—Before connecting, the Bluetooth devices must have paired suc-
cessfully. The master initiates a connection, the master and slave validate the link
keys, and a Bluetooth link is established.
The following sections describe these processes in detail.
www.rovingnetworks.comVersion 1.0r 3/26/13page 12
Advanced Information
RN-BT-DATA-UG
1.6.1Discovery
When you turn on the Bluetooth module, it is discoverable. For evaluation kits, the
green LED blinks, indicating that it is discoverable. Open your PC’s Bluetooth device
manager and choose to add a new device. The Bluetooth device manager’s icon is
located in the bottom right corner of your screen in the taskbar for Windows and in the
upper right corner for Mac OS-X. The Bluetooth device manager displays a list of discoverable Bluetooth devices (see Figure 1-3). The Bluetooth module displays as Serial
Port Profile (SPP) Service FireFly-ABCD, where FireFly is the type of Roving Networks module and ABCD is the last four nibbles of the Bluetooth MAC address. (You
can change the local device name).
FIGURE 1-3:DISCOVER THE BLUETOOTH MODULE
1.6.2Pairing
To pair with the module, double-click the module’s name (i.e., FireFly-XXXX) in the list.
The firmware automatically stores up to 8 pairings from remote hosts in a first in, first
out fashion.
Choose to enter the module’s pairing code (see Figure 1-4) and enter the default pin
code, 1234. When the Bluetooth device manager completes pairing, it issues a mes-
sage that the Bluetooth device is installed on COMX where COMX is unique to your
computer. In some cases, the Bluetooth device manager creates two COM ports; in this
situation, only use the COM port labeled “outgoing.”
www.rovingnetworks.comVersion 1.0r 3/26/13page 13
Advanced Information
FIGURE 1-4:PAIR WITH THE BLUETOOTH MODULE
RN-BT-DATA-UG
Note:You only need to pair with the module once.
Figure 1-5 shows example COM port settings.
FIGURE 1-5:BLUETOOTH COM PORT SETTINGS
www.rovingnetworks.comVersion 1.0r 3/26/13page 14
Advanced Information
RN-BT-DATA-UG
If the remote Bluetooth device does not require authentication, a connection can occur
without the pairing process. However the Bluetooth specification requires that if either
device involved in the pairing process requires authentication, the other device must
participate to ensure a secure link. Roving Networks modules default to an open mode,
such that the module does NOT require authentication. However, most PCs require
authentication. See “Security Modes” on page 17 for more information on using pass
keys.
Once connected, the module is in data mode allowing data to flow in both directions as
if the serial port were locally attached to the PC. For configuration, the module must be
in command mode. See “Enter Command Mode” on page 8 for more information.
Note:Only one client can connect to a slave module at a time. As a master, the
module can make multiple connections, but only in a point-to-point, serialized fashion. Roving Networks modules do not currently support multi-point
master mode.
1.6.2.1PAIRING WITH A COMPUTER OR SMART PHONE
The module may use simple secure pairing (SSP) if it is attempting to pair with devices
that support the Bluetooth specification version 2.1 + EDR. SSP does not require the
user to remember the pin code, but it asks to confirm the 6-digit number if the device
has a display capability.
1.6.3Connecting
In most cases, you connect from another device to the module as an outgoing Bluetooth connection. You can also make an incoming connection in which the evaluation
board initiates the connection to the remote device.
1.0.0.1Outgoing Connections
To establish an outgoing Bluetooth connection from a PC to the module, open the module’s outgoing COM port from your application or a terminal emulator. The module
remains connected until you close the COM port or remove power from the board.
Once connected, the module is in data mode allowing data to flow in both directions.
For configuration, the module must be in command mode. See “Enter Command
Mode” on page 8 for more information.
Note:Only one client can connect to a slave module at a time. As a master, the
module can make multiple connections, but only in a point-to-point, serialized fashion. Roving Networks modules do not currently support multi-point
master mode.
1.0.0.2Incoming Connections
For an incoming connection you use the port specified in your Bluetooth settings as
incoming (refer back to Figure 1-3). In incoming connections, the PC or host listens for
an incoming connection from the remote Bluetooth device, in this case the module.
Perform the following steps to make in incoming connection.
1. You need the MAC address of the PC’s Bluetooth radio to connect from the module to the host PC. Open the PC’s Bluetooth advanced settings to find the MAC
address. See Figure 1-6.
www.rovingnetworks.comVersion 1.0r 3/26/13page 15
Advanced Information
RN-BT-DATA-UG
FIGURE 1-6:PC’S BLUETOOTH RADIO MAC ADDRESS
2. Pair your module with the PC as described in “Pairing” on page 13.
3. Open a terminal (called terminal A in this example) and connect it to the module.
You can run this terminal on the host PC or another computer.
4. Open a second terminal (called terminal B in this example) on the host PC to listen for the incoming Bluetooth connection using the incoming COM port number.
5. Type
C,<MAC address> <cr> in terminal A to establish an SPP connection to the
host PC. See Figure 1-7 for an example connection.
6. Try the following commands:
•
$$$ to enter command mode
•
SO,% to enable status message to see connect/disconnect conditions
•
R,1 to reboot
•
$$$ to re-enter command mode
•
+ to enable local echo
•
C,<MAC address> to attempt a connection with remote device
Characters you type in terminal B are sent over Bluetooth to the host PC and
appear in terminal A. Any characters entered in terminal A are transmitted to terminal B.
7. To kill the connection, type the
k,1 <cr> command in terminal B.
www.rovingnetworks.comVersion 1.0r 3/26/13page 16
Advanced Information
FIGURE 1-7:TERMINALS A & B
RN-BT-DATA-UG
1.6.4Security Modes
The Bluetooth module supports authentication. If the local or remote Bluetooth device
has authentication enabled, a pin code is required the first time a connection is
attempted. The pin code is a series of numbers or characters from 1 to 16 characters
in length.
Note:The default pin code for Roving Networks Bluetooth modules is 1234. The
RN-41-EK and RN-42-EK evaluation boards do not require a pin code.
After you enter the pin code, the Bluetooth devices compare them. If they match, a link
key is generated and stored. Usually, but not always, the remote device stores the link
key. For subsequent connections, the devices compare link keys. If they are correct,
you do not need to re-enter the pin code.
www.rovingnetworks.comVersion 1.0r 3/26/13page 17
Advanced Information
RN-BT-DATA-UG
If the remote device is a PC or PDA, the user generally is prompted to enter this pin
code. To remove the stored link key on the remote device, you typically “unpair” or
remove the device from the Bluetooth manager. You can change the pin code to
remove the link key on the Bluetooth module, forcing a new pin code exchange to occur
upon subsequent connection attempts.
Note:Only one master can connect to the Bluetooth module at a time.
www.rovingnetworks.comVersion 1.0r 3/26/13page 18
Advanced Information
RN-BT-DATA-UG
Chapter 2. Command Reference
Roving Networks Bluetooth modules support a variety of commands for configuration.
This section describes these commands in detail and provides examples.
2.1COMMAND SYNTAX
To issue commands to the module, you send a keyword followed by optional parameters.
• All commands are one or two characters and can be upper or lower case.
• Delimit command arguments with a comma.
• Commands use decimal input, except where noted.
• Text data, such as the Bluetooth name and pin code, is case sensitive.
• All commands only take effect AFTER reboot, except where noted.
There are five general command categories, as shown in Table 2-1.
TABLE 2-1:COMMAND TYPES
Command TypeDescription
Set commandsStore information to flash memory. Changes take effect after a power cycle or reboot.
Get commandsRetrieve and display the stored information.
Change commandsTemporarily change the value of various settings such as serial baud rate, parity, etc.
Action commandsPerform actions such as inquiries, connecting, etc.
GPIO commandsConfigure and manipulate the GPIO signals.
2.2SET COMMANDS
The set commands specify configuration settings and take effect after power cycling or
rebooting.
2.2.1S7,<flag>
This command enables/disables 7-bit data mode, where <flag> is shown in Tab le 2 - 2.
TABLE 2-2:7-BIT DATA MODE VALUES
Default:0
Example:
2.2.2SA,<value>
The set authentication command forces authentication when a remote device attempts
to connect, where <value> is one of the values shown in Table 2-3. Regardless of this
setting, if a remote device forces authentication, this device responds with the stored
FlagDescription
0Disable.
1Enable.
S7,1// Enable 7-bit data mode
www.rovingnetworks.comVersion 1.0r 3/26/13page 19
Advanced Information
RN-BT-DATA-UG
pin code. Once a remote device has exchanged pin codes with this device, a link key
is stored for future use. The device stores up to 8 keys automatically and permanently
in flash memory, in a first in, first out fashion.
TABLE 2-3:SET AUTHENTICATION VALUES
ValueDescription
0Open mode. With this mode, the module uses Bluetooth version 2.0 with NO encryption (open mode). This
mode is useful for legacy devices that do not need security. This mode is the same as in firmware version 4.77.
1SSP keyboard I/O mode (default). If this option is set, the remote host receives a prompt; reply yes to pair.
For Android devices, the user is prompted with a 6-digit code and is asked to verify that the code matches
on the module. The module always responds yes. Because the module cannot display a code, simply
press OK or Yes on the remote device to authenticate.
2SSP “just works” mode. This mode works with iOS device and newer PCs. You can use this mode with
Droid devices if the application connects using unsecure mode (which was the default on Droid version
3.3). This mode also works with new PC stacks.
4Pin code. Forces pin code mode authentication (Bluetooth version 2.0), which requires the host device to
enter a pin code that matches the stored pin code. The functionality is similar to firmware version 4.77.
Note:Modes 0 and 4 are legacy modes that do not support SSP (Bluetooth ver-
sion 2.0).
Default:1
Example:
SA,1// Enable authentication
2.2.3SB,<value>
When you issue the set break command, the device sends a break signal immediately
where <value> is the length of the break signal in milliseconds as shown in Tab le 2 - 4.
The break signal on the UART TX pulls the line low.
TABLE 2-4:SET BREAK VALUES
ValueBreak Length (ms)
137
218.5
312
49
57
66
Default:N/A
Example:
SB,1// Send a break signal of 37 ms
2.2.4SC,<value>
This command sets the service class field in the class of device (COD). The service
class consists of the most significant 11 bits in the COD. This command sets the MSW
to create the 24-bit device class number. The inquiring device interprets the service
class to determine the service. A complete listing of available Bluetooth service classes
is referenced on the Bluetooth SIG web site.
www.rovingnetworks.comVersion 1.0r 3/26/13page 20
Advanced Information
RN-BT-DATA-UG
Default:0000
Example:
2.2.5SD,<value>
This command sets the class of device (COD) LSW. The COD is a 24-bit number that
is made up of the device class with major 8 bit and minor in a 16-bit word. This command is used with the service class command.
Default:1F00
Example:
2.2.6SE,<value>
In firmware versions 5.40, 6.10, and above, this command sets the UUID for outbound
connections. Roving Networks bluetooth modules use the standard SPP UUID of
0x1101. Encryption is always enabled in firmware versions 5.40 and higher.
SC,0002// Set service class to 0002
SD,8040
To set the COD to 0x1F0123, use the following commands:
SC,001F
SD,0123
2.2.6.1FIRMWARE VERSION 5.40 & HIGHER
The UUID setting is useful for Android-based applications so that the application can
uniquely determine the remote device. Android applications require a 128-bit UUID.
00001101-0000-1000-8000-00805F9B34FB is the 16-bit UMUID for the serial port profile (0x1101) when promoted to a 128-bit UUID. Android application developers are
expected to use this 128-bit UUID for SPP.
This feature applies to SPP connect back only, which is used primarily for Android
devices. With this feature, you can set a custom UUID for connecting back. Android
phones run an audio gateway that always attempts to grab a connection when it comes
in from a remote Bluetooth device such as the Roving Networks module. With the
SE
command, you can register a custom UUID, which ensures that ONLY your application
obtains the connection when it comes in.
The default SSP UUID is 35111C0000110100001000800000805F9B34FB.
You can modify a subset of the UUID; the bytes are changed from left to right. For
example, if the UUID is:
35111C0000110100001000800000805F9B34FB
Typing the command
SE,ABCD<cr> changes the first 2 bytes resulting in:
ABCD1C0000110100001000800000805F9B34FB
The command has three short forms:
SE,S// Loads the default SPP UUID
SE,I// Loads the iPhone UUID
SE,C// Loads the custom UUID (appropriate for testing or custom use)
For firmware prior to version 5.40, the SE command enables and disables encryp-
tion.The <flag> value determines whether or not encryption is enabled as shown in
Ta bl e 2 -4 .
TABLE 2-5:SET ENCRYPTION ENABLE
SE,0000110100001000800000805F9B34FB // Set the UUID for Droid
FlagDescription
0Disable.
1Enable.
2.2.7SF,1
This command restores the device to the factory defaults.
Example: SF,1// Restore factory defaults
2.2.8SH,<value>
The HID flag register is a bit-mapped register that is configured while in command
mode. To set the register, use the SH, <value> command, where <value> is a 4-char-
acter hex word. The GH command returns the current value of the register. The default
factory setting is 0000, which corresponds to a keyboard.
Note:This command is only available for use in the HID profile. Refer to Chapter
5. “HID Profile” for more information on using the HID profile.
Ta bl e 2 -6 shows the HID flag register bits; currently only the lower 9 bits are defined.
See “HID Flag Register” on page 61 for more information on setting these bits.
TABLE 2-6:HID FLAG REGISTER BITS
987..432..0
Force HID mode if
GPIO11 is high on
power-up.
Toggle virtual keyboard on iOS when
first connected.
Descriptor type:
0000 = Keyboard
0001 = Game Pad
0010 = Mouse
0011 = COMBO
0100 = JOYSTICK
1XXX = Reserved
Send output reports
over UART.
Indicates number of
paired devices to which
the module can reconnect.
Default:0200
Example:
www.rovingnetworks.comVersion 1.0r 3/26/13page 22
SH,0220// Set the device as a mouse
Advanced Information
RN-BT-DATA-UG
2.2.9SI,<hex value>
The inquiry scan window command sets the length of time the device spends enabling
an inquiry scan (discoverability). The minimum value is 0x0012, corresponding to about
a 1% duty cycle.
The page scan interval is fixed at 0x1000. The default window is 0x0100. The maximum
value is 0x800. Set this parameter to 0x0000 to disable inquiry scanning and render the
device undiscoverable. If the host has already paired, the inquiry scan is not used.
Note:When pairing with Android devices, increasing this value makes pairing
more reliable.
Default:0100
Example:
2.2.10SJ,<hex value>
The page scan window command sets the amount of time the device spends enabling
page scanning (connectability). The minimum value is 0x0012, which corresponds to
about a 1% duty cycle. The page scan interval is fixed at 0x1000. The default window
is 0x0100. The maximum value is 0x800. Set this option to 0x0000 to disable page
scanning and render the device non-connectable.
SI,0200// Set inquiry scan window to 0x0200
Note:When pairing with Android devices, increasing this value makes pairing
more reliable.
Default:0100
Example:
SJ,0200// Set the page scan window to 0x0200
2.2.11SL,<char>
This command sets the UART parity, where <char> is a character shown in Ta ble 2- 7.
TABLE 2-7:UART PARITY VALUES
ValueDescription
EEven.
OOdd.
NNone.
Default:N
Example:
SL,E// Set parity to even
www.rovingnetworks.comVersion 1.0r 3/26/13page 23
Advanced Information
RN-BT-DATA-UG
2.2.12SM,<value>
This command sets the mode, where <value> is a decimal number as shown in
This command sets the device name, where <string> is up to 20 alphanumeric charac-
ters.
Default:N/A
Example:
SN,MyDevice// Set the device name to “MyDevice”
2.2.14SO,<string>
This command sets the extended status string, where <string> is up to 8 alphanumeric
characters. Setting this string to from 1 to 8 characters permits status messages to be
sent to the local serial port. When you set this parameter, two status messages are
sent:
• When a Bluetooth connection is established, the device sends the string
<string>
• When disconnecting, the device sends the string <string>
This parameter is useful when connecting to equipment or hardware. For example,
when the device is connected to a printer, the printer can examine an escape
sequence. If <string> is set to
CONNECT
modes, the first character of this string is used as the break connection character.
Default:Disabled
Example:
CONNECT.
DISCONNECT.
ESC%, the printer can parse ESC%CONNECT and ESC%DIS-
messages without interfering with normal print jobs. In trigger or master
SO,ESC%// Set escape sequence
SO,<space>// Disables the extended status string
www.rovingnetworks.comVersion 1.0r 3/26/13page 24
Advanced Information
RN-BT-DATA-UG
2.2.15SP,<string>
This command sets the security pin code, where <string> is up to 20 alphanumeric
characters. Each time the device pairs successfully, it saves the Bluetooth address.
The device can store up to eight addresses on a first in first out basis. Using this command also erases all stored pairings. You can use the same value that is already set.
You cannot erase the pin code, however, you can overwrite the default pin code.
Default:1234
Example:
2.2.16SQ,<mask>
This command is for special configuration settings, where <mask> is a decimal number
as shown in Ta bl e 2 -9 .
TABLE 2-9:SPECIAL CONFIGURATION SETTINGS VALUES
MaskDescription
0Default. The device does not use any special configuration.
4With this option set, the device does not read the GPIO3 and GPIO6 pin values on
8Disables discoverability at power up. Clear this setting with SQ,0. Use the W or Q,1
16This option configures the firmware to optimize for low latency data transfers rather
128This option causes the device to reboot after disconnect.
256This option sets 2 stop bit mode on the UART.
SP,0123// Set pin code to “0123”
power-up. This command is used when configuring GPIO3 and GPIO6 for a function
other than the default configuration. See “GPIO Commands” on page 37.
commands to enable discovery at runtime.
than throughput.
Note:If the module is unable to connect to the Bluetooth device for 15 to 30 sec-
onds after disconnecting, try clearing the
SQ, bit (i.e., use SQ,0).
Default:0// Do not use special configuration
Example:
SQ,128// Reboot after disconnect
2.2.17SR,<hexvalue>
This command stores the remote address, where <hex value> is 12 hexadecimal digits
(6 bytes) with no spaces or characters between digits. Additionally, this command takes
two special characters for the address parameter:
•
SR,Z erases any stored addresses.
•
SR,I writes the last address observed using the inquiry command. This command
can be helpful when you only have one other device in range.
Note:In firmware version 6.12, you must type the SR,Z command in uppercase
characters. If you type the command in lowercase characters, the module
returns
Default:N/A
Example:
www.rovingnetworks.comVersion 1.0r 3/26/13page 25
SR,00A053112233// Set the remote Bluetooth address to
ERR.
// 00A053112233
Advanced Information
Loading...
+ 58 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.