BM100 BT5.0 Programming User Guide Version 3.3 1 Revision History Version Data Notes 1.0 2.0 3.0 3.1 3.2 3.3 2015/09/10 First Release 2016/03/21 Add LE GATT Commands 2016/11/12 Add HID Commands 2016/12/13 Add GPIO Indications 2019/05/05 2019/08/08 Add LE Commands Add AT+LEADDR AT+LENAME Author Tony Jerry Navy Navy Navy Navy Contact Us:
Marson Technology Co., Ltd. 9F., 108-3, Minquan Rd., Xindian Dist., New Taipei City, Taiwan TEL: 886-2-2218-1633 FAX: 886-2-2218-6638 E-mail: info@marson.com.tw Web: www.marson.com.tw 2 Contents 1. Introduction .................................................................................................................................... 5 1.1 Terms ........................................................................................................................................................ 5 1.2 Hardware Interface ................................................................................................................... 5 1.3 Supported Bluetooth Profile .................................................................................................. 5 1.4 Command Format ...................................................................................................................... 5 1.5 Indication Format ...................................................................................................................... 6 1.6 Module Default Settings ........................................................................................................... 6 2. Command Table ............................................................................................................................................ 7 2.1 General Commands ........................................................................................................ 7 2.1.1 UART Communication Test ................................................................................................ 7 2.1.2 Read Firmware Version .................................................................................................... 7 2.1.3 Read BR/EDR MAC Address .................................................................................. 7 2.1.4 Read BLE MAC Address .......................................................................................... 8 2.1.5 Read/Write BR/EDR Local Name ....................................................................... 8 2.1.6 Read/Write BLE Local Name ............................................................................... 9 2.1.7 Read/Write Pin Code ................................................................................................... 9 2.1.8 Turn On/Off Secure Simple Pairing <need reboot> ............................................................................................... 10 2.1.9 Read/Write UART Baudrate .................................................................................. 10 2.1.10 Read/Write Class Of Device <need reboot> ................................................................................................................... 10 2.1.11 Read/Write Run Mode...................................................................................... 11 2.1.12 Read/Clear Paired Record ..................................................................................... 11 2.1.13 Turn On/Off Throughput Mode ...................................................................... 12 2.1.14 Turn On/Off Low Power Mode ........................................................................ 12 2.1.15 Turn On/Off Hardware Flow Control <need reboot> ..................................................................................... 13 2.1.16 Turn On/Off Power On Auto Reconnect <need reboot> .......................................................................... 13 2.1.17 Release All Connections ....................................................................................... 13 2.1.18 Soft Reboot ............................................................................................................... 14 2.1.19 Restore Factory Settings ......................................................................................... 14 2.1.20 Scan Nearby Devices ............................................................................................. 14 2.1.21 PIO Function Configuration ................................................................................ 14 2.2 Bluetooth Serial Commands (BR/EDR SPP) ............................................................... 15 2.2.1 Read SPP State ................................................................................................................... 15 2.2.2 Establish SPP Connection .................................................................................... 15 2.2.3 Release SPP Connection ....................................................................................... 15 2.2.4 Send Data Via SPP ....................................................................................................... 15 2.3 Bluetooth Serial Commands (LE Peripheral) .............................................................. 16 2.3.1 Read LE Peripheral State ............................................................................................... 16 2.3.2 Send Data Via LE Peripheral ............................................................................... 16 2.4 Bluetooth Serial Commands (LE Central) .................................................................... 16 2.4.1 Read LE Central State ...................................................................................................... 16 2.4.2 Establish LE Central Connection ........................................................................ 16 2.4.3 Send Data Via LE Central ..................................................................................... 17 3 2.5 Bluetooth Serial Commands (BR/EDR HID) .................................................................. 17 2.5.1 Read HID State ................................................................................................................... 17 2.5.2 Establish HID Connection .................................................................................... 17 2.5.3 Release HID Connection ....................................................................................... 18 2.5.4 Read/Write HID Send Delay .................................................................................. 18 2.5.5 Read/Write HID Transfer Mode ........................................................................ 18 2.5.6 IOS Device On-screen Keyboard Toggle .................................................................... 19 2.5.7 Send Data Via HID ....................................................................................................... 19 3. Indication Table ............................................................................................................................................... 19 3.1 General Indications ................................................................................................................. 19 3.1.1 Scan Result .................................................................................................................... 19 3.2 Bluetooth Serial Indications ............................................................................................... 20 3.2.1 SPP State ............................................................................................................................... 20 3.2.2 LE Peripheral State .......................................................................................................... 20 3.2.3 LE Central State ................................................................................................................. 21 3.2.4 HID State .............................................................................................................................. 21 3.2.5 HID Transfer Mode .............................................................................................. 21 3.2.6 HID Send Success ........................................................................................................ 22 3.3 GPIO Indications ...................................................................................................................... 22 3.3.1 LED Pin .............................................................................................................................. 22 3.3.2 State Pin ............................................................................................................................ 22 4 Federal Communications Commission (FCC) Statement This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions:
1) this device may not cause harmful interference, and 2) this device must accept any interference received, including interference that may cause undesired operation of the device. This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to part 15 of the FCC rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates, uses and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures:
-Reorient or relocate the receiving antenna.
-Increase the separation between the equipment and receiver.
-Connect the equipment into an outlet on a circuit different from that to which the receiver is connected.
-Consult the dealer or an experienced radio/TV technician for help. FCC Caution: Any changes or modifications not expressly approved by the party responsible for compliance could void the user's authority to operate this equipment. This transmitter must not be co-located or operating in conjunction with any other antenna or transmitter. FCC RF Radiation Exposure Statement This equipment complies with FCC RF radiation exposure limits set forth for an uncontrolled environment. This equipment should be installed and operated with a minimum distance of 20 centimeters between the radiator and your body. Note: The end product shall has the words Contains FCC ID: IRJ-BM100. OEM statement The Original Equipment Manufacturer (OEM) must ensure that the OEM modular transmitter must be labeled with its own FCC ID number. This includes a clearly visible label on the outside of the final product enclosure that displays the contents shown below. If the FCC ID is not visible when the equipment is installed inside another device, then the outside of the device into which the equipment is installed must also display a label referring to the enclosed equipment. The end product with this module may subject to perform FCC part 15B unintentional emission test requirement and be properly authorized while installation to host(s), and platform, and integrator are obligated to have its manual or instruction with the related compliance warning to end users. This device is intended for OEM integrator only. The end product with this module may be subject to re-evaluate RF exposure as per 47CFR 2.1091, and 2.1093 if antenna or usage, including co-located usage of other transmitters, of the subsequent installation are changed. 5 This radio transmitter has been approved by FCC to operate with the antenna types listed below, with the maximum permissible gain indicated. Antenna types not included in this list that Have a gain greater than the maximum gain indicated for any type listed are strictly prohibited for use with this device. No. 1 Brand Walsin Technology Corporation Part number Type Connector Gain (dBi) RFANT5220110A0T Multilayer ceramic antenna N/A 2.66 6 1. Introduction This specification presents design guidelines for software engineers that use BM100 series modules for Bluetooth requirements. 1.1 Terms Throughout this specification:
{ } Content between {} is optional
<< Content behind << represents a COMMAND sent from Host to Module
>> Content behind >> represents a RESPONSE sent from Module to Host 1.2 Hardware Interface GPIO PWM UART SPI Master I2C Master/Slave Analog Input/Output 1.3 Supported Bluetooth Profile SPP (Serial Port Profile) GATT Server (Generic Attribute Profile) GATT Client (Generic Attribute Profile) HID Keyboard (H uman Interface Profile) 1.4 Command Format AT+ Command {=Param 1{, Param 2{, Param3...}}} <CR><LF>
All commands start with AT, end with <CR><LF>
<CR> stands for "carriage return", corresponding hex is 0x0D
<LF> stands for "line feed", corresponding hex is 0x0A If command has parameter, parameter keep behind =
If command has multiple parameters, parameter must be separated by , If command has response, response start with <CR><LF>, end with <CR><LF>
Module will always report commands execution result using OK for success or 7 ERROR for failure e.g. 1. Read modules BR/EDR local name
<< AT+NAME
+NAME=Feasycom
>> OK 2. Write a baudrate which is not supported
<< AT+BAUD=0
>> ERROR 1.5 Indication Format
<CR><LF>+ Indication {=Param 1{, Param 2{, Param 3...}}} <CR><LF>
All indications start with <CR><LF>, end with <CR><LF>
If indication has parameter, parameter keep behind =
If indication has multiple parameters, parameter must be separated by , e.g. 1. Received 1234567890 from mobile phone via SPP profile
+SPPDATA=10,1234567890 1.6 Module Default Settings Local Name (BR/EDR) Local Name (LE) Pin Code Secure Simple Pairing Mode Physical UART Baudrate FSC-BT826EN FSC-BT826EN-LE 0000 OFF 115200 bps/8/N/1 8 2. Command Table 2.1 General Commands 2.1.1 UART Communication Test Format: AT Response: OK Description : Test the UART communication between HOST and Module after power on, baudrate changed, etc. Example: UART communication test
AT OK 2.1.2 Read Firmware Version Format: AT+VER Response: +VER=Param Param: Firmware version (16 Bytes ASCII) Example: Read modules firmware version
AT+VER
+VER=8.3.1,FSCBT816S OK 2.1.3 Read BR/EDR MAC Address Format: AT+ADDR Response: +ADDR=Param Param: Modules BR/EDR MAC address (12 Bytes ASCII) 9 Example: Read Modules BR/EDR MAC address
AT+ADDR
+ADDR=DC0D30123456 OK 2.1.4 Read BLE MAC Address Format: AT+ LEADDR Response: +LEADDR=Param Param: Modules BLE MAC address (12 Bytes ASCII) Example: Read Modules BLE MAC address
AT+LEADDR
+LEADDR=DD0D30123456 OK 2.1.5 Read/Write BR/EDR Local Name Format: AT+NAME {=Param1{, Param2}}
Param1: BR/EDR local name (1~31 Bytes ASCII, default: FSC-BT826E) Param2: MAC address suffix (0/1, default:0)
(0) Disable suffix
(1) Enable suffix -XXXX (lower 4 bytes of MAC address) after local name Response: +NAME=Param Description : Write local name if parameter existence, otherwise read current local name Example: Read current BR/EDR local name
AT+NAME
+NAME=Feasycom OK Example: Change modules BR/EDR local name to ABC
AT+NAME=ABC OK Example: Change modules BR/EDR local name to ABC and enable suffix 10
AT+NAME=ABC,1 OK 2.1.6 Read/Write BLE Local Name Format: AT+ LENAME {=Param1{, Param2}}
Param1: BLE local name (1~31 Bytes ASCII, default: FSC-BT826E-LE) Param2: MAC address suffix (0/1, default:0)
(0) Disable suffix
(1) Enable suffix -XXXX (lower 4 bytes of MAC address) after local name Response: +LENAME=Param Description : Write local name if parameter existence, otherwise read current local name Example: Read current BLE local name
AT+LENAME
+LENAME=FeasycomLE OK Example: Change modules BLE local name to ABC
AT+LENAME=ABC OK Example: Change modules BLE local name to ABC and enable suffix
AT+LENAME=ABC,1 OK 2.1.7 Read/Write Pin Code Format: AT+PIN{=Param}
Param: Pin code (4~15 Bytes ASCII, default:0000) Response: +PIN=Param Example: Read modules pin code
AT+PIN
+PIN=0000 OK 11 Example: Change modules pin code to 1234
AT+PIN=1234 OK 2.1.8 Turn On/Off Secure Simple Pairing<need reboot>
Format: AT+SSP{=Param}
Param: Simple pairing (0/1, default:1)
(0) Turn off
(1) Turn on Response: +SSP=Param Description : Pin code input will be bypassed if simple pairing is on in pairing procedure 2.1.9 Read/Write UART Baudrate Format: AT+BAUD{=Param}
Param: Baudrate (2400/4800/9600/19200/38400/57600/115200/230400/ 256000/
460800/512000/921600 , default:115200 ) Response: +BAUD=Param Description : Modules baudrate will be changed immediately after received this command 2.1.10 Read/Write Class Of Device <need reboot>
Format: AT+COD{=Param}
Param: Class of device (6 bytes ASCII, default:240404 Handsfree device) Response: +COD=Param 12 2.1.11 Read/Write Run Mode Format: AT+ MODE{=Param}
Param: Run Mode (1~4, default:4)
(1) SPP Mode
(2) HID Mode
(3) BLE Mode
(4) SPP+BLE Mode Response: +MODE=Param Description : After the command is executed, the BT8XX switches to the new Run Mode Example: Read current Run Mode
AT+MODE
+MODE=4 OK Example: Change modules Run Mode to HID Mode
AT+MODE=2 OK 2.1.12 Read/Clear Paired Record Format: AT+PLIST{=Param}
Param:(0/(1~8)/12 Bytes MAC address) (0) Clear all paired record
(1~8) Clear specific paired record with index
(MAC) Clear specific paired record with MAC address Response1: +PLIST= {
Response2: +PLIST=Param1, Param2 Param1: (1~8) Paired devices index Param2: (MAC) Paired devices MAC address Response3: +PLIST=}
Example: Read modules paired record
AT+PLIST
+PLIST= {
+PLIST=1,1C5CF226D773 13
+PLIST=2, A0BC30075421
+PLIST=}
OK Example: Clear modules paired record
AT+PLIST=0 OK 2.1.13 Turn On/Off Throughput Mode Format: AT+TPMODE{=Param}
Param: Throughput mode (0/1, default:0)
(0) Turn Off
(1) Turn On Response: +TPMODE=Param Description : When SPP/HID/GATT profile connected and throughput mode is on, the AT command will be de-active, every byte received via physical UART will be sent to air, vice visa Example: Read current throughput mode
AT+TPMODE
+TPMODE=1 OK Example: Turn off throughput mode
AT+TPMODE=0 OK 2.1.14 Turn On/Off Low Power Mode Format: AT+ LPM{=Param}
Param: Low Power Mode (0/1, default:0)
(0) Turn Off
(1) Turn On Response: +LPM=Param Description : This instruction is only applicable to BT816S module 14 Example: Read current Low Power Mode
AT+LPM
+LPM=0 OK Example: Turn on Low Power Mode
AT+LPM=1 OK 2.1.15 Turn On/Off Hardware Flow Control<need reboot>
Format: AT+ FLOWCTL{=Param}
Param: Hardware Flow Control (0/1, default:1)
(0) Turn Off
(1) Turn On Response: +FLOWCTL=Param 2.1.16 Turn On/Off Power On Auto Reconnect <need reboot>
Format: AT+ AUTOCONN{=Param}
Param: Option (0/1, default:1)
(0) Turn Off
(1-15) Turn on Response: +AUTOCONN=Param Description : Module will attempt to connect last device after power on if set and
+MODE=1/+MODE=2 2.1.17 Release All Connections Format: AT+ DSCA Description : Module release all Bluetooth connections with remote device 15 2.1.18 Soft Reboot Format: AT+REBOOT Description : Module release all Bluetooth connections with remote device then reboot 2.1.19 Restore Factory Settings Format: AT+RESTORE Description : Module restore all factory settings then reboot 2.1.20 Scan Nearby Devices Format: AT+SCAN =Param1{, Param2{, Param3}}
Param1:(0 ~2)
(0) Stop scan
(1) Scan nearby BR/EDR devices
(2) Scan nearby BLE devices Param2:(1~48) Scan period. unit:1.28s, default:12.8s Description : Refer to Chapter 3 for format description of scan result 2.1.21 PIO Function Configuration Format: AT+ PIOCFG{=Param1,Param2 }
Param1 Param2 0: Disable Command/Transmission mode switch function 1: Enable Command/Transmission mode switch function 0: Disable Bluetooth disconnect function 1:
Enable Bluetooth disconnect function Response: +PIOCFG=Param1,Param2 16 2.2 Bluetooth Serial Commands (BR/EDR SPP) 2.2.1 Read SPP State Format: AT+SPPSTAT Response: +SPPSTAT=Param Param: Refer to Chapter 3 for state description 2.2.2 Establish SPP Connection Format: AT+SPPCONN{=Param}
Param: MAC address of target device (12 Bytes ASCII) Description : If the parameter does not exist, the module will attempt to connect to the last device 2.2.3 Release SPP Connection Format: AT+SPPDISC Description : Release current SPP connection with remote device 2.2.4 Send Data Via SPP Format: AT+SPPSEND=Param1, Param2 Param1 : Payload length (1~180) Param2 : Payload (1~180Bytes UTF8) Description : If throughput mode is on, this command is de-active Example: Send data 1234567890 to remote device via SPP
AT+SPPSEND=10,1234567890 OK 17 2.3 Bluetooth Serial Commands (LE Peripheral) 2.3.1 Read LE Peripheral State Format: AT+GATTSTAT Response: +GATTSTAT=Param Param: Refer to Chapter 3 for state description 2.3.2 Send Data Via LE Peripheral Format: AT+GATTSEND=Param1, Param2 Param1 : Payload length (1~155) Param2 : Payload (1~155 Bytes UTF8) Description : If throughput mode is on, this command is de-active Example: Send data 1234567890 to remote device via LE Peripheral
AT+GATTSEND=10,1234567890 OK 2.4 Bluetooth Serial Commands (LE Central) 2.4.1 Read LE Central State Format: AT+LESTAT Response: +LESTAT=Param Param: Refer to Chapter 3 for state description 2.4.2 Establish LE Central Connection Format: AT+LECONN=Param 1{,Param2,Param3,Param4}
Param1: MAC address of target device & MAC address type (13 Bytes ASCII) 16 Param2: Service-UUID, Support 16 Bit and 128 Bit (4 Bytes/32 Bytes ASCII) Param3: Write-UUID, Support 16 Bit and 128 Bit (4 Bytes/32 Bytes ASCII) Param4: Notify-UUID, Support 16 Bit and 128 Bit (4 Bytes/32 Bytes ASCII) Description : If parameter 2, parameter 3, parameter 4 do not exist, the module will automatically search for the GATT service connected to the remote device Example: Specified remote device service connections
AT+LECONN=123456ABCDEF0,FFF0,FFF2,FFF1 OK 2.4.3 Send Data Via LE Central Format: AT+LESEND=Param1, Param2 Param1 : Payload length (1~180) Param2 : Payload (1~180 Bytes UTF8) Description : If throughput mode is on, this command is de-active Example: Send data 1234567890 to remote device via LE Central
AT+LESEND=10,1234567890 OK 2.5 Bluetooth Serial Commands (BR/EDR HID) 2.5.1 Read HID State Format: AT+HIDSTAT Response: +HIDSTAT=Param Param: Refer to Chapter 3 for state description 2.5.2 Establish HID Connection Format: AT+HIDCONN{=Param}
17 Param: MAC address of target device (12 Bytes ASCII) Description : If the parameter does not exist, the module will attempt to connect to the last device 2.5.3 Release HID Connection Format: AT+HIDDISC Description : Release current HID connection with remote device 2.5.4 Read/Write HID Send Delay Format: AT+HIDDLY{=Param}
Param: HID Send Delay (2~4 Bytes ASCII,Default:10 ) Response: +HIDDLY=Param Description : Different phones may require different delay settings to achieve the best HID transmission speed and stability Example: Read current HID Send Delay
AT+HIDDLY
+HIDDLY=10 OK 2.5.5 Read/Write HID Transfer Mode Format: AT+HIDMODE{=Param}
Param: HID Mode (0 ~ 10 , Default:1) Response: +HIDMODE=Param Description : This command applies to keyboards in multiple countries . Refer to Chapter 3 for format description of hid mode 18 Example: Read current HID Mode
AT+HIDMODE
+HIDMODE=0 OK Example: Change modules hid mode to Spain Keyboard
AT+HIDMODE=4 OK 2.5.6 IOS Device On-screen Keyboard Toggle Format: AT+ HIDOSK Description : This instruction applies only to the IOS Device 2.5.7 Send Data Via HID Format: AT+HIDSEND=Param1, Param2 Param1 : Payload length (1~180) Param2 : Payload (1~180 Bytes UTF8) Description : If throughput mode is on, this command is de-active Example: Send data 1234567890 to remote device via HID
AT+HIDSEND=10,1234567890 OK 3. Indication Table 3.1 General Indications 3.1.1 Scan Result Format: +SCAN =Param1 , Param2 , Param3, Param4 {, Param5 , Param6}
Param1: Index (1~8) 19 Param2: Device address type (0~2)
(0)LE public address
(1)LE random address
(2)BR/EDR address Param3 : MAC address (12 Bytes ASCII) Param4: RSSI (-255 ~ 0) Param5: Size of Param6 if exist Param6: Device Name for BR/EDR devices or advertising data for LE devices Description : Param5/Param6 may not exist if remote device out of distance Example: Scan nearby BR/EDR devices
AT+SCAN=1 OK
+SCAN={
+SCAN=1,2, DC0D30000003, 32,8, Feasycom
+SCAN=2,2, DC0D30000044, 64,8, Feasycom_1234
+SCAN=3,2, DC0D30000097, 47,8, TESTHID
+SCAN=}
3.2 Bluetooth Serial Indications 3.2.1 SPP State Format: +SPPSTAT=Param Param:(0 ~3)
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected 3.2.2 LE Peripheral State Format: +GATTSTAT=Param Param:(0 ~3)
(0) Unsupported
(1) Standby
(2) Connecting 20
(3) Connected 3.2.3 LE Central State Format: +LESTAT=Param Param:(0 ~3)
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected 3.2.4 HID State Format: +HIDSTAT=Param Param:(0 ~3)
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected 3.2.5 HID Transfer Mode Format: +HIDMODE=Param Param:(0 ~10)
(0) HID Key Value
(1) English Keyboard
(2) USA Keyboard
(3) Turkey Keyboard
(4) Spain Keyboard
(5) Portugal Keyboard
(6) France Keyboard
(7) Germany Keyboard
(8) Italy Keyboard
(9) Czech Keyboard
(10) Japan Keyboard 21 3.2.6 HID Send Success Format: +HIDSEND Description : HID mode buffer data transmission success indication HIDSEND 3.3 GPIO Indications 3.3.1 LED Pin PIN 32 (Output) Low Level Initializing Blink in 1Hz Ready to connecting High Level Connected 3.3.2 State Pin PIN 33 (Output) Low Level High Level Disconnected Connected 22