Ehong EH-MA41 User manual

EH-MA41 User Guide
1-26
Ehong Control Interface
(EHCI)
User Guide for EH-MA41
Ver.0.2
May 14, 2014
Copyright ©2011-2014 Ehong Technologies
All rights reserved.
Ehong Technologies assumes no responsibility for any errors, which may appear in this document.
Furthermore, Ehong Technologies reserves the right to alter the hardware, software, and/or specifications
detailed herein at any time without notice, and does not make any commitment to update the information
contained herein. Ehong Technologies’ products are not authorized for use as critical components in life
support devices or systems.
The Bluetooth trademark is owned by the Bluetooth SIG Inc., USA.
All other trademarks listed herein are owned by their respective owners.
Release Record
Version
Release Date
Comments
0.1
Mar 03,2014
Draft
0.2
May 14,2014
1、Change the command and indicator for PIO assignment from PO to PM;
2、Correct some typo.

EH-MA41 User Guide
2-26
Table of Contents
1. Introduction...................................................................................................................3
1.1. Default UART Configuration ..................................................................................3
2. Command and Indicator Syntax....................................................................................3
2.1. General Syntax ......................................................................................................3
2.2. Examples...............................................................................................................3
3. Command List ..............................................................................................................4
4. Indicator List .................................................................................................................4
5. Description of ASCII Commands ..................................................................................5
5.1. General Commands...............................................................................................6
5.1.1. PF—Query or configure the profiles ...................................................................6
5.1.2. AD—Query the Bluetooth address......................................................................6
5.1.3. TP—Query or change the Tx Power...................................................................7
5.1.4. CD—Query or configure the Class of Device......................................................7
5.1.5. FT—Query or configure the features ..................................................................8
5.1.6. MM—Query or configure Man-In-The-Middle protection feature.......................10
5.1.7. IO—Query or configure the IO capability of local device ..................................11
5.1.8. MT—Query or configure force to be master feature .........................................11
5.1.9. PN—Query or change the fixed pin code .........................................................12
5.1.10. NM—Query or change the local friendly name ...............................................13
5.1.11. BR—Query or change the UART baud rate....................................................13
5.1.12. UM—Query or configure the UART mode ......................................................14
5.1.13. UI—Query or configure the UART indicator output mode ...............................15
5.1.14. DB—Query or configure the default Bypass mode .........................................16
5.1.15. MD—Make the Bluetooth module discoverable..............................................16
5.1.16. PA—Query of change the status of pairing mode ...........................................17
5.1.17. CA—Query of change the state of connectable mode....................................17
5.1.18. CP—Clear the paired Bluetooth device list .....................................................18
5.2. SPP Commands ..................................................................................................18
5.2.1. CS—Connect to the remote SPP device ..........................................................18
5.2.2. DS—Disconnect with the remote SPP device...................................................19
5.2.3. SS—Query the state of each SPP channel.......................................................20
5.2.4. DT—Send data packet to remote SPP device ..................................................20
5.3. HID Commands ...................................................................................................20
5.3.1. CI—Connect to the remote HID host ................................................................21
5.3.2. DI—Disconnect with the remote HID host ........................................................21
5.3.3. IS—Query the state of HID channel..................................................................21
5.3.4. KR—Send HID report to remote HID host ........................................................22
5.3.5. AS—Send ASCII string to remote HID host ......................................................25

EH-MA41 User Guide
3-26
1. Introduction
The Ehong Control Interface (EHCI) is a set of ASCII commands and indicators with which the user can control the
Ehong’s Bluetooth module via UART interface by a host (PC, MCU, etc.).
The commands are used to control the Bluetooth module sent by host. The indicators are output from the Bluetooth
module to the host to indicate the status of the module.
In addition, there are some IO indicators available when the UART is used to transfer raw data (working in Bypass
mode). As a complement of ASCII commands and indicators, the IO indicators are also a part of EHCI.
1.1. Default UART Configuration
The default configuration of UART is given below:
Baud rate: 115200
Data bits: 8
Stop bits: 1
Parity: None
Flow control: None
2. Command and Indicator Syntax
2.1. General Syntax
The general syntax of EHCI command is shown as below:
AT+CMD[=Para1][,Para2][,RawData][,…]<CR><LF>
The general syntax of EHCI indicator is shown as below:
IDC[=Para1][,Para2][,RawData][,…]<CR><LF>
Description of each field:
AT+ is the command line prefix.
CMD is the basic command. All of the commands are listed in section 3 .
IDC is the basic indicator. All of the indicators are listed in section 4 .
= is the separator between command/indicator and parameter. It’s only needed if a parameter is presented.
Para1 is the first parameter. Not all of the commands have a parameter.
, is the separator between parameters. It’s only needed if subsequent parameter is presented.
Para2 is the second parameter if available.
RawData is the raw data which will be sent by the command. Only parts of the commands have this field.
<CR><LF> is the terminator of the command line.
Notes:
1. If a parameter is mandatory, it will be surrounded by { }. If a parameter is optional, it will be surrounded by [ ].
2. <CR> means Carriage Return, and <LF> means Line-Feed.
3. All of the parameters are composed of ASCII characters while the RawData field can composed of any data contents.
2.2. Examples
Here is some examples show how to use the EHCI commands and indicators.
Ex. 2.1
AT+FT=01,00,00,0A,01,0078<CR><LF> configure the module features.
OK<CR><LF> response from the module to indicate the command is adopted.
Notes:
1. For the examples in this document, the command sent to the Bluetooth module will be shown with “”at the
beginning of the line, while the indicator output by Bluetooth module will be shown with “”at the beginning of
the line.
2. For the examples in this document, the comments will start with a “”and be written in italic.

EH-MA41 User Guide
4-26
3. For the examples in this document, only the characters in grey background color are the real content of a
command or indicator.
Ex. 2.2
AT+CS=00189600ABCD<CR><LF> establish SPP connection with the device which address is
00:18:96:00:AB:CD.
SS=01,00189600ABCD<CR><LF> the Bluetooth module is now connecting to the specified device which
address is 00:18:96:00:AB:CD.
CS=00,00189600ABCD<CR><LF> connecting result: success.
SS=02,00189600ABCD<CR><LF> the Bluetooth module is now connected to the specified device which
address is 00:18:96:00:AB:CD.
3. Command List
All the available EHCI commands are listed and briefly described in the tables below. The detailed description of each
command can be given in chapter.
Command
Short Description
Comments
General Commands
PF
Query or configure the profiles of the module.
AD
Query the Bluetooth address of the module.
TP
Query or change the Tx Power of the module.
CD
Query or configure the Class of Device of the module.
FT
Query or configure the features of the module.
MM
Query or configure Man-In-The-Middle protection feature.
IO
Query or configure IO capability of local device.
MT
Query or configure force to be master feature.
PN
Query or change the fixed pin code of the module.
NM
Query or change the local friendly name of the module.
BR
Query or change the UART baud rate.
UM
Query or change the UART mode.
UI
Query or change the UART indicator output mode.
DB
Query or change the default bypass mode.
MD
Query or change the state of discoverable mode.
PA
Query or change the state of pairing mode.
CA
Query or change the state of connectable mode.
CP
Clear the paired Bluetooth device list.
SPP Commands
CS
Connect to the remote SPP device.
DS
Disconnect with the remote SPP device.
SS
Query the SPP state of each SPP instance.
DT
Send data packet to remote SPP device.
HID Commands
CI
Connect to the remote HID host.
DI
Disconnect with the remote HID host.
IS
Query the HID state.
KR
Send keyboard report to remote HID host.
AS
Send ASCII string to remote HID host.
4. Indicator List
All the available EHCI indicators are listed and briefly described in the tables below.
EHCI Indicator List

EH-MA41 User Guide
5-26
Indicator
Short Description
Comments
General Indicators
OK
Indicates a command was adopted by the module.
ER
Indicates there is an error detected in the command
sent by the host.
AP
State of Bluetooth module as an application.
AD
Bluetooth address of the module.
TP
Tx Power of the module
CD
Class of Device of the module.
PF
Configuration of profiles of the module.
FT
Features of the module.
MM
States of Man-In-The-Middle protection.
IO
Configuration of IO capability of local device.
MT
Configuration of force to be master feature.
SN
Configuration of sniff feature.
SP
The deep sleep state.
PN
Fixed pin code of the module.
NM
Local friendly name of the module.
IF
Host interface of the module
BR
UART baud rate.
UM
Configuration of UART mode.
UI
Configuration of UART indicator output.
RC
Configuration of remote control function.
PM
Configuration of PIO assignment
DB
Default configuration of bypass mode.
MD
Discoverable state.
PA
State of pairing mode.
CA
State of connectable mode
NC
Six digit number of numeric comparison.
PK
Passkey request.
AC
Voltage of AIO
IR
Inquiry result.
FD
Address and name of found device.
LC
List the connected devices
SPP Indicators
SM
Service name of the SPP profile.
SS
State of SPP channel.
CS
Result of connect attempt to a remote SPP device.
DT
Data packet received from remote SPP device.
HID Indicators
IS
State of HID.
CI
Result of connect attempt to a remote HID host.
KR
Keyboard report received from remote HID host.
5. Description of ASCII Commands

EH-MA41 User Guide
6-26
5.1. General Commands
5.1.1. PF—Query or configure the profiles
5.1.1.1. Description:
This command can query or configure the profiles of Bluetooth module. Once configured, the configuration will take effect
immediately and until the next time the module is configured by this command. It means the Bluetooth module will
remember the configuration, and even if the Bluetooth module has been powered off, the configuration will not be lost. If
the new configuration is adopted by the Bluetooth module, the module will perform a reboot, the non-memorable settings
will return to their default value. Therefore, it is recommended to send this command first if necessary.
If the parameter is not presented, the Bluetooth module will report current profile configuration by the Indicator PF.
5.1.1.2. Syntax:
Synopsis: Comments
AT+PF[=Spp][,Hid][,Rfc]<CR><LF> For MA41 and MA46
5.1.1.3. Parameter Description:
Parameter
Description
Mandatory or Optional
Comments
SPP
SPP disable or enable
Value: 00 or 01
Default: 01
M
Rfc
IAP disable or enable
Value: 00 or 01
Default: 00
M
Hid
HID disable or enable
Value: 00 or 01
Default: 00
M
5.1.1.4. Examples:
Ex. 5.1. To query current profile configuration of Bluetooth module (MA41 or MA46):
AT+PF<CR><LF> query current profile configuration.
PF=05,01,01,00,00<CR><LF> report current profile configuration: 5 SPP instance,1 HID instance,1
RFCOMM instance.
Ex. 5.2. To configure the features of Bluetooth module (MA41 or MA46):
AT+PF=04,00,00,00,00<CR><LF> configure the module profiles: 4 SPP instance and no HID and RFCOMM
profile supported.
OK<CR><LF> response from the module to indicate the command is adopted.
AP=00<CR><LF> Indicate that the Bluetooth has performed a reboot and is ready now.
Ex. 5.3. To configure the features of Bluetooth module (MB05 or ):
AT+PF=01,00,01,00,02,02<CR><LF> configure the module profiles: 1 SPP instance, 1 RFCOMM instance, 2
A2DP instance and 2 AVRCP instance supported.
OK<CR><LF> response from the module to indicate the command is adopted.
AP=00<CR><LF> Indicate that the Bluetooth has performed a reboot and is ready now.
5.1.2. AD—Query the Bluetooth address
5.1.2.1. Description:
This command can query the Bluetooth address of local module. Once the Bluetooth module adopted this query request,
it will report its Bluetooth address by the Indicator AD.
5.1.2.2. Syntax:
Synopsis:

EH-MA41 User Guide
7-26
AT+AD<CR><LF>
5.1.2.3. Examples:
Ex. 5.4. To query the Bluetooth address of local module:
AT+AD<CR><LF> query the Bluetooth address of local module.
AD=00189600ABCD<CR><LF> report the Bluetooth address is 00:18:96:00:AB:CD.
5.1.3. TP—Query or change the Tx Power
5.1.3.1. Description:
This command can query or configure the transmit power of Bluetooth module. Once configured, the configuration will
take effect immediately and until the next time the module is configured. It means the Bluetooth module will remember
the configuration, and even if the Bluetooth module has been powered off, the configuration will not be lost.
If the parameter is not presented, the Bluetooth module will report current transmit power configuration by the Indicator
TP.
5.1.3.2. Syntax:
Synopsis:
AT+TP[=DefaultTx][,MaximumTx]<CR><LF>
5.1.3.3. Parameter Description:
Parameter
Description
Mandatory or
Optional
Comments
Default Tx
Default TX power in dBm. The
default TX power used for
paging, inquiry, and their
responses, and as the initial
power for new ACL links.
Value: a 8 digits signed number
Default: 00.
O
The values of this
parameter will
always be
rounded to the
next available
value in the radio
power table.
Maximum Tx
Maximum TX power in dBm.
Bluetooth power control may
raise the TX power up to this
value.
Value: a 8 digits signed number
Default: 00.
O
The values of this
parameter will
always be
rounded to the
next available
value in the radio
power table.
Notes:
Please do NOT change the default configuration of Tx Power if not necessary.
5.1.3.4. Examples:
Ex. 5.5. To query current Tx Power configuration of Bluetooth module:
AT+TP<CR><LF> query current Tx Power configuration.
TP=04,04<CR><LF> report current Tx Power configuration: default Tx Power is 4dBm and maximum Tx
Power is 4dBm.
Ex. 5.6. To configure the Tx Power of Bluetooth module:
AT+TP=FC,00<CR><LF> configure the Tx Power, set default Tx Power to -4dBm(FCh = -4), set the maximum
Tx Power to 0dBm.
TP=FC,00<CR><LF> response from the module to indicate the command is adopted and report the real
Tx Power configuration after rounded.
5.1.4. CD—Query or configure the Class of Device
5.1.4.1. Description:
This command can query or configure the Class of Device (COD) of Bluetooth module. Once configured, the
configuration will take effect immediately and until the next time the module is configured by this command or the module
is rebooted. It means the Bluetooth module will not remember the configuration, and after the Bluetooth module has been
powered off, the configuration will be lost.
If the parameter is not presented, the Bluetooth module will report current COD by the Indicator CD.

EH-MA41 User Guide
8-26
5.1.4.2. Syntax:
Synopsis:
AT+CD[=Cod]<CR><LF>
5.1.4.3. Parameter Description:
Parameter
Description
Mandatory or Optional
Comments
Cod
The Cod of the Bluetooth module
Value:a 6 digits number
Default: per firmware version
O
Notes:
1. The default COD has been configured properly by the Bluetooth firmware stack, so it is not necessary for
user to configure it in general.
2. Some Bluetooth device will filter the devices by COD when searching for new device.
5.1.4.4. Examples:
Ex. 5.7. To query current COD configuration of Bluetooth module:
AT+CD<CR><LF> query current COD configuration.
CD=001F00<CR><LF> report current COD configuration: 001F00.
Ex. 5.8. To configure the COD of Bluetooth module:
AT+CD=000540<CR><LF> configure the module COD: 000540.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.5. FT—Query or configure the features
5.1.5.1. Description:
This command can query or configure the features of Bluetooth module. Once configured, the configuration will take
effect immediately and until the next time the module is configured by this command. It means the Bluetooth module will
remember the configuration, and even if the Bluetooth module has been powered off, the configuration will not be lost.
If the parameter is not presented, the Bluetooth module will report current feature configuration by the Indicator FT. If the
user wants to configure the features, all of the parameters should be given together.
5.1.5.2. Syntax:
Synopsis:
AT+FT[=ATPowerOn,ACPaired,ATLinkLost,Interval,DiscMode,DiscTimeout]<CR><LF>
5.1.5.3. Parameter Description:
Parameter
Description
Mandatory or Optional
Comments
AT Power On
The attempt times of auto connect
the last connected device after
power on.
Value: 00h—FFh
00: No auto connect attempt will
be performed after power on.
01-FE: The attempt times of auto
connect after power on.
FF: The auto connect attempt will
be performed permanently.
Default: FF (Permanent)
O
AC Paired
Auto connects after paired with a
device. Value: 00 or 01
00: Disabled
01: Enabled
Default: 00 (Disabled)
O

EH-MA41 User Guide
9-26
AT Link Lost
The attempt times of reconnect
after link lost.
Value: 00h—FFh
00: No reconnect attempt will be
performed after link lost.
01-FE: The attempt times of
reconnect after link lost.
FF: The reconnect attempt will be
performed permanently.
Default: FF (Permanent)
O
Interval
The interval between each
reconnect attempt after link lost.
The unit is second. Value: 00h—
FFh
Default: 0A (10 seconds)
O
Disc Mode
The discoverable mode.
Value: 00h—03h
00: The module will enter or quit
discoverable mode just by the
command AT+MD=xx.
01: The module will enter
discoverable mode automatically
when paired device list is empty.
02: The module will enter
discoverable mode automatically
when power on.
03: The module will enter
discoverable mode automatically
when there is no connection.
Default: 01 (Auto discoverable
when empty)
O
Even if the
discoverable is set
one of the auto
mode (01 h—03h),
it can also be
controlled by the
command
AT+MD=xx.
Disc Time out
The timeout of discoverable status.
The unit is second.
Value: 0000h—FFFFh
0000: No timeout for discoverable
status.
O
0001-FFFF: The timeout in second of discoverable status.
Notes:
The default feature configuration may be different per software version.
5.1.5.4. Examples:
Ex. 5.9. To query current feature configuration of Bluetooth module:
AT+FT<CR><LF> query current feature configuration.
FT=FF,00,FF,0A,01,0078<CR><LF> report current feature configuration.
The auto connection after power on has been enabled as permanent mode;
The auto connect after paired has been disabled;
The auto reconnect after link lost has been enabled as permanent mode;
The interval of auto reconnect has been set to 10s.
Set the discoverable mode as auto discoverable when empty.
The timeout of discoverable is 120s.
Ex. 5.10. To configure the features of Bluetooth module:
AT+FT=14,00,00,0A<CR><LF> configure the module features:
Set the attempt time of auto connect after power on as 20 times;
Disable the auto connect after paired;
No reconnect attempt will be performed after link lost;
Set the interval of auto reconnect to 10s.
Keep the discoverable mode and timeout as it was.
OK<CR><LF> response from the module to indicate the command is adopted.

EH-MA41 User Guide
10-26
5.1.6. MM—Query or configure Man-In-The-Middle protection
feature
5.1.6.1. Description:
This command can query or configure the Man-In-The-Middle protection feature of Bluetooth module. Once configured,
the configuration will take effect immediately and until the next time the module is configured by this command. It means
the Bluetooth module will remember the configuration, and even if the Bluetooth module has been powered off, the
configuration will not be lost.
If the parameter is not presented, the Bluetooth module will report current configuration by the Indicator MM.
5.1.6.2. Syntax:
Synopsis:
AT+MM[=State]<CR><LF>
5.1.6.3. Parameter Description:
Parameter
Description
Mandatory
Comments
State
The new state of Man-In-The-
Middle protection. Value: 00h or
02h
00: Deactivated
01: Activated
02: Activated and auto confirm the
numeric comparison.
Default: 02 (Activated and auto
confirm)
O
The default value
may be different
per software
version.
Notes:
1. A man-in-the-middle (MITM) attack occurs when a user wants to connect two devices but instead of connecting
directly with each other they unknowingly connect to a third (attacking) device that plays the role of the device they
are attempting to pair with. The third device then relays information between the two devices giving the illusion that
they are directly connected. The attacking device may even eavesdrop on communication between the two devices
(known as active eavesdropping) and is able to insert and modify information on the connection. In this type of
attack, all of the information exchanged between the two devices are compromised and the attacker may inject
commands and information into each of the devices thus potentially damaging the function of the devices. Devices
falling victim to the attack are capable of communicating only when the attacker is present. If the attacker is not
active or out range, the two victim devices will not be able to communicate directly with each other and the user will
notice it.
2. To prevent MITM attacks, Secure Simple Pairing offers two user assisted numeric methods: numerical comparison
or passkey entry. If Secure Simple Pairing would use 16 decimal digit numbers, then the usability would be the
same as using legacy pairing with 16 decimal digit PIN. The chance for a MITM to succeed inserting its own link
keys in this case is a 1 in 1016 = 253 pairing instances, which is an unnecessarily low probability.
Secure Simple Pairing protects the user from MITM attacks with a goal of offering a 1 in 1,000,000 chance that a
MITM could mount a successful attack. The strength of the MITM protections was selected to minimize the user
impact by using a six digit number for numerical comparison and Passkey entry. This level of MITM protection was
selected since, in most cases, users can be alerted to the potential presence of a MITM attacker when the
connection process fails as a result of a failed MITM attack. While most users feel that provided that they have not
compromised their passkey, a 4-digit key is sufficient for authentication (i.e. bank card PIN codes), the use of six
digits allows Secure Simple Pairing to be FIPS compliant and this was deemed to have little perceivable usability
impact.
3. If the Man-In-The-Middle protection feature is activated, the module may output the number for numeric comparison
by indicator NC or a passkey request by indicator PK. About the command NC and PK, please refer to section
5.1.24 and 5.1.25.
4. If the Man-In-The-Middle protection feature is activated, the IO capability can only be configured to “Display
Yes/No”or “Keyboard Only”. About the IO capability, please refer to section 5.1.7 .
5. When connect with some Android device by the SPP profile, it is required to active the Man-In-The-Middle
protection.
5.1.6.4. Examples:
Ex. 5.11. To query current Man-In-The-Middle protection state of the Bluetooth module:
AT+MM<CR><LF> query the current Man-In-The-Middle protection state.

EH-MA41 User Guide
11-26
MM=00<CR><LF> report the Man-In-The-Middle protection is deactivated currently.
Ex. 5.12. To active Man-In-The-Middle protection feature:
AT+MM=01<CR><LF> active Man-In-The-Middle protection feature.
OK<CR><LF> response from the module to indicate the command is adopted.
Ex. 5.13. To active Man-In-The-Middle protection feature, and let the module confirm the numeric comparison
automatically:
AT+MM=02<CR><LF> active Man-In-The-Middle protection feature and auto confirm the numeric
comparison. Thus, no NC indicator will be output by the module.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.7. IO—Query or configure the IO capability of local device
5.1.7.1. Description:
This command can query or configure the IO (input and output) capability of local device when pairing. Once configured,
the configuration will take effect immediately and until the next time the module is configured by this command. It means
the Bluetooth module will remember the configuration, and even if the Bluetooth module has been powered off, the
configuration will not be lost.
If the parameter is not presented, the Bluetooth module will report current configuration by the Indicator IO.
5.1.7.2. Syntax:
Synopsis:
AT+IO[=IoCapability]<CR><LF>
5.1.7.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Io Capability
The new IO capability of local
device.
Value: 00h –03h
00: Display Only. The local device
can only display
01: Display Yes/No. The local
device can display and select Yes
or No.
02: Keyboard Only. The local
device can only input.
03: No IO. The local device has no
IO capability
Default: 01 (Display Yes/No)
O
The default value
may be different
per software
version.
Notes:
1. When the Man-In-The-Middle protection feature is enabled, different IO capability will cause different pairing
procedure. In case of “Display Yes/No”, both remote and local device will prompt a six digits numbers, the user
should compare and confirm if the two numbers are the same or not, and then select Yes or No on the remote device
accordingly, for the module side, the host MCU should send the command AT+NC=01 or AT+NC=00 to confirm or
deny the numeric comparison. In case of “Keyboard Only”, the remote device will prompt a six digits number as
passkey, the user should input the same number at the Bluetooth module side by command AT+PK (refer to section
5.1.25).
2. The “Display Only”and “No IO”are not allowed when the Man-In-The-Middle protection feature is enabled.
5.1.7.4. Examples:
Ex. 5.14. To query current IO capability configuration of local device:
AT+IO<CR><LF> query current IO capability configuration of local device.
IO=03<CR><LF> report current IO capability configuration of local device is “No IO”.
Ex. 5.15. To configure the IO capability of local device as “Keyboard Only”:
AT+IO=02<CR><LF> configure the IO capability of local device as “Keyboard Only”.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.8. MT—Query or configure force to be master feature
5.1.8.1. Description:

EH-MA41 User Guide
12-26
This command can query or configure the force to be master feature of Bluetooth module. Once configured, the
configuration will take effect at the next time when a Bluetooth connection is being established and until the next time the
module is configured by this command. It means the Bluetooth module will remember the configuration, and even if the
Bluetooth module has been powered off, the configuration will not be lost.
If the parameter is not presented, the Bluetooth module will report current configuration by the Indicator MT.
5.1.8.2. Syntax:
Synopsis:
AT+MT[=State]<CR><LF>
5.1.8.3. Parameter Description:
Parameter
Description
Mandatory
Comments
State
The new state of force to be
master feature.
Value: 00h or 01h
00: Deactivated
01: Activated
Default: 00 (Deactivated)
O
Notes:
1. In general, the device which initiates the Bluetooth connection will act as the Master automatically. Only some special
devices which cannot be a master device, in such cases, the user can use this command to make the Bluetooth
module force to be master device.
2. Ehong’s Bluetooth module can act as either Master or Slave device, i.e. it can either initiate a Bluetooth connection or
accept a connection request.
5.1.8.4. Examples:
Ex. 5.16. To query current state of force to be master feature:
AT+MT<CR><LF> query current state of force to be master feature.
MT=00<CR><LF> report the force to be master feature is deactivated currently.
Ex. 5.17. To active the force to be master feature:
AT+MT=01<CR><LF> active the force to be master feature.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.9. PN—Query or change the fixed pin code
5.1.9.1. Description:
This command can query or change the fixed pin code of Bluetooth module. Once changed, the new pin code will take
effect at next pairing procedure and until the next time the pin code is changed by this command. It means the Bluetooth
module will remember the pin code, and even if the Bluetooth module has been powered off, the pin code will not be lost.
If the parameter is not presented, the Bluetooth module will report current pin code by the Indicator PN.
5.1.9.2. Syntax:
Synopsis:
AT+PN[=PinCode]<CR><LF>
5.1.9.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Pin Code
The new fixed pin code of the
Bluetooth module.
Length: 1—16 characters
Default: 0000
O
The default pin
code may not be
“0000” per
software version.
5.1.9.4. Examples:
Ex. 5.24. To query current fixed pin code of Bluetooth module:
AT+PN<CR><LF> query current fixed pin code.
PN=0000<CR><LF> report current fixed pin code, it’s “0000”.
Ex. 5.25. To change the fixed pin code of Bluetooth module:
AT+PN=abcdef<CR><LF> change the fixed pin code to “abcdef”
OK<CR><LF> response from the module to indicate the command is adopted.

EH-MA41 User Guide
13-26
5.1.10. NM—Query or change the local friendly name
5.1.10.1. Description:
This command can query or change the local friendly name of Bluetooth module. Once changed, the new friendly name
will take effect at next time the remote device get local name and until the next time the friendly name is changed by this
command. It means the Bluetooth module will remember the friendly name, and even if the Bluetooth module has been
powered off, the friendly name will not be lost.
If the parameter is not presented, the Bluetooth module will report current friendly name by the Indicator NM.
5.1.10.2. Syntax:
Synopsis:
AT+NM[=Name]<CR><LF>
5.1.10.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Name
The new local friendly name of the
Bluetooth module.
Length: 1—30 characters
Default: Per software version.
O
5.1.10.4. Examples:
Ex. 5.26. To query current local friendly name of Bluetooth module:
AT+NM<CR><LF> query current local friendly name.
NM=EH-MA41<CR><LF> report current local friendly name, it’s “EH-MA41”.
Ex. 5.27. To change the local friendly name of Bluetooth module:
AT+NM=MY_BT_DEVICE<CR><LF> change the local friendly name to “MY_BT_DEVICE”
OK<CR><LF> response from the module to indicate the command is adopted.
Notes:
For MB18 module, the module will append “_L” at the end of given name as the BLE device name. That means, in the
above example, the BLE device name will be changed to “MY_BT_DEVICE_L”.
5.1.11. BR—Query or change the UART baud rate
5.1.11.1. Description:
This command can query or change the UART baud rate of Bluetooth module. Once changed, the new baud rate will
take effect immediately and until the next time the baud rate is changed by this command. It means the Bluetooth module
will remember the baud rate, and even if the Bluetooth module has been powered off, the baud rate will not be lost.
If the parameter is not presented, the Bluetooth module will report current baud rate by the Indicator BR.
5.1.11.2. Syntax:
Synopsis:
AT+BR[=BaudRate]<CR><LF>
5.1.11.3. Parameter Description:
Parameter
Description
Mandatory
Comments

EH-MA41 User Guide
14-26
Baud Rate
The new baud rate of the
Bluetooth module.
Value: 01h—15h
01: 1200
02: 1800
03: 2400
04: 4800
05: 7200
06: 9600
07: 14400
08: 19200
09: 38400
0A: 56000
0B: 57600
0C: 115200
0D: 128000
0E: 230400
0F: 256000
10: 460800
11: 921600
12: 1382400
13: 1843200
14: 2764800
15: 3686400
O
The default baud
rate may not be
9600 per software
version.
Remark: Default: 06 (9600)
Warning:
Please do NOT try to change to a new baud rate if you don't have a host which can work in that baud rate, for there is no
other way to restore it except for UART port.
5.1.11.4. Examples:
Ex. 5.30. To query the baud rate of Bluetooth module:
AT+BR<CR><LF> query the baud rate.
BR=06<CR><LF> report the baud rate, it’s 9600.
Ex. 5.31. To change the baud rate of Bluetooth module:
AT+BR=0C<CR><LF> change the baud rate to 115200.
OK<CR><LF> response from the module to indicate the command is adopted.
Notes:
The response will be sent in current baud rate.
5.1.12. UM—Query or configure the UART mode
5.1.12.1. Description:
This command can query or configure the UART mode of Bluetooth module. Once configured, the configuration will take
effect immediately and until the next time the module is configured by this command. It means the Bluetooth module will
remember the configuration, and even if the Bluetooth module has been powered off, the configuration will not be lost.
If the parameter is not presented, the Bluetooth module will report current configuration by the Indicator UM.
5.1.12.2. Syntax:
Synopsis:
AT+UM[=StopBits,Parity][,Latency]<CR><LF>
5.1.12.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Stop Bits
The stop bits of UART mode
Value: 00h or 01h
00: 1 stop bit
01: 2 stop bits
Default: 00 (1 stop bit)
O

EH-MA41 User Guide
15-26
Parity
The parity of UART mode
Value: 00h –02h
00: No parity
01: Odd parity
02: Even parity
Default: 00 (No parity)
O
Latency
The latency mode
Value: 00h or 01h
00: Throughput priority
01: Low latency priority
Default: 01( Low latency priority)
O
5.1.12.4. Examples:
Ex. 5.32. To query the UART mode of Bluetooth module:
AT+UM<CR><LF> query the UART mode.
UM=00,00,01<CR><LF> report the UART mode, it’s 1 stop bit, no parity and low latency priority.
Ex. 5.33. To change the UART mode of Bluetooth module:
AT+UM=01,01<CR><LF> change the UART mode to 2 stop bits and odd parity.
OK<CR><LF> response from the module to indicate the command is adopted.
Notes:
1. The response will be sent in current UART mode.
Ex. 5.34. To change the UART mode to throughput priority:
AT+UM=00,00,00<CR><LF> change the UART mode to 1 stop bits, no parity and throughput priority.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.13. UI—Query or configure the UART indicator output mode
5.1.13.1. Description:
This command can query or configure (disable or enable) the UART indicator output mode of Bluetooth module. Once
configured, the configuration will take effect immediately and until the next time the module is configured by this
command. It means the Bluetooth module will remember the configuration, and even if the Bluetooth module has been
powered off, the configuration will not be lost.
If the parameter is not presented, the Bluetooth module will report current configuration by the Indicator UI.
5.1.13.2. Syntax:
Synopsis:
AT+UI[=State]<CR><LF>
5.1.13.3. Parameter Description:
Parameter
Description
Mandatory
Comments
State
The new state of UART indicator
output mode
Value: 00h or 01h
00: Disabled
01: Enabled
o
Default: 01
(Enabled)
5.1.13.4. Examples:
Ex. 5.35. To query current UART indicator output mode of the Bluetooth module:
AT+UI<CR><LF> query current UART indicator output mode.
UI=01<CR><LF> report the UART indicator output is enabled currently.
Notes:
If the UART indicator output is disabled currently, the report will not be output.
Ex. 5.36. To disable the UART indicator output:
AT+UI=00<CR><LF> disable the UART indicator output

EH-MA41 User Guide
16-26
no response output because the UART indicator output has been disabled
Ex. 5.37. To enable the UART indicator output:
AT+UI=01<CR><LF> enable the UART indicator output
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.14. DB—Query or configure the default Bypass mode
5.1.14.1. Description:
This command can query or configure the default bypass mode of Bluetooth module. Once configured, the configuration
will take effect at the next time the module is power on. It means the Bluetooth module will remember the configuration
and even if the Bluetooth module has been powered off, the configuration will not be lost, but the configuration will NOT
take effect immediately.
5.1.14.2. Syntax:
Synopsis:
AT+DB[=Enable][,SpeedMode]<CR><LF>
5.1.14.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Enable
The new Bypass channel mode:
Value:
00: Proxy mode
01: Enable transparent transfer mode
Default: 00
O
Speed Mode
The new Bypass speed mode:
Value: 00h or 01h
00: Normal speed
01: High speed
Default: 00
O
There are 2 different speed mode explained below:
0. Normal speed mode
When working in this mode, the Bluetooth module will try to parse the content received from UART to find if there is a BP
command, so the speed is affected accordingly.
1. High speed mode
When working in this mode, the Bluetooth module will transfer the content received from UART to bypass channel
directly. In this case the Bluetooth module will not parse the content, so the host cannot change the bypass mode by BP
command.
2. Proxy mode
When working in this mode, the content sent to the Bluetooth module via UART port will be treated as ASCII command.
And the content sent from the Bluetooth module should be treated ASCII indicator.
When there is not any connection has been established, the Bluetooth module is working in this mode.
Note:
To configure this command, you must first disconnect to take effect.
5.1.14.4. Examples:
Ex. 5.42. To query current configuration of default Bypass mode of the Bluetooth module:
AT+DB<CR><LF> query current configuration of default Bypass mode.
DB=00,00<CR><LF> report the configuration of default Bypass mode.
Ex. 5.43. To configure the default Bypass mode:
AT+DB=01,01<CR><LF> configure the default Bypass mode.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.15. MD—Make the Bluetooth module discoverable
5.1.15.1. Description:
This command can query or change the Bluetooth module’s discoverable status. Only when the Bluetooth module is
discoverable, it can be found by other Bluetooth device.

EH-MA41 User Guide
17-26
If the parameter is not presented, the Bluetooth module will report current discover status by the Indicator MD.
5.1.15.2. Syntax:
Synopsis:
AT+MD[=Status]<CR><LF>
5.1.15.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Status
The new status of discoverable.
Value: 00h or 01h
00: Not discoverable
01: Discoverable
O
Default: 00 (Not
discoverable)
5.1.15.4. Examples:
Ex. 5.45. To query the current discoverable status of the Bluetooth module:
AT+MD<CR><LF> query the current discoverable status.
MD=00<CR><LF> report the Bluetooth module is not discoverable currently.
Ex. 5.46. To make Bluetooth module discoverable:
AT+MD=01<CR><LF> make Bluetooth module discoverable.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.16. PA—Query of change the status of pairing mode
5.1.16.1. Description:
This command can query or change the Bluetooth module’s pairing mode status. Only when the pairing mode is enabled,
it can be paired/bonded with other Bluetooth device.
If the parameter is not presented, the Bluetooth module will report current status of pairing mode by the Indicator PA.
5.1.16.2. Syntax:
Synopsis:
AT+PA[=Status]<CR><LF>
5.1.16.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Status
The new status of pairing mode.
Value: 00h or 01h
00: Pairing/Bonding disabled
01: Pairing/Bonding enabled
Default: 01 (Enabled)
O
The default baud
rate may not be
9600 per software
version.
5.1.16.4. Examples:
Ex. 5.47. To query the current pairing mode status of the Bluetooth module:
AT+PA<CR><LF> query the current pairing mode status.
PA=01<CR><LF> report the pairing is enabled currently.
Ex. 5.48. To disable the pairing mode of the Bluetooth module:
AT+PA=00<CR><LF> disable the pairing mode.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.17. CA—Query of change the state of connectable mode
5.1.21.1. Description:
This command can query or change the Bluetooth module’s connectable mode state. Only when the connectable mode
is enabled, it can be connected with other Bluetooth device.

EH-MA41 User Guide
18-26
If the parameter is not presented, the Bluetooth module will report current state of connectable mode by the Indicator CA.
5.1.17.2. Syntax:
Synopsis:
AT+CA[=State]<CR><LF>
5.1.17.3. Parameter Description:
Parameter
Description
Mandatory
Comments
State
The new state of connectable
mode.
Value: 00h or 01h
00: connect disabled
01: connect enabled
Default: 01 (Enabled)
o
5.1.17.4. Examples:
Ex. 5.49. To query the current connectable mode state of the Bluetooth module:
AT+CA<CR><LF> query the current connectable mode state.
CA=01<CR><LF> report the connectable mode is enabled currently.
Ex. 5.50. To disable the connectable mode of the Bluetooth module:
AT+CA=00<CR><LF> disable the connectable mode.
OK<CR><LF> response from the module to indicate the command is adopted.
5.1.18. CP—Clear the paired Bluetooth device list
5.1.18.1. Description:
This command can clear the paired device list stored in the Bluetooth module. If there is some Bluetooth device is
connected with the Bluetooth module, it will perform a disconnection before clear the paired device list.
5.1.18.2. Syntax:
Synopsis:
AT+CP<CR><LF>
5.1.18.3. Examples:
Ex. 5.54. To clear the paired device list:
AT+CP<CR><LF> clear the paired device list.
OK<CR><LF> response from the module to indicate the command is adopted.
5.2. SPP Commands
5.2.1. CS—Connect to the remote SPP device
5.2.1.1. Description:
This command will make the Bluetooth module to connect to the remote Bluetooth SPP device. If the Bluetooth address
parameter is not presented, the Bluetooth module will attempt to connect to the last connected SPP device.
5.2.1.2. Syntax:
Synopsis:
AT+CS[=BdAddr][,NameId]<CR><LF>
Parameter
Description
Mandatory
Comments
BdAddr
The Bluetooth address of the Bluetooth
SPP device to connect.
O

EH-MA41 User Guide
19-26
Name ID
The name ID of this connection. Once
connected, the host can use the name ID
to identify the source or destination.
Value: 40h—4xh (x is the maximum SPP
instance count, refer to 5.1.1)
O
This is only available
when both of the two
sides are Ehong’s
software.
Notes:
1. If either local or remote device has already established a SPP connection with some other device use the same Name
ID, the remote device will disconnect with local device immediately.
2. Once the connection with a specified Name ID has been successfully established, the Bluetooth module will remember
the Name ID and use this Name ID to auto connect after power on and auto reconnect after link lost(if these features are
enabled).
5.2.1.4. Examples:
Ex. 5.77. To connect to the last connected SPP device:
AT+CS<CR><LF> connect to the last connected device with the SPP profile.
SS=01,00189600ABCD<CR><LF> the Bluetooth module is now connecting to the last connected device which
address is 00:18:96:00:AB:CD.
CS=00,00189600ABCD<CR><LF> connecting result: success.
SS=02,00189600ABCD<CR><LF> the Bluetooth module is now connected to the last connected device.
Ex. 5.78. To connect to the specified device with the SPP profile:
AT+CS=00189600000A<CR><LF> connect to the specified device 00:18:96:00:00:0A with the SPP profile.
SS=01,00189600000A<CR><LF> the Bluetooth module is now connecting to the specified SPP device which
address is 00:18:96:00:00:0A.
CS=00,00189600000A<CR><LF> connecting result: success.
SS=02,00189600000A<CR><LF> the Bluetooth module is now connected to the specified SPP device.
Ex. 5.79. To connect to the specified SPP device with the Name ID 13:
AT+CS=00189600000A,43<CR><LF> connect to the specified device 00:18:96:00:00:0A with the Name ID 43.
SS=01,00189600000A,43<CR><LF> the Bluetooth module is now connecting to the specified SPP device which
address is 00:18:96:00:00:0A,use Name ID 43.
CS=00,00189600000A<CR><LF> connecting result: success.
SS=02,00189600000A,43<CR><LF> the Bluetooth module is now connected to the specified SPP device,
the Name ID is 43.
5.2.2. DS—Disconnect with the remote SPP device
5.2.2.1. Description:
This command will make Bluetooth module to disconnect with the remote Bluetooth SPP device. If the Bluetooth address
parameter is not presented, the Bluetooth module will disconnect with all of the connected SPP devices.
5.2.2.2. Syntax:
Synopsis:
AT+DS[=BdAddr]<CR><LF>
5.2.2.3. Parameter Description:
Parameter
Description
Mandatory
Comments
BdAddr
The Bluetooth address of the
Bluetooth SPP device to
disconnect.
O
5.2.2.4. Examples:
Ex. 5.80. To disconnect with all of the connected SPP devices:
AT+DS<CR><LF> disconnect with all of the connected SPP devices.
SS=00<CR><LF> the SPP channel 0 of Bluetooth module is now disconnected and is connectable.
SS=10<CR><LF> the SPP channel 1 of Bluetooth module is now disconnected and is connectable.
SS=30<CR><LF> the SPP channel 3 of Bluetooth module is now disconnected and is connectable.
Ex. 5.81. To disconnect to the specified device:

EH-MA41 User Guide
20-26
AT+DS=00189600000A<CR><LF> disconnect with the specified device 00:18:96:00:00:0A.
SS=00<CR><LF> the SPP channel 0 of Bluetooth module is now disconnected and is connectable.
5.2.3. SS—Query the state of each SPP channel
5.2.3.1. Description:
This command is used to query the state of each SPP channel.
5.2.3.2. Syntax:
Synopsis:
AT+SS<CR><LF>
5.2.3.3. Examples:
Ex. 5.82. To query the state of each SPP channel:
AT+SS<CR><LF> query the state of each SPP channel.
SS=01,00189600ABCD<CR><LF> the SPP channel 0 of Bluetooth module is now connecting to the remote
device which address is 00:18:96:00:AB:CD.
SS=12,00189601ABCD<CR><LF> the SPP channel 1 of Bluetooth module is now connected with the remote
device which address is 00:18:96:01:AB:CD.
SS=22,00189603ABCD,43<CR><LF> the SPP channel 2 of Bluetooth module is now connected with the remote
device which address is 00:18:96:02:AB:CD, the name ID is 43.
SS=30<CR><LF> the SPP channel 3 of Bluetooth module is now connectable
SS=40<CR><LF> the SPP channel 4 of Bluetooth module is now connectable
SS=50<CR><LF> the SPP channel 5 of Bluetooth module is now connectable
5.2.4. DT—Send data packet to remote SPP device
5.2.4.1. Description:
This command is used to send a data packet to the remote SPP device.
5.2 .4.2. Syntax:
Synopsis:
AT+DT{=ChannelOrNameId,DataLen,Data}<CR><LF>
5.2.4.3. Parameter Description:
Parameter
Description
Mandatory
Comments
Channel Or Name ID
The SPP channel ID or Name
ID which will be used to send
the data packet.
Value: 00h—0xh or 40h—4xh
(x is the maximum SPP
instance count, refer to 5.1.1)
00—0x: the channel ID of SPP
40—4x: the name ID of SPP
M
Data Len
The length in bytes of the data
to be sent.
Value: 00h-FFh
M
Data
The raw data.
M
5.2.4.4. Examples:
Ex. 5.83. To send data use SPP channel 0:
AT+DT=00,0A,1234567890<CR><LF> send a data packet use SPP channel 0, the data length is 10(Dec).
OK<CR><LF> response from the module to indicate the command is adopted.
Ex. 5.84. To send data use SPP Name ID 13h:
AT+DT=43,0A,1234567890<CR><LF> send a data packet use SPP Name ID 43h, the data length is 10
OK<CR><LF> response from the module to indicate the command is adopted.
5.3. HID Commands
Other manuals for EH-MA41
1
Table of contents
Other Ehong Recording Equipment manuals