FSC-BT936D programming user guide

Introduction

[中文]

Description

This design guide is suitable for engineers to develop FSC-BT936D series Bluetooth modules

Module Default Settings

Name

FSC-BT936D-XXXX

LE-Name

FSC-BT936D-LE-XXXX

Pin Code

0000

Secure Simple Pairing Mode

On

UART Baudrate

115200/8/N/1

Hardware Description

Pin Diagram

_images/BT936D_pin_map.png

Pin Description

Pin

Pin Name

Type

Pin Descriptions

4

MIC_N

Audio

MIC input, negative

5

MIC_P

Audio

MIC input, positive

6

MIC_BIAS

Audio

MIC Power Supplies

7

SPK_LP

Audio

Headphone/speaker differential L output, positive

8

SPK_LN

Audio

Headphone/speaker differential L output, negative

12

SPK_RN

Audio

Headphone/speaker differential R output, negative

13

SPK_RP

Audio

Headphone/speaker differential R output, positive

19

VDD

VDD

Power supply for I/O ports, DC 3.3V

20

GND

GND

GND

21

LED2

I/O

output 1KHZ square wave when not connected with phone,
output high level when connected with phone.

22

LED1

I/O

output low level when not connected with headphone,
output high level when connected with headphone.

23

RESET

I

External reset input: active Low

31

UART_TX

O

UART TX

32

UART_RX

I

UART RX

35

ANT

ANT

external antenna

Hardware Design Notes

  • The simple test of the module only needs to connect VDD/GND/UART_RX/UART_TX to use

  • After drawing the schematic diagram, please send it to Feasycom for review, so as to prevent the Bluetooth distance from not reaching the best effect

Function Description

Profiles & Features

  • SPP (Serial Port Profile)

  • GATTS (Generic Attribute Profile LE-Peripheral role)

  • GATTC (Generic Attribute Profile LE-Central role)

  • HFP-HF (Hands-Free Profile)

  • HFP-AG (Hands-Free-AG Profile)

  • A2DP-Sink (Advanced Audio Distribution Profile)

  • A2DP-Source (Advanced Audio Distribution Profile)

  • AVRCP-Controller (Audio/Video remote controller Profile)

  • AVRCP-Target (Audio/Video remote controller Profile)

  • HID-DEVICE (Human Interface Profile)

  • PBAP (Phonebook Access Profile)

GATT Throughput Service

  • Service : 0000B360-D6D8-C7EC-BDF0-EAB1BFC6BCBC

  • Write、Notify : 0000B362-D6D8-C7EC-BDF0-EAB1BFC6BCBC

Command Description

Terms

  • Throughout this specification:

  • Content between { } is optional

  • Content behind << represents a COMMAND from Host

  • Content behind >> represents a RESPONSE/EVENT to Host

Command Format

AT+Command{=Param1{,Param2{,Param3…}}}<CR><LF>

  • All commands start with “AT”, end with <CR><LF>

  • <CR> means “carriage return”, corresponds to hex value 0x0D

  • <LF> means “line feed”, corresponds to hex value 0x0A

  • If Command has Parameter, Parameter follows behind ‘=’

  • If Command has multiple Parameters, Parameter must be separated by ‘,’

  • If Command has Response, Response starts with <CR><LF>, ends with <CR><LF>

  • Module will always report command’s execution result by using “OK” for success or “ERR<code>” for failure

Error Code

Meaning

001

Failed

002

Invalid parameter

003

Invalid state

004

Command mismatch

005

Busy

006

Command not supported

007

Profile not turned on

008

No memory

Others

Reserved for future use

Example:Read module’s BR/EDR local name
<< AT+VER
>> +NAME=FSC-BT936D-0123
>> OK
Example:Pick up an incoming call when no call incoming actually
<< AT+HFPANSW
>> ERR003

Event Format

<CR><LF>+Indication{=Param1{,Param2{,Param3…}}}<CR><LF>
  • All Events start with <CR><LF>, end with <CR><LF>

  • If Event has Parameter, Parameter follow behind ‘=’

  • If Event has multiple Parameters, Parameter must be separated by ‘,’

  • Use command AT+SEP to replace default separator for conflict prevention

  • For some events, use “-”、”~” to replace “+”

Example:
Received “1234567890” from mobile phone via SPP profile
>> +SPPDATA=10,1234567890
Example:
Dial number “10086” using a mobile phone when HFP connected
>> +HFPSTAT=4,3,3
>> +HFPAUDIO=1,0,0
>> +HFPCID=10086
>> +HFPSTAT=6,3,6
Example:
First earphone HFP connection successful
>> -HFPDEV=ABCD12347890,AirPods

Commands Table

General Commands

AT+SEP - Read/Write Event separator

Command

AT+SEP{=Param}

Param

set range: 0x01~0xFF,default: ‘,’ ,Where ‘0’ indicates 0xFF

Response

Returns the current separator

Description

The parameters for events/responses may contain the same value as the default separator
Use this command to replace the default separator for conflict prevention
(Usually replace the default separator “, “with the hexadecimal value” xFF”)
Example: Read the module pairing record
<< AT+PLIST
>> +PLIST=1,32808,1C5CF226D773, Tony, iPhone12
>> +PLIST=2,40, A0BC30075421, Samsung S8
>> +PLIST=E
>> OK
Example: Set separator to ‘0xFF’
<< AT+SEP=0
>> OK
Example: Read the module pairing record again
<< AT+PLIST
>> +PLIST=1<FF>32808<FF>1C5CF226D773<FF>Tony, iPhone12
>> +PLIST=2<FF>40<FF> A0BC30075421<FF>Samsung S8
>> +PLIST=E
>> OK

AT+VER - Get Firmware Version

Command

AT+VER

Response

+VER=Param1,Param2,Param3

Param1

Module type

Param2

Firmware version

Param3

Data of production

Note

The date of production in response will not be changed after firmware upgrade

Example:
<< AT+VER
>> +VER=BT936D,V1.0.2,20230802
>> OK

AT+BAUD - Get/Set Uart Baudrate

Command

AT+BAUD{=Param}

Param

baudrate (2400/4800/9600/19200/38400/57600/128000/230400/
256000/460800/512000/921600/1382400, default:115200)

Response

+BAUD=Param

Param

baudrate

Description

Module will change baudrate to target value immediately

Example:
Query baudrate
<< AT+BAUD
>> +BAUD=115200
>> OK

Change baudrate
<< AT+BAUD=9600
>> OK

AT+MICGAIN - Get/Set Analog Input Gain

Command

AT+MICGAIN{=Param}

Param

Gain (0~15, default:8), Support ‘+’, ‘-’ adjustment

Description

Adjust input volume

AT+SPKVOL - Get/Set Analog Output Volume

Command

AT+SPKVOL{=Param}

Param

VOL (0~15, default:12), Support ‘+’, ‘-’ adjustment

Description

Adjust output volume

Note

Adjust the volume of the call during the call, otherwise adjust the volume of the music

AT+REBOOT - Soft Reboot

Command

AT+REBOOT

Response

OK

Description

Module release all Bluetooth connections with remote device then reboot

Example:
<< AT+RESTORE
>> OK

AT+RESTORE - Restore Factory Settings

Command

AT+RESTORE

Response

OK

Description

Module restore all factory settings then reboot

Example:
<< AT+RESTORE
>> OK

AT+PROFILE - Bluetooth Profile Selection

Command

AT+PROFILE{=Param}

Param

A base-10 representation of a bit field, for each bit:

BIT[0]

SPP (Serial Port Profile)

BIT[1]

GATT Server (Generic Attribute Profile)

BIT[2]

GATT Client (Generic Attribute Profile)

BIT[3]

HFP-HF (Hands-Free Profile Handsfree)

BIT[4]

HFP-AG (Hands-Free Profile Audio Gateway)

BIT[5]

A2DP Sink (Advanced Audio Distribution Profile)

BIT[6]

A2DP Source (Advanced Audio Distribution Profile)

BIT[7]

AVRCP Controller (Audio/Video remote controller Profile)

BIT[8]

AVRCP Target (Audio/Video remote controller Profile)

BIT[9]

HID Keyboard (Human Interface Profile)

BIT[10]

PBAP Server (Phonebook Access Profile)

BIT[15]

iAP2 (For iOS devices)

Response

+PROFILE=Param

Description

This command does not need to be set,

Example:Read current profile selection
<< AT+PROFILE
>> +PROFILE=1531

AT+DEVSTAT - Read device status

Command

AT+DEVSTAT

Response

+DEVSTAT=Param

Param

A base-10 representation of a bit field,

BIT[0]

0: Power Off; 1: Power On

BIT[1]

0: BR/EDR Not Discoverable; 1: BR/EDR Discoverable

BIT[2]

0: BLE Not Advertising; 1: BLE Advertising

BIT[3]

0: BR/EDR Not Scanning; 1: BR/EDR Scanning

BIT[4]

0: BLE Not Scanning; 1: BLE Scanning

Example:usual combination and description

0

Device power off

1

Device power on

3

Device power on, BR/EDR Discoverable

5

Device power on, BR/EDR Not Discoverable, BLE Advertising

7

Device power on, BR/EDR Discoverable, BLE Advertising

13

Device power on, BR/EDR Not Discoverable, BLE Advertising, Scanning nearby BR/EDR devices

AT+ADDR - Get BR/EDR MAC Address

Command

AT+ADDR

Response

+ADDR=Param

Param

Module’s BR/EDR MAC address (12 Bytes ASCII)

Example:
<< AT+ADDR
>> +ADDR=DC0D30010203
>> OK

AT+LEADDR - Get BLE MAC Address

Command

AT+LEADDR

Response

+LEADDR=Param

Param

Module’s LE MAC address (12 Bytes ASCII)

AT+NAME - Get/Set BR/EDR Local Name

Command

AT+NAME{=Param1{,Param2}}

Param1

BR/EDR local name(1~31 Bytes ASCII)

Param2

MAC address suffix(0/1,default:1)
0: Disable suffix
1: Enable suffix “-XXXX” (lower 4 bytes of MAC address) after local name
2: Enable suffix “-XXXXXX” (lower 6 bytes of MAC address) after local name

Response

+NAME=Param

Param

Bluetooth Name

Description

Write local name if parameter exist, otherwise read current local name

Example:Read current BR/EDR local name
<< AT+NAME
>> +NAME=FSC-BT936D-XXXX
>> OK
Example:Change module’s BR/EDR local name to “ABC”,and disable suffix
<< AT+NAME=ABC,0
>> OK
Example:Change module’s BR/EDR local name to “ABC” and enable suffix
<< AT+NAME=ABC,1
>> OK

AT+LENAME - Get/Set BLE Local Name

Command

AT+LENAME{=Param1{,Param2}}

Param1

BLE local name(1~25 Bytes ASCII)

Param2

MAC address suffix(0/1,default:1)
0: Disable suffix
1: Enable suffix “-XXXX” (lower 4 bytes of MAC address) after local name
2: Enable suffix “-XXXXXX” (lower 6 bytes of MAC address) after local name

Response

+LENAME=Param

AT+SSP - Get/Set BR/EDR Pairing Mode

Command

AT+SSP{=Param}

Param

Pairing mode (0~3, default:2)
(0) Legacy pairing, use pin code for pairing
(1) Secure simple pairing, auto pairing
(2) Secure simple pairing, display yes/no in pairing
(3) Secure simple pairing, passkey compare,
user need to accept/reject pair request with command AT+CFM

Response

+SSP=Param

Note

need reboot

AT+PIN - Get/Set BR/EDR Pin Code

Command

AT+PIN{=Param}

Param

Pin code(4~15 Bytes ASCII, default:0000)

Response

+PIN=Param

Description

Pin code only work in legacy pairing mode, see AT+SSP

Example:Read module’s pin code
<< AT+PIN
>> +PIN=0000
>> OK
Example: Change module’s pin code to “1234”
<< AT+PIN=1234
>> OK

AT+CFM - Accept/Reject Remote Pairing Request

Command

AT+CFM=Param1, Param2

Param1

12 Bytes MAC address of remote device

Param2

0-Reject remote pairing request
1-Accept remote pairing request

Description

Only used for pairing request in pairing mode 3, see AT+SSP

AT+PAIR: Get/Set BR/EDR/BLE Visibility

Command

AT+PAIR=Param

Param

Mode(0-3)
0: Leave BR/EDR/BLE discoverable mode (stop advertising/broadcasting)
1: Enter BR/EDR discoverable mode (start broadcasting)
2: Enter BLE discoverable mode (start advertising)
3: Enter BR/EDR/BLE discoverable mode (start advertising/broadcasting)

Description

Module will always be discoverable if no device connected (BR/EDR or BLE),
and be undiscoverable if connected with remote device, unless received this command

AT+PAGE: Get/Set BR/EDR Connectability

Command

AT+PAGE=Param

Param

Mode(0-1)
0: Leave BR/EDR connectable mode (stop paging)
1: Enter BR/EDR connectable mode (start paging)

Description

Module will always be connectable mode if no device connected,
and be unconnectable if connected with remote device, unless received this command

AT+SCAN - Scan Nearby Devices

Command

AT+SCAN=Param1{,Param2{,Param3}}

Param1

scan type(0~3)
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

Param3

(1~25 Bytes ASCII)Name filter. Filter scan results with name if set

Param4

EDR:(1~25 Bytes ASCII)COD filter. BLE:1-Scan tire pressure equipment

Description

Format description reference: +SCAN - Scan Result +HFPSTAT - HFP State

AT+RSSI: Get BR/EDR Signal Strength

Command

AT+RSSI=Param

Param

12 Bytes MAC address of current connected device

Response

+PIN=Param

Param

RSSI value (-127 ~ 0)

AT+PLIST - Get/Delete Paired List

Command

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=Param1, Param2, Param3{,Param4}

Param1

(1~8) Paired device’s index

Param2

A base-10 representation of a bit field, support profiles of device, see AT+PROFILE

Param3

(MAC) Paired device’s MAC address

Param4

(UTF8) Paired device’s name

Response2

+PLIST=E End of the paired record

Example:Read module’s paired record
<< AT+PLIST
>> +PLIST=1,32808,1C5CF226D773, iPhone12
+PLIST=2,40, A0BC30075421, Samsung S8
+PLIST=E
>> OK
Example:Clear module’s paired record
<< AT+PLIST=0
>> OK

AT+DSCA - Release All Connections

Command

AT+DSCA{=Param}

Param

(0/1/12 Bytes MAC address)
(0) Disconnect Bluetooth from phone
(1) Disconnect Bluetooth from headphones
(MAC) Disconnect from specified MAC address
Disconnect all connected Bluetooth if no parameter set

Description

Module release all Bluetooth connections with remote device

Module release all Bluetooth connections with remote device

Command

AT+AUDROUTE{=Param}

Param

Note: HF1 & HF2 means peer Bluetooth headphones
0 Stop audio routing
1 Route music (a2dp streaming) from Module to HP1/HP2 simultaneously
2 Route voice call (hfp sco) between Module and HP1
3 Route voice call (hfp sco) between Module and HP2
4 Route voice call (hfp sco) between HP1 and HP2 (intercom mode)
5 Route voice call (hfp sco) from Module to HP1/HP2 simultaneously
6 Route music (a2dp streaming) from Module to HP1 only
7 Route music (a2dp streaming) from Module to HP2 only

Description

Some route mode require specify firmware version,
BT936D only supports call switch by sending AUDROUTE=2,3
refer to application note for more description: Source mode connection

AT+FOCUS - Select connected audio devices

Command

AT+FOCUS{=Param1{,Param2}}

Param1

(12 Bytes ASCII)MAC address of target device/headphone 1

Param2

(12 Bytes ASCII)MAC address of target device/headphone 2

Decription

BT936B/BT906/BT936D supports linking two earphones, BT930 only supports linking one earphone

Example: Connect headphone 1
<< AT+FOCUS=7C9A1DA36B41
>> OK
Example: Clear link addresses and pairing records
<< AT+FOCUS=0
>> OK

HFP Commands

AT+HFPSTAT - Read HFP State

Command

AT+HFPSTAT

Response

+HFPSTAT=Param1{,Param2{,Param3}}

Description

Format description reference: +HFPSTAT - HFP State

AT+HFPCONN - Establish HFP Connection

Command

AT+HFPCONN{=Param}

Param

MAC address of target device (12 Bytes ASCII)

Description

Reconnect to last HFP device if parameter not exist

Example:Connect to last HFP device
<< AT+HFPCONN
>> OK
Example:Connect to specific HFP device with MAC address
<< AT+HFPCONN=1C5CF226D773
>> OK

AT+HFPDISC - Release HFP Connection

Command

AT+HFPDISC

Description

Release current HFP connection with remote device

AT+HFPDIAL - Dial/Redial Phone Number

Command

AT+HFPDIAL{=Param}

Param

Phone number (1~25 Bytes ASCII)

Description

Dial specific number if parameter exist, otherwise redial

Example:Redial
<< AT+HFPDIAL
>> OK
Example:Dial number “075527924639”
<< AT+HFPDIAL=075527924639
>> OK

AT+HFPDTMF - Send DTMF code

Command

AT+HFPDTMF{=Param}

Param

DTMF (0~9/#/*)

Example:Send DTMF code “#” while talking
<< AT+HFPDTMF=#
>> OK

AT+HFPANSW - Pick Up Incoming Call

Command

AT+HFPANSW

Description

Pick up an incoming call

AT+HFPCHUP - Reject/Hung up Call

Command

AT+HFPCHUP

Description

Reject incoming call or hung up outgoing/active call

AT+HFPADTS - Transfer Voice Audio Between Local and Remote Device

Command

AT+HFPADTS=Param

Param

1: Transfer voice audio from module to remote device
2: Transfer voice audio from remote device to module

Description

Transfer voice audio between module and remote device by default if no parameter set

AT+HFPVR - Start/Stop Voice Recognition of Remote Device

Command

AT+HFPVR=Param

Param

0-Stop 1-Start

Description

Start/Stop Voice Recognition of Remote Device (such as Siri for iOS devices)

AT+HFPINFO - Read HFP information

Command

AT+HFPINFO

Description

Return the current HFP status, signal strength, battery, device name, etc.

AT+MICMUTE - Mute Mic

Command

AT+MICMUTE=Param

Param

0-unmute 1-mute

Description

mute mic when call active

A2DP/AVRCP Commands

AT+A2DPSTAT - Read A2DP State

Command

AT+A2DPSTAT

Response

+A2DPSTAT=Param

Description

Format description reference: +A2DPSTAT - A2DP State

AT+A2DPCONN - Establish A2DP Connection

Command

AT+A2DPCONN{=Param}

Param

MAC address of target device (12 Bytes ASCII)

Description

Reconnect to last A2DP device if parameter not exist

AT+A2DPDISC - Release A2DP Connection

Command

AT+A2DPDISC

Description

Release current A2DP connection with remote device

AT+A2DPINFO - Read A2DP information

Command

AT+A2DPINFO

Description

Return the current A2DP status, remote device name , etc.

AT+AVRCPSTAT - Read AVRCP State

Command

AT+AVRCPSTAT

Response

+AVRCPSTAT=Param

Description

Format description reference: +AVRCPSTAT - AVRCP State

AT+AVRCPCFG - Get/Set AVRCP Configuration

Command

AT+AVRCPCFG{=Param}

Param

A base-10 representation of a bit field, default:3, for each bit:

BIT[0]

Auto get track ID3 information (title, artist, album) on track changed.default:1

BIT[1-3]

Auto get track play progress if value > 0. default:1 second

BIT[4]

Browsing function enable/disable

BIT[5]

Auto pull media cover art image to specify folder

Example: Read AVRCP configuration
<< AT+AVRCPCFG
>> +AVRCPCFG=1
OK
Example: Get track play progress every 5 second
<< AT+AVRCPCFG=9
>> OK

AT+PLAYPAUSE - Track Play/Pause

Command

AT+PLAYPAUSE

Description

Send play or pause command to remote media player according to current play status

AT+PLAY - Track Play

Command

AT+PLAY

Description

Send play command to remote media player

AT+PAUSE - Track Pause

Command

AT+PAUSE

Description

Send pause command to remote media player

AT+STOP - Track Stop

Command

AT+STOP

Description

Send stop command to remote media player

AT+FORWARD - Track Forward

Command

AT+FORWARD

Description

Send forward command to remote media player

AT+BACKWARD - Track Backward

Command

AT+BACKWARD

Description

Send backward command to remote media player

PBAP Commands

AT+PBSTAT - Read PBAP state

Command

AT+PBSTAT

Response

+PBATAT=Param

Description

Format description reference: +PBSTAT - PBAP status

AT+PBCONN - Establish PBAP Connection

Command

AT+PBCONN{=Param}

Param

MAC address of target device (12 Bytes ASCII)

Description

Module will use current HFP device’ MAC address if parameter not exist
For some firmware release, module will establish PBAP connection
automatically on received command AT+PBDOWN

AT+PBDISC - Release PBAP Connection

Command

AT+PBDISC

Description

Release current PBAP connection with remote device

AT+PBDOWN - Download Phonebook

Command

Param1{, Param2{, Param3{, Param4}}}

Param1

Phonebook type(0-5)
(0) Phonebook (SIM Storage)
(1) Phonebook (Phone Storage)
(2) Received call log
(3) Dialed call log
(4) Missed call log
(5) All call log

Param2

Max items (1~65535, default:3000 for phonebook; 50 for call log)

Param3

Phonebook format (defaut:0)
(0) Family Name, Middle Name, Given Name
(1) Given Name, Middle Name, Family Name
(2) Raw vCard 2.1

Param4

Contact photo required (0/1)

Description

For some phones (e.g. iPhone), the contact download permission
must be turned on in phone’s Bluetooth settting
refer to application note for more description: Phonebook downloading

AT+PBABORT - Abort Downloading

Command

AT+PBABORT

Description

Abort downloading

SPP Commands

AT+SPPSTAT - Read SPP State

Command

AT+SPPSTAT

Param

+SPPATAT=Param

Description

Format description reference: +SPPSTAT - SPP State

AT+SPPCONN - Establish SPP Connection

Command

AT+SPPCONN{=Param}

Param

MAC address of target device (12 Bytes ASCII)

AT+SPPDISC - Release SPP Connection

Command

AT+SPPDISC

Description

Release current SPP connection with remote device

AT+SPPSEND - Send Data Via SPP

Command

AT+SPPSEND=Param1,Param2

Param1

Payload length (1~492)

Param2

Payload (1~492 Bytes 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

GATT Commands

AT+GATTSTAT - Read GATT State

Command

AT+GATTSTAT

Response

+GATTATAT=Param

Description

Format description reference: +GATTSTAT - GATT State

AT+GATTDISC - Release GATT Connection

Command

AT+GATTDISC

Description

Release current GATT connection with remote device

AT+GATTSEND - Send Data Via GATT

Command

AT+GATTSEND=Param1,Param2

Param1

Payload length (1~492)

Param2

Payload (1~492 Bytes UTF8)

Description

If throughput mode is on, this command is de-active

Example: Send data “1234567890” to remote device via GATT
<< AT+SPPSEND=10,1234567890
>> OK

Event Table

General Events

+PWRSTAT - Powering State

Format1

+PWRSTAT=Param

Param

0-Powering off 1-Powering on(booting)

Description

AT Command is not recommended to be used while powering on/off state

+SCAN - Scan Result

Format1

+SCAN=Param1,Param2,Param3,Param4,Param5,Param6

Param1

Index

Param2

RSSI (-127 ~ -1)

Param3

Device address type (0~3)
(0) BR/EDR address
(1) LE public address
(2) LE random address
(3) iOS device with Carplay support

Param4

MAC address (12 Bytes ASCII)

Param5

Device Name for BR/EDR devices or advertising data for LE devices

Param6

Class of device(6 Bytes ASCII)

Format2

+SCAN=E: Scan stopped

Example: Scan BR/EDR nearby devices
<< AT+SCAN=1
>> OK
>> +SCAN=1,-32,3,B019C66209FA,wt-iphone,7A020C
>> +SCAN=2,-74,0,DC0D30000053,BW226,040680
>> +SCAN=3,-43,0,00158354F994,LAPTOP-3L,120104
>> +SCAN=E

+ADV - Tire pressure scanning results

Format1

+ADV=Param

Param

The first 12 bytes are the tire pressure address, and the following data are tire pressure data

Example: Scan tire pressure device named TPMS for a duration of 1 minute
<< AT+SCAN=2,60,TPMS,1
>> OK +DEVSTAT=23
+ADV=EF89ED86324E685A00010000010101061D49990000

+PAIRREQ - Pair Request

Format

+PAIRREQ=Param1,Param2{,Param3}

Param1

Passkey (000000~999999)

Param2

MAC address (12 Bytes ASCII) of current pairing device

Param3

Name of current pairing device

+PAIRED - Pair Result

Format

+PAIRED=Param1,Param2

Param

Pair result (0)-Success (1~255)-Failed reason

Param2

MAC address (12 Bytes ASCII) of current pairing device

+SPKVOL - Output volume level

Format1

+SPKVOL=Param1,Param2

Param1

A2DP’s volume level

Param2

HFP’s volume level

HFP Events

+HFPSTAT - HFP State

Format

+HFPSTAT=Param1{,Param2{,Param3}}

Param1

(0~10) The HFP status which connected with phone bluetooth
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Outgoing call
(5) Incoming call
(6) Active call

Param2

The status is the same as above, the status of the first Bluetooth earphone HFP

Param3

The status is the same as above, the status of the second Bluetooth earphone HFP

Example: Dial number 10086
<< AT+HFPDIAL=10086
>> +HFPSTAT=4,1,1
>> +HFPAUDIO=1,0,0
>> +HFPCID=10086
>> +HFPCIE=10086
Example: Incoming call with number 13265463800
>> +HFPSTAT=5,1,1
>> +HFPCID=13265463800
>> +HFPCIE=tony
>> +HFPAUDIO=1,0,0

+HFPCID - Incoming/Outgoing call number

Format

+HFPCID=Param

Param

(1~25 Bytes ASCII), call number

+HFPCIE - Incoming/Outgoing call number remark

Format

+HFPCID=Param

Param

(UTF8), call number remark

+HFPDEV - HFP Remote Device Information

Format

+HFPDEV=Param1{,Param2}

Param1

12 Bytes ASCII), Remote MAC address of current HFP connection

Param2

(UTF8), Remote device name of current HFP connection

Note

When indicating - HFPDEV, it represents the information of the first headphone,
when indicating ~ HFPDEV, it represents the information of the second headphone

Example: HFP connect with device successfully >> +HFPDEV=1C5CF226D774,iPhone

+HFPAUDIO - HFP Voice Audio State

Format

+HFPAUDIO=Param1,Param2,Param3

Param

HFP audio status which connected with phone bluetooth
(0) HFP voice audio disconnected, audio input/output routed to remote device
(1) HFP voice audio connected, audio input/output routed to module

Param2

The status is the same as above, the audio status of the first Bluetooth earphone HFP

Param3

The status is the same as above, the audio status of the second Bluetooth earphone HFP

+HFPSIG - HFP Remote Device Network Signal Strength

Format

+HFPSIG=Param

Param

(0~5)Network signal strength of remote device

+HFPBATT - HFP Remote Device Battery Level

Format

+HFPBATT=Param1,Param2,Param3

Param1

(-1~5) Remote device battery level, mobile phone battery level

Param2

(-1~5) Remote device battery level, the first headphone battery level

Param3

(-1~5) Remote device battery level, the second headphone battery level

Note

-1 indicates that the battery level is not be obtained

+HFPNET - HFP Remote Device Network Operator Selection

Format

+HFPNET=Param

Param

(UTF8)Network operator selection of remote device

+HFPMANU - HFP Remote Device Manufacture

Format

+HFPMANU=Param

Param

(UTF8)Manufacture name of remote device

+HFPNUM - HFP Remote Device Phone Subscriber Number

Format

+HFPNUM=Param

Param

(ASCII)Phone subscriber number of remote device

+HFPIBR - HFP Remote Device In-band-ring Support

Format

+HFPIBR=Param

Param

(0/1) In-band-ring support

Description

Report whether the current connected phone support in-band-ring

+HFPRING - HFP Remote Device Ringing

Format

+HFPRING=Param

Param

(0/1) In-band-ring off/on

Descreption

Phone is ringing when call incoming, the host platform should play a local ringtone
if in-band-ring not supported by remote mobile phone

+HFPVR - Wake up HFP remote voice device

Format

+HFPVR=Param

Param

0-Stop wake-up voice 1-wake up voice

Description

This event is used to indicate the wake-up of remote voice devices, such as Siri

A2DP/AVRCP Events

+A2DPSTAT - A2DP State

Format

+HFPMANU=Param

Param1

The A2DP status of connecting with phone bluetooth
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Paused
(5) Streaming

Param2

The status is the same as above, the A2DP status of the first Bluetooth earphone

Param3

The status is the same as above, the A2DP status of the second Bluetooth earphone

+A2DPDEV - A2DP Remote Device Information

Format

+A2DPDEV=Param1{,Param2}

Param1

(12 Bytes ASCII), Remote device’s MAC address of current A2DP connection

Param2

(UTF8), Remote device’s name of current A2DP connection

Note

When indicating - A2DPDEV, it represents the information of the first headphone,
when indicating ~ A2DPDEV, it represents the information of the second headphone

+AVRCPSTAT - AVRCP State

Format

+AVRCPSTAT=Param1,Param2,Param3

Param1

The AVRCP status of connecting with phone bluetooth
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected

Param2

The status is the same as above, the AVRCP status of the first Bluetooth earphone

Param3

The status is the same as above, the AVRCP status of the second Bluetooth earphone,only one AVRCP connection with headphones is supported currently

+PLAYSTAT - Media Player State

Format

+PLAYSTAT=Param

Param

(0) Stopped
(1) Playing
(2) Paused
(3) Fast Forwarding
(4) Fast Rewinding

+TRACKSTAT - Media Player Play Progress

Format

+TRACKSTAT=Param1,Param2,Param3

Param1

(0~4), Media Player State, see +PLAYSTAT

Param2

(Decimal ASCII),Elapsed time of current track in second

Param3

(Decimal ASCII),Total time of current track in second

+TRACKINFO - Media Track Information

Format

+TRACKINFO=Param1,Param2,Param3

Param1

title

Param2

artist

Param3

album

Example: Phone playing song “Creep-Radio Head”
>> +TRACKINFO=Creep , Radiohead , Pablo Honey

+CTPAUSE - Pause

Description

Remote device sends pause command

+CTPLAY - Play

Description

Remote device(bluetooth headphone) sends play command

+CTSTOP - Stop

Description

Remote device(bluetooth headphone) sends stop command

+CTBACK - Return to previous track

Description

Remote device (Bluetooth headset) sends command to return to previous track

+CTFWD - Play next trak

Description

Remote device (Bluetooth headset) sends command to play next track

PBAP Events

+PBSTAT - PBAP status

Format

+PBSTAT=Param

Param

(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Downloading

+PBCNT - Phonebook Entries of Remote Device

Format

+PBCNT=Param

Param

Phonebook entries of remote device

+PBDATA - Phonebook data

Format1

+PBDATA=Param1,Param2,Param3{,Param4}

Param1

Type
(0) Phonebook (SIM Storage)
(1) Phonebook (Phone Storage)
(2) Received call log
(3) Dialed call log
(4) Missed call logg

Param2

Call number remark

Param3

Call number

Param4

+PBCNT - Phonebook Entries of Remote Device
Format:
Year(4Bytes) Month(2Bytes) Day(2Bytes) T(1Byte) Hour(2Bytes)
Minute(2Bytes) Second(2Bytes). e.g. 20161012T152826 represents
2016/10/12/15/28/26

Format2

+PBDATA=E: Download complete

Descreption

Call time may not exist for some mobile phones

Example: Download all phonebook
<< AT+PBDOWN=1
>> +PBCNT=234
+PBDATA=1 , Jack , 18219146201
+PBDATA=1 , kenan , 8613771972680
……
+PBDATA=E
Example: Download 10 dialed call log
<< AT+PBDOWN=3,10
>> +PBDATA=3 , China Mobile , 10086 , 20171013T103516
+PBDATA=3 , Jerry , 18688967507 , 20171012T152826
……
+PBDATA=E

SPP Events

Note

Events for iAP2 (Apple Accessory Protocol) and AAP (Android Auto Protocol) are almost the same with SPP, which are:

  • +IAPSTAT, +IAPDATA for iAP2 profile

  • +AAPSTAT, +AAPDATA for AAP profile

Document will omit these events.

+SPPSTAT - SPP State

Format

+SPPSTAT=Param

Param

(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected

+SPPDATA - SPP Received Incoming Data

Format

+SPPDATA=Param1,Param2

Param1

Payload length

Param2

Payload

Example: Received data “1234567890” from remote device via SPP
<< +SPPDATA=10,1234567890

GATT Events

+GATTSTAT - GATT State

Format

+GATTSTAT=Param

Param

(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected

+GATTDATA - GATT Received Incoming Data

Format

+SPPDATA=Param1,Param2

Param1

Payload length

Param2

Payload

Example: Received data “1234567890” from remote device via GATT
<< +GATTDATA=10,1234567890

Application scenarios

profiles initializing and change parameter

The following figure shows Profile initialization and name modification

@startuml
hide footbox
skinparam sequenceMessageAlign center

box  #LightBlue
participant Host as host
participant Blueware as bt
end box

rnote over host, bt: Profile initialization

bt -> host: +DEVSTAT=0
bt -> host: +PWRSTAT=1
bt -> host: +VER=BT930,V3.6.0,20220922
bt -> host: +PROFILE=1195
bt -> host: +SPPSTAT=1
bt -> host: +GATTSTAT=1
bt -> host: +A2DPSTAT=1
bt -> host: +AVRCPSTAT=1
bt -> host: +HFPSTAT=1
bt -> host: +PBSTAT=1
bt -> host: +DEVSTAT=1
bt -> host: +DEVSTAT=7(auto discoverable,phone can find and connect to us)

rnote over host, bt: change name to "CARKIT",disable suffix. and verify readback
host -> bt: AT+NAME
bt -> host: +NAME=FSC-BT930-1E49
host -> bt: AT+NAME=CARKIT,0
bt -> host: OK
host -> bt: AT+NAME
bt -> host: +NAME=CARKIT

@enduml

MCU change device name CARKIT reference code:

 1void change_name(void)
 2{
 3    uart_send("AT+NAME\r\n");
 4    if(uart_read("+NAME",name_buf))
 5    {
 6        if(memcmp(name_buf,"CARKIT",6))
 7        {
 8            uart_send("AT+NAME=CARKIT,0\r\n");      //defalut disable MAC address suffix
 9            uart_send("AT+NAME\r\n"); // read bt name
10            if(uart_read("+NAME",name_buf))
11            {
12                if(memcmp(name_buf,"CARKIT",6))
13                {
14                    //change name fail
15                }
16                else
17                {
18                    //change name success
19                }
20            }
21        }
22    }
23}

Sink mode connection

Note

BT930、BT936D module supoort sink mode

@startuml
hide footbox
skinparam sequenceMessageAlign center

box  #LightBlue
participant Host as host
participant Blueware as bt
end box

rnote over host, bt: Profile initialization

bt -> host: +PWRSTAT=1
bt -> host: ...
bt -> host: +DEVSTAT=7

rnote over host, bt: Mobile phone search and connect to us
bt -> host: +A2DPSTAT=3,1,1 (A2DP connected)
bt -> host: +A2DPDEV=8C861E94A09E,Navy
bt -> host: +AVRCPSTAT=3,1,1 (AVRCP connected)
bt -> host: +ABSVOL=1 (Mobile phone supports absolute volume)
bt -> host: +HFPSTAT=3,1,1 (HFP connected)
bt -> host: +HFPDEV=8C861E94A09E,Navy
bt -> host: +HFPSIG=3
bt -> host: +HFPBATT=4,-1,-1
bt -> host: +HFPROAM=0
bt -> host: +HFPNUM=8618620277271
bt -> host: +HFPMANU=AppleInc.

host -> bt: +HFPDIAL=10086 (dial number "10086")
bt -> host: OK
bt -> host: +HFPSTAT=4,1,1
bt -> host: +HFPAUDIO=1,0,0 (audio established)
bt -> host: +HFPCID=10086
bt -> host: +HFPCIE=10086
bt -> host: +HFPSTAT=6,1,1 (call active)
host -> bt: AT+HFPCHUP(hung up)
bt -> host: +HFPSTAT=3,1,1
bt -> host: +HFPAUDIO=0,0,0 (audio release)

host -> bt: AT+PLAY(start media player)
bt -> host: +A2DPSTAT=5,1,1
bt -> host: +PLAYSTAT=1
bt -> host: +TRACKINFO=song,artist,album
bt -> host: +TRACKSTAT=1,1,240
bt -> host: +TRACKSTAT=1,2,240
host -> bt: AT+PAUSE(pause media player)
bt -> host: +PLAYSTAT=2
bt -> host: +A2DPSTAT=4,1,1

@enduml

Source mode connection

@startuml
hide footbox
skinparam sequenceMessageAlign center

box  #LightBlue
participant Host as host
participant Blueware as bt
end box

rnote over host, bt: scan nearby headset

host -> bt: AT+SCAN=1
bt -> host: +SCAN=1,-56,0,FF733EEF25E9,N-612,240408
bt -> host: +SCAN=2,-78,0,7C9A1DA36B41,AirPods,240404
bt -> host: +SCAN=E

rnote over host, bt: (add 2 device to foucu list)
host -> bt: AT+FOCUS=FF733EEF25E9,7C9A1DA36B41
bt -> host: +A2DPSTAT=3,3,1 (devA a2dp connected)
bt -> host: +A2DPSTAT=3,3,3 (devB a2dp connected)
bt -> host: +HFPSTAT=3,3,1 (devA hfp connected)
bt -> host: +HFPSTAT=3,3,3 (devB hfp connected)

bt -> host: +HFPSTAT=3,1,1 (HFP connected)
bt -> host: +HFPSIG=3
bt -> host: +HFPBATT=4,-1,-1
bt -> host: +HFPROAM=0
bt -> host: +HFPNUM=8618620277271
bt -> host: +HFPMANU=AppleInc.
host -> bt: AT+PLAY (send music play command to phone)

bt -> host: +A2DPSTAT=5,4,4 (a2dp streaming)
bt -> host: +A2DPSTAT=5,5,4 (devA a2dp streaming)
bt -> host: +A2DPSTAT=5,5,5 (devB a2dp streaming)
host -> bt: AT+PAUSE(send music pause command to phone)

bt -> host: +A2DPSTAT=4,5,5 (a2dp pause)
bt -> host: +A2DPSTAT=4,4,5 (devA a2dp pause)
bt -> host: +A2DPSTAT=4,4,4 (devB a2dp pause)

host -> bt: AT+HFPDIAL=10086
host -> bt: AT+AUDROUTE=2 (establish devA hfp audio)
bt -> host: +HFPSTAT=4,3,3
bt -> host: +HFPAUDIO=1,0,0 (voice connected,phone)
bt -> host: +HFPAUDIO=1,1,0 (voice connected,devA)
bt -> host: +HFPCID=10086
bt -> host: +HFPCIE=10086
bt -> host: +HFPSTAT=6,6,3
host -> bt: AT+AUDROUTE=3 (establish devB hfp audio)
bt -> host: +HFPAUDIO=1,0,1 (voice connected,devA)
bt -> host: +HFPSTAT=6,3,6
host -> bt: AT+HFPCHUP
bt -> host: +HFPSTAT=3,3,3
bt -> host: +HFPAUDIO=0,0,0(voice disconnected)


@enduml

Phonebook downloading

Note

When some firmware does not support downloading, it will automatically connect to PBAP, and you need to send AT+PBCONN to connect to PBAP before downloading

@startuml
hide footbox
skinparam sequenceMessageAlign center

box  #LightBlue
participant Host as host
participant Blueware as bt
end box

rnote over host, bt: HFP connected

bt -> host: ...
bt -> host: +HFPSTAT=3

rnote over host, bt: download all phonebook
host -> bt: AT+PBDOWN=1
bt -> host: +PBSTAT=2
bt -> host: +PBSTAT=3 (PBAP connected)
bt -> host: +PBSTAT=4 (PBAP downloading)
bt -> host: +PBDATA=1,Local phone number,+8618620277272
bt -> host: +PBDATA=1,Jack,0571-85592192
bt -> host: ...
bt -> host: +PBDATA=1,jerry,18909731215
bt -> host: +PBDATA=E (Download competed)
bt -> host: +PBSTAT=3

rnote over host, bt: download 50 contacts in recent call history
host -> bt: AT+PBWODN=5,50
bt -> host: +PBDATA=3,yidong,+10086,20200213T114247
bt -> host: ...
bt -> host: +PBDATA=2,andy,85592192,20200212T104202
bt -> host: +PBDATA=E
bt -> host: +PBSTAT=3

@enduml

Appendix

Note

If you need to upgrade to the latest version, please refer to Upgrade Over-the-Air.

Download PDF Document

Download PDF Document