FSC-BT631D 指令手册
介绍
描述
本设计指南适用于工程师开发 FSC-BT631D 蓝牙模组
模组默认参数
Name |
FSC-BT631D-XXXX |
LE-Name |
FSC-BT631D-LE-XXXX |
Pin Code |
0000 |
Secure Simple Pairing Mode |
On |
UART Baudrate |
115200/8/N/1 |
硬件说明
引脚图

引脚描述
Pin |
Pin Name |
Type |
Pin Descriptions |
---|---|---|---|
14 |
I2S_OUT |
O |
I2S DATA OUT |
15 |
I2S_CLK |
I/O |
I2S BCLK |
16 |
I2S_IN |
I |
I2S DATA IN |
17 |
I2S_WS |
I/O |
I2S SYNC |
18 |
I2S_MCLK |
I/O |
I2S MCLK |
21 |
LED0 |
I/O |
LED0 |
22 |
LED1 |
I/O |
LED1 |
23 |
RESET |
I |
低电平复位 |
24 |
VBUS |
VDD |
5V |
25 |
GND |
GND |
GND |
26 |
USB_DP |
USB_DP |
USB_DP |
27 |
USB_DN |
USB_DN |
USB_DN |
30 |
UART_RTS |
I/O |
串口流控脚(默认为PA脚) |
31 |
UART_TX |
O |
串口TX |
32 |
UART_RX |
I |
串口RX |
33 |
UART_CTS |
I/O |
串口流控脚(默认不需要接) |
35 |
EXT_ANT |
ANT |
改变天线附近的0欧电阻,可以外接蓝牙天线 |
硬件设计说明
模组简易测试只需要连接VDD/VDD_IO/VREG_IN/GND/UART_RX/UART_TX即可使用
画完原理图后请发给飞易通进行审核,避免蓝牙距离达不到最佳效果
功能说明
BT631D是一款同时支持经典蓝牙和LE Audio的模块,目前LE Audio已支持BIS和CIS功能,后续会开发更多的其他功能。 作为BIS/CIS的发射端,音频来源可以是手机的A2DP,I2S输入(对于开发板来说是模拟输入,目前只支持外部编解码器TLV320AIC3204),或者USB。 如果需要测试CIS对讲功能,音频源不能设置为A2DP。
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)
BIS (Broadcast Isochronous Stream)
CIS (Connected Isochronous Stream)
GATT透传服务
类型 |
UUID |
权限 |
描述 |
Service |
0xFFF0 |
透传服务 |
|
Write |
0xFFF2 |
Write,Write Without Response |
APP发给模组 |
Notify |
0xFFF1 |
Notify |
模组发给APP |
指令说明
规范说明
适用于整个文档
{} : 包括与{…}中的内容为可选项
<< : 主机发给模组的 COMMAND
>> : 模组回复主机的 RESPONSE/EVENT
指令格式
所有的指令使用 AT 开头,使用 <CR><LF> 结尾
<CR> 代表回车符,对应 HEX 为 0x0D
<LF> 代表换行符,对应 HEX 为 0x0A
若指令包含参数,参数应使用 = 分隔
若指令包含多项参数,参数应使用 , 分隔
若指令有响应返回,响应使用 <CR><LF> 开始,使用 <CR><LF> 结束
模组应当总是返回指令执行的结果 (成功返回 OK,失败时返回 ERR<code>)
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 |
Event格式
所有的事件使用<CR><LF>开始, 使用<CR><LF>结束
若事件包含参数, 参数应位于 “=” 后面
若事件包含多项参数, 参数应使用 “,” 分割
使用命令AT+SEP替换默认分隔符以防止冲突
指令表
通用指令
AT+HELP - 查询固件功能和命令说明
Command |
AT+HELP |
Response |
<FIRMWARE FUNCTION: appropriate working scenario >
<OTA PATH: latest suitable firmware path on server for upgrade On-The-Air>
<ENABLED PROFILES: LINKS: ON/OFF>
…
…
<COMMAND SUMMARY: DESCRIPTION: PROFILE CATEGORY>
|
Description |
使用help命令获取基本摘要信息 |
Note
如需升级最新版本请参考 空中升级说明
AT+SEP - 读/写Event分隔符
Command |
AT+SEP{=Param} |
|
设置范围0x01~0xFF,默认: ‘,’ , 其中‘0’表示0xFF |
Response |
返回当前分隔符 |
Description |
events/responses的参数可能包含与默认分隔符相同的值,
使用此命令替换默认分隔符以防止冲突。
(通常将默认分隔符“,”替换为十六进制值“xFF”)
|
AT+VER - 读取固件版本
Command |
AT+VER |
Response |
+VER=Param1,Param2,Param3 |
|
模块类型 |
|
固件版本 |
|
生产日期 |
Note |
升级固件后,生产日期不会变化 |
AT+BAUD - 读/写串口波特率
Command |
AT+BAUD{=Param} |
|
2400/4800/9600/19200/38400/57600/115200(default)/128000/
230400/256000/460800/512000/921600/1382400
|
Response |
+BAUD=Param1,Param2,Param3 |
|
返回当前所有支持的波特率 |
Description |
模块将在接收到这条指令后,马上切换波特率.BT631D、BT955不支持2400 |
AT+I2CREG - 读/写I2C寄存器
Command |
AT+I2CREG=Param1, Param2, Param3 {,Param4} |
|
i2c bus address, 2 byes hex string |
|
i2c register address, 2/4 byes hex string |
|
bytes to read/write (1~64) |
|
value to write |
Response |
+I2CREG=Param |
|
返回当前I2C读取的值 |
Note |
BT631D当前版本不完全支持此指令,请勿使用。为后续版本预留。
|
AT+I2SCFG - 设置I2S格式
Command |
AT+I2SCFG{=Param} |
|
以10进制位字段表示,每位表示 |
|
0:disable; 1:enable |
|
0:master; 1:slave |
|
0:FS=48000Hz;1:FS=44100Hz |
|
00: I2S standard format
10: PCM short frame format
|
|
00: bit depth=16bits
10: bit depth=32bits (only 16bits of MSB effective)
11: bit depth=32bits (only used for PCM mode)
|
Response |
+I2SCFG=Param |
Note |
BT631D当前版本不完全支持此指令,请勿使用。为后续版本预留。 |
Example:常用组合配置如下:
0 |
模拟模式,模块将在启动时通过I2C检测内部/外部编解码器,并上报+CODEC=id |
1 |
I2S Master; Sample rate=48000Hz; Resolution=16bits; Bit clock= 48000*16*2ch=1.536Mhz |
3 |
I2S Slave; Sample rate=48000Hz; Resolution=16bits; Bit clock= 48000*16*2ch=1.536Mhz |
65 |
I2S Master; Sample rate=48000Hz; Resolution=32bits; Bit clock= 48000*32*2ch=3.072Mhz |
67 |
I2S Slave; Sample rate=48000Hz; Resolution=32bits; Bit clock= 48000*32*2ch=3.072Mhz |
113 |
PCM Master; Sample rate=48000Hz; Resolution=16bits; Bit clock= 48000*16*2ch=1.536Mhz |
AT+MICGAIN - 设置麦克风音量
Command |
AT+MICGAIN{=Param1,Param2} |
|
音乐的增益 (0~15, default:8) |
|
通话的增益 (0~15, default:8) |
Description |
调整Codec模拟输入音量 |
AT+SPKVOL - 设置扬声器音量
Command |
AT+SPKVOL{=Param1,Param2} |
|
A2DP的音量 (0~15, default:10) |
|
HFP的音量 (0~15, default:10) |
Description |
调整Codec模拟输出音量 |
AT+REBOOT - 软件复位
Command |
AT+REBOOT |
Response |
OK |
Description |
模块将复位 |
AT+RESTORE - 恢复出厂设置
Command |
AT+RESTORE |
Response |
OK |
Description |
模块将恢复为出厂设置 |
AT+BTEN - 开关蓝牙
Command |
AT+BTEN{=Param} |
|
0-关闭蓝牙 1-打开蓝牙 |
AT+PROFILE - 蓝牙Profile配置
Command |
AT+PROFILE{=Param} |
|
以10进制位字段表示,每位表示 |
|
SPP (Serial Port Profile) |
|
GATT Server (Generic Attribute Profile) |
|
GATT Client (Generic Attribute Profile) |
|
HFP-HF (Hands-Free Profile Handsfree) |
|
HFP-AG (Hands-Free Profile Audio Gateway) |
|
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 Keyboard (Human Interface Profile) |
|
PBAP Server (Phonebook Access Profile) |
|
BIS Gateway |
|
BIS Headset |
|
*** (For iOS devices) |
|
CIS Cilent |
|
CIS Server |
Response |
+PROFILE=Param |
Description |
无法同时启用GATT Server and Client, HFP Sink and Source,
A2DP Sink and Source,AVRCP Controller and Target.BIS Gateway ,BIS Headset,
CIS Client,CIS Server这4个只能单独启用。默认的Profile:9385,即可被手机通过A2DP连接,同时将音频通过BIS
再广播出去。
|
AT+AUTOCONN - 设置蓝牙上电重连Profile
Command |
AT+AUTOCONN{=Param} |
|
以10进制位字段表示, 格式参考:AT+PROFILE |
Response |
+AUTOCONN=Param |
Description |
上电后,模块将根据设置PROFILE尝试与配对列表中的设备建立连接 |
AT+STAT - 读所有Profile状态
Command |
AT+STAT |
Response |
+STAT=Param1, Param2, Param3… |
Description |
查询所有使能Profile的当前状态 |

AT+DEVSTAT - 读设备状态
Command |
AT+DEVSTAT |
Response |
+DEVSTAT=Param |
|
以10进制位字段表示, |
|
0: Power Off; 1: Power On |
|
0: BR/EDR Not Discoverable; 1: BR/EDR Discoverable |
|
0: BLE Not Advertising; 1: BLE Advertising |
|
0: BR/EDR Not Scanning; 1: BR/EDR Scanning |
|
0: BLE Not Scanning; 1: BLE Scanning |
|
预留 |
|
0: BIS Not Scanning; 1: BIS Scanning |
|
0: CIS Not Scanning; 1: CIS Scanning |
Example:常用组合和描述
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 - 读BR/EDR蓝牙MAC地址
Command |
AT+ADDR |
Response |
+ADDR=Param |
|
模块的BR/EDR蓝牙MAC地址(12 Bytes ASCII) |
AT+LEADDR - 读BLE蓝牙MAC地址
Command |
AT+LEADDR |
Response |
+LEADDR=Param |
|
模块的BLE蓝牙MAC地址(12 Bytes ASCII) |
AT+NAME - 读/写BR/EDR蓝牙名称
Command |
AT+NAME{=Param1{,Param2}} |
|
BR/EDR蓝牙名称(1~31 Bytes ASCII) |
|
使能MAC地址后缀(0/1,default:1)
0: 关闭后缀
1: 开启后缀“-XXXX”(MAC地址后4Byte)
|
Response |
+NAME=Param |
|
蓝牙名称 |
Description |
如果存在参数则设置蓝牙名称,否则只是读取 |
AT+LENAME - 读/写BLE蓝牙名称
Command |
AT+LENAME{=Param1{,Param2}} |
|
BLE蓝牙名称(1~25 Bytes ASCII) |
|
使能MAC地址后缀(0/1,default:1)
0: 关闭后缀
1: 开启后缀“-XXXX”(MAC地址后4Byte)
|
Response |
+LENAME=Param |
AT+BISNAME - 读/写BIS的蓝牙名称
Command |
AT+BISNAME{=Param1{,Param2}} |
|
BIS蓝牙名称(1~25 Bytes ASCII) |
|
使能MAC地址后缀(0/1,default:1)
0: 关闭后缀
1: 开启后缀“-XXXX”(MAC地址后4Byte)
|
Response |
+BISNAME=Param |
AT+CISNAME - 读/写CIS的蓝牙名称
Command |
AT+CISNAME{=Param1{,Param2}} |
|
CIS蓝牙名称(1~25 Bytes ASCII) |
|
使能MAC地址后缀(0/1,default:1)
0: 关闭后缀
1: 开启后缀“-XXXX”(MAC地址后4Byte)
|
Response |
+CISNAME=Param |
AT+SSP - 读/写BR/EDR配对模式
Command |
AT+SSP{=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 |
重启生效 |
AT+PIN - 读/写配对密码
Command |
AT+PIN{=Param} |
|
配对密码(4~15 Bytes ASCII, default:0000) |
Response |
+PIN=Param |
Description |
当+SSP=0时,配对密码有效 |
AT+CFM - 接受/拒绝远端的配对请求
Command |
AT+CFM=Param1, Param2 |
|
远端设备的MAC地址(12Bytes) |
|
0-拒绝远端的配对请求
1-接受远端的配对请求
|
Description |
当+SSP=3时,CFM命令有效 |
AT+COD: 读/写设备类型
Command |
AT+COD=Param |
|
设备类型(6 bytes ASCII, default:240408 Handsfree device) |
Response |
+COD=Param |
相关配置参考 COD.
AT+PAIR: 读/写BR/EDR/BLE可发现模式
Command |
AT+PAIR=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 |
如果未连接设备(BR/EDR或BLE),模块将始终可被发现;
如果与远程设备连接,模块将不可被发现,除非收到此命令
|
AT+PAGE: 读/写BR/EDR可连接模式
Command |
AT+PAGE=Param |
|
Mode(0-1)
0: Leave BR/EDR connectable mode (stop paging)
1: Enter BR/EDR connectable mode (start paging)
|
Description |
如果未连接设备,模块将始终处于可连接模式,
如果与远程设备连接,模块将不可连接,除非收到此命令
|
AT+SCAN - 搜索附近的设备
Command |
AT+SCAN=Param1{,Param2{,Param3}} |
|
扫描方式(0~2)
0: 停止扫描
1: 扫描附近BR/EDR设备
2: 扫描附近BLE设备(部分程序不支持)
3: 扫描附近BR/EDR/BLE设备(部分程序不支持)
4: 扫描附近BIS/CIS设备
|
|
(1~48)扫描时间. unit:1.28s, default:12.8s |
|
(1~25 Bytes ASCII)过滤名称. |
Description |
格式说明参考: +SCAN - 扫描结果 |
AT+RSSI: 读BR/EDR信号强度
Command |
AT+RSSI=Param |
|
当前连接设备的MAC地址 |
Response |
+PIN=Param |
|
RSSI value (-127 ~ 0) |
AT+PLIST - 读取/清除配对记录
Command |
AT+PLIST{=Param} |
|
(0/1~8/12 Bytes MAC address)
(0) 清除所有配对记录
(1~8) 清除指定索引的配对记录
(MAC) 清除指定地址的配对记录
|
Response1 |
+PLIST=Param1, Param2, Param3{,Param4} |
|
(1~8) 配对设备序号 |
|
以10进制位字段,设备连接的profile,参考AT+PROFILE |
|
(MAC)配对设备的MAC地址 |
|
(UTF8)配对设备的蓝牙名称 |
Response2 |
+PLIST=E 配对记录查询完成 |
AT+DSCA - 断开所有连接
Command |
AT+DSCA |
Description |
模块断开与远程设备的所有蓝牙连接 |
AT+AUDROUTE - 音频路由管理
Command |
AT+AUDROUTE{=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 |
某些路由模式需要指定固件版本,有关更多说明,请参阅应用场景: 发射模式连接 |
AT+AUXCFG - 输入模式配置
Command |
AT+AUXCFG{=Param} |
|
模式(0~2,默认2) 0: 音频由USB输入 1: 音频由I2S输入 2:音频由A2DP输入
|
Response |
+AUXCFG=Param |
Description |
只有在A2DP SINK Profile被使能,参数2才有效。切换到CIS会自动设置此值为1, 如需要USB输入输出,请再单独设置此参数 |
AT+TPMODE - 打开/关闭透传模式
Command |
AT+TPMODE{=Param} |
|
模式(0~1,默认0) 0: 指令模式 1: 透传模式 |
Response |
+TPMODE=Param |
Description |
当在SPP/GATT协议下连接并且打开透传模式时,AT指令将会被禁用,
通过UART接收的每个字节将被发送到远端
|
AT+LINKCFG - 自动搜索链接配置
Command |
AT+LINKCFG{=Param} |
|
参考AT+PROFILE指令 |
Description |
若配置该指令模块会自动根据配置的profile自动搜索链接 |
AT+TXPOWER - 发射功率配置
Command |
AT+TXPOWER{=Param} |
|
(value:0-7, 默认7) |
Description |
仅BT631D经典蓝牙部分有效 |
Value |
Power(dBm) |
---|---|
0 |
-24 |
1 |
-20 |
2 |
-16 |
3 |
-12 |
4 |
-8 |
5 |
-4 |
6 |
0 |
7 |
4 |
HFP指令
AT+HFPSTAT - 读HFP状态
Command |
AT+HFPSTAT |
Response |
+HFPSTAT=Param1{,Param2{,Param3}} |
Description |
格式说明参考: +HFPSTAT - HFP状态 |
AT+HFPSR - 读/写HFP采样率
Command |
AT+HFPSR{=Param} |
|
HFP通话时的采样率, 可配置: 0/8000/16000/48000 默认0 |
Response |
+HFPSR=Param |
Description |
该参数将覆盖AT+I2SCFG中的语音通话设置,并以该参数设置HFP I2S的采样率 |
Note |
BT631D当前版本不完全支持此指令,请勿使用。为后续版本预留。 |
AT+HFPCFG - 读/写HFP配置
Command |
AT+HFPCFG{=Param} |
|
以10进制位字段表示,default:2 |
|
0-HFP异常断开时,不回链最后断开的设备,1-HFP异常断开时,不回链最后断开的设备 |
|
0-关闭消回音功能, 1-打开消回音功能 |
|
0-关闭三方通话功能, 1-打开三方通话功能 (需固件支持三方功能) |
AT+HFPCONN - 建立HFP连接
Command |
AT+HFPCONN{=Param} |
|
目标设备MAC地址(12 Bytes ASCII) |
Description |
如果参数不存在,模块将重新连接到最后一个HFP配对过的设备 |
AT+HFPDISC - 断开HFP连接
Command |
AT+HFPDISC |
Description |
断开当前与远程设备的HFP连接 |
AT+HFPDIAL - 重拨/拨打电话号码
Command |
AT+HFPDIAL{=Param} |
|
电话号码 (1~25 Bytes ASCII) |
Description |
如果存在参数,请拨打指定号码,否则重拨 |
AT+HFPDTMF - 发送DTMF
Command |
AT+HFPDTMF{=Param} |
|
DTMF (0~9/#/*) |
AT+HFPANSW - 来电接听
Command |
AT+HFPANSW |
Description |
来电接听 |
AT+HFPCHUP - 来电去电拒接/挂断
Command |
AT+HFPCHUP |
Description |
拒绝来电或挂断去电/通话 |
AT+HFPMCAL - 三方通话控制
Command |
AT+HFPMCAL=Param |
|
0: Release held call or reject waiting call
1: Release active call and accept another call
2: Hold active call and accept another call
|
Description |
请参阅应用场景: HFP三方通话操作 |
AT+HFPADTS - 语音切换
Command |
AT+HFPADTS=Param |
|
1: 将语音音频从模块传输到远程设备
2: 将语音音频从远程设备传输到模块
|
Description |
如果参数缺省,则交替切换 |
AT+HFPVR - 开始/停止远程设备的语音识别
Command |
AT+HFPVR=Param |
|
0-停止 1-开始 |
Description |
开始/停止远程设备的语音识别(例如iOS设备的Siri) |
AT+HFPINFO - 读HFP当前的信息
Command |
AT+HFPINFO |
Description |
返回当前HFP的状态,信号强度,电池,设备名等信息 |
AT+MICMUTE - 静音麦克风
Command |
AT+MICMUTE=Param |
|
0-不静音 1-静音 |
Description |
通话时静音本地麦克风 |
A2DP/AVRCP指令
AT+A2DPSTAT - 读A2DP状态
Command |
AT+A2DPSTAT |
Response |
+A2DPSTAT=Param |
Description |
格式说明参考: +A2DPSTAT - A2DP状态 |
AT+A2DPCONN - 建立A2DP连接
Command |
AT+A2DPCONN{=Param} |
|
目标设备MAC地址(12 Bytes ASCII) |
Description |
如果参数不存在,模块将重新连接到最后一个A2DP配对过的设备 |
AT+A2DPDISC - 断开A2DP连接
Command |
AT+A2DPDISC |
Description |
断开当前与远程设备的A2DP连接 |
AT+A2DPINFO - 读A2DP当前的信息
Command |
AT+A2DPINFO |
Description |
返回当前A2DP的状态,远端设备名等信息 |
AT+A2DPSR - 设置A2DP的采样率
Command |
AT+A2DPSR=Param |
|
采样率:48000/44100 |
Description |
A2DP Source模式下设置有效 |
AT+AVRCPSTAT - 读AVRCP状态
Command |
AT+AVRCPSTAT |
Response |
+AVRCPSTAT=Param |
Description |
格式说明参考: +AVRCPSTAT - AVRCP状态 |
AT+AVRCPCFG - 读/写AVRCP配置
Command |
AT+AVRCPCFG{=Param} |
|
以10进制位字段表示,default:3,每位表示: |
|
自动获取音乐ID3信息(标题,艺术家,专辑).默认:1 |
|
如果大于0,则自动获取音乐状态(播放进度)。 默认:1(second) |
|
播放器浏览功能启用/禁用 |
|
指定文件夹自动拉取媒体封面图片 |
AT+PLAYPAUSE - 播放/暂停
Command |
AT+PLAYPAUSE |
Description |
根据当前播放状态将播放或暂停命令发送到远端媒体播放器 |
AT+PLAY - 播放
Command |
AT+PLAY |
Description |
发送播放命令到远端媒体播放器 |
AT+PAUSE - 暂停
Command |
AT+PAUSE |
Description |
发送暂停命令到远端媒体播放器 |
AT+STOP - 停止
Command |
AT+STOP |
Description |
发送停止命令到远端媒体播放器 |
AT+FORWARD - 下一曲
Command |
AT+FORWARD |
Description |
发送下一曲命令到远端媒体播放器 |
AT+BACKWARD - 上一曲
Command |
AT+BACKWARD |
Description |
发送上一曲命令到远端媒体播放器 |
AT+REPEAT - 设置媒体播放器重复模式
Command |
AT+REPEAT{=Param} |
|
Repeat mode (0/1) 0-关闭 1-打开 |
Response |
+PLAYMODE=Param1,Param2 |
|
格式说明参考: +PLAYMODE - 媒体播放器重复播放/随机播放模式 |
AT+SHUFFLE - 设置媒体播放器随机播放模式
Command |
AT+SHUFFLE{=Param} |
|
Shuffle mode (0/1) 0-关闭 1-打开 |
Response |
+PLAYMODE=Param1,Param2 |
|
格式说明参考: +PLAYMODE - 媒体播放器重复播放/随机播放模式 |
AT+GETMP - 获取远端设备的媒体播放器
Command |
AT+GETMP |
Response |
+BROWDATA=Param1,Param2,Param3,Param4 |
|
格式说明参考: +BROWDATA - 媒体播放器文件系统浏览数据 |
Description |
AT+SETMP - 选择媒体播放器
Command |
AT+SETMP=Param |
|
媒体播放器索引 |
Response |
+BROWDATA=Param1,Param2 |
|
格式说明参考: +BROWDATA - 媒体播放器文件系统浏览数据 |
Description |
选择要浏览的媒体播放器,必须设置播放器的可浏览标志,
选择播放器后我们将进入根目录,请参阅应用场景: AVRCP文件系统浏览
|
AT+GETFD - 列出选定文件夹的子文件夹/曲目
Command |
AT+GETFD=Param1,Param2 |
|
起始位置, (1~65535) |
|
结束位置, (1~65535), Param2 >= Param1 |
Description |
列出当前文件夹中的子文件夹或媒体项目。 请参阅应用场景: AVRCP文件系统浏览 |
AT+SETFD - 选择并进入文件夹
Command |
AT+SETFD=Param |
|
0:Enter up level folder other:Enter selected folder |
Description |
选择并输入要浏览的文件夹。 请参阅应用场景: AVRCP文件系统浏览 |
AT+GETNP - 在“正在播放”列表中列出曲目
Command |
AT+GETNP=Param1,Param2 |
|
(1~65535),起始位置 |
|
(1~65535),结束位置, Param2 >= Param1 |
Response |
+BROWDATA=M,Param1,Param2,Param3 |
|
格式说明参考: +BROWDATA - 媒体播放器文件系统浏览数据 |
AT+ADDMP - 将曲目添加到媒体播放器
Command |
AT+ADDMP=Param |
|
Track ID |
Description |
将选定曲目添加到媒体播放器并开始播放 |
PBAP指令
AT+PBSTAT - 读PBAP状态
Command |
AT+PBSTAT |
Response |
+PBATAT=Param |
Description |
格式说明参考: +PBSTAT - PBAP状态 |
AT+PBCONN - 建立PBAP连接
Command |
AT+PBCONN{=Param} |
|
目标设备MAC地址(12 Bytes ASCII) |
Description |
如果参数不存在,模块将使用当前HFP的地址连接.
一些固件支持,发送AT+PBDOWN时自动连接PBAP
|
AT+PBDISC - 断开PBAP连接
Command |
AT+PBDISC |
Description |
断开当前与远程设备的PBAP连接 |
AT+PBDOWN - 下载电话本
Command |
AT+PBDOWN=Param1{,Param2} |
|
电话本类型(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
|
|
下载数量 (1~65535, default:3000 for phonebook; 50 for call log) |
Description |
对于某些手机(例如iPhone),必须在手机的蓝牙设置中打开联系人下载权限
请参阅应用场景: Phonebook/Contact photo下载
|
AT+PBABORT - 取消电话本下载
Command |
AT+PBABORT |
Description |
取消电话本下载 |
BIS指令
AT+BISCONN - 连接BIS Gateway设备
Command |
AT+BISCONN{=Param} |
|
目标设备蓝牙名称 |
AT+BISSTAT - 读取当前的BIS状态
Command |
AT+BISSTAT |
Description |
格式说明参考: +BISSTAT - BIS状态 |
AT+BISAUDCH - 设置BIS Gateway广播的声道
Command |
AT+AUDIOCH{=Param} |
|
声道(0-2)
(0) 左声道(默认)
(1) 右声道
(2) 立体声
|
AT+BISSTOP - 停止BIS Gateway的音频播放
Command |
AT+BISSTOP |
AT+BISSTART - 开始BIS Gateway的音频播放
Command |
AT+BISSTART |
CIS指令
AT+CISCONN - 连接CIS Server设备
Command |
AT+CISCONN{=Param} |
|
目标设备蓝牙名称,连接左耳后自动连接右耳。注意将两个耳机的SIRK设置一致 |
AT+CISSTAT - 读取当前的CIS状态
Command |
AT+CISSTAT |
Description |
格式说明参考: +CISSTAT - CIS状态 |
AT+CISSIRK - 读取/设置CIS Service的标识码
Command |
AT+CISSIRK{=Param} |
Description |
|
AT+AUDIOCH - 设置CIS service的声道
Command |
AT+AUDIOCH{=Param} |
|
声道(0-1)
(0) 左声道(默认)
(1) 右声道
|
AT+CISTALK - 关闭/打开CIS的对讲模式
Command |
AT+CISTALK{=Param} |
|
(0) 关闭对讲
(1) 打开对讲(默认LINE IN输入)
|
SPP指令
AT+SPPSTAT - 读SPP状态
Command |
AT+SPPSTAT |
Response |
+SPPATAT=Param |
Description |
格式说明参考: +SPPSTAT - SPP状态 |
AT+SPPCONN - 建立SPP连接
Command |
AT+SPPCONN{=Param} |
|
目标设备MAC地址(12 Bytes ASCII) |
AT+SPPDISC - 断开SPP连接
Command |
AT+SPPDISC |
Description |
断开当前与远程设备的SPP连接 |
AT+SPPSEND - 通过SPP发数据
Command |
AT+SPPSEND=Param1,Param2 |
|
Payload length (1~492) |
|
Payload (1~492 Bytes UTF8) |
Description |
如果透传模式开启,该指令将会被禁用 |
GATT指令
AT+GATTSTAT - 读GATT状态
Command |
AT+GATTSTAT |
Response |
+GATTATAT=Param |
Description |
格式说明参考: +GATTSTAT - GATT状态 |
AT+GATTDISC - 断开GATT连接
Command |
AT+GATTDISC |
Description |
断开当前与远程设备的GATT连接 |
AT+GATTSEND - 通过GATT发数据
Command |
AT+GATTSEND=Param1,Param2 |
|
Payload length (1~492) |
|
Payload (1~492 Bytes UTF8) |
Description |
如果透传模式开启,该指令将会被禁用 |
HID指令
AT+HIDSTAT - 读HID状态
Command |
AT+HIDSTAT |
Response |
+HIDATAT=Param |
Description |
格式说明参考: +HIDSTAT - HID状态 |
AT+HIDCONN - 建立HID连接
Command |
AT+HIDCONN{=Param} |
|
目标设备MAC地址(12 Bytes ASCII) |
AT+HIDDISC - 断开HID连接
Command |
AT+HIDDISC |
Description |
断开当前与远程设备的HID连接 |
AT+HIDMODE - 读/写HID模式
Command |
AT+HIDMODE{=Param} |
|
HID键盘输入模式(0~1), default 1
(0) Hex key code
(1) Ascii key code (English)
|
Note |
模块可以通过特定的固件支持各种键盘语言,例如:
TURKEY SPAIN PORTUGAL FRANCE GERMANY ITALY CZECH JAPAN
|
AT+HIDDLY - 读/写HID发送时间
Command |
AT+HIDDLY{=Param} |
|
HID report period in millisecond, default 10 ms |
AT+HIDSEND - 通过HID发数据
Command |
AT+HIDSEND=Param1,Param2 |
|
Report length |
|
Report payload |
Note |
For special key code:
0x0D -> ENTER
0x08 -> BACKSPACE
0x09 -> TAB
0x20 -> SPACE
|
Description |
如果透传模式开启,该指令将会被禁用 |
AT+HIDCMD - 通过HID发命令
Command |
AT+HIDCMD=Param |
|
2 bytes hid user report
e.g., for iPhone:
Play/Pause: 00 CD
Stop: 00 B7
Forward: 00 B5
Backward: 00 B6
Fast Forward: 00 B3
Rewind:00 B4
Record:00 B2
VolumpUp:00 E9
VolumpDn:00 EA
Mute:00 E2
On screen keyboard Toggle:01 AE
|
Description |
如果透传模式开启,该指令将会被禁用 |
Events表
通用指示
+PWRSTAT - 上电状态
Format |
+PWRSTAT=Param |
|
0-Powering off 1-Powering on(booting) |
Description |
在上下电状态下,不建议使用AT命令 |
+SCAN - 扫描结果
Format1 |
+SCAN =Param1,Param2,Param3, Param4,Param5,Param6 |
|
索引 |
|
RSSI (-127 ~ -1) |
|
设备地址类型 (0~3)
(0) BR/EDR address
(1) LE public address
(2) LE random address
(5) LE Audio Gateway
|
|
MAC地址 (12 Bytes ASCII) |
|
BR/EDR设备名称或者LE设备广播数据 |
|
设备类型(6 Bytes ASCII) |
Format2 |
+SCAN=E: 停止扫描 |
+PAIRREQ - 配对请求
Format |
+PAIRREQ=Param1,Param2{,Param3} |
|
Passkey (000000~999999) |
|
当前配对设备的MAC地址(12 Bytes ASCII) |
|
当前配对设备的名称 |
+PAIRED - 配对结果
Format |
+PAIRED=Param1,Param2 |
|
配对结果 (0)-成功 (1~255)-失败原因 |
|
当前配对设备的MAC地址(12 Bytes ASCII) |
+CODEC - Codec ID
Format |
+CODEC=Param |
|
Code id
|
Description |
目前此指令无效,请忽略
|
HFP指示
+HFPSTAT - HFP状态
Format |
+HFPSTAT=Param1{,Param2{,Param3}} |
|
(0~10)
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Outgoing call
(5) Incoming call
(6) Active call
(7) Active held (3-way-calling)
(8) First call active, second call waiting (3-way-calling)
(9) First call active, second call held (3-way-calling)
(10) First call outgoing, second call held (3-way-calling)
|
|
电话号码, 当状态>3 |
|
电话号码(三方通话) |
+HFPDEV - HFP远端设备信息
Format |
+HFPDEV=Param1{,Param2} |
|
(12 Bytes ASCII), 当前HFP连接远端设备的MAC地址 |
|
(UTF8), 当前HFP连接远端设备的名称 |
+HFPAUDIO - HFP语音音频状态
Format |
+HFPAUDIO=Param |
|
(0) HFP语音音频断开连接,音频输入/输出切换到远端设备
(1) HFP语音建立连接,音频输入/输出切换到模块
|
+HFPSIG - HFP远端设备网络信号强度
Format |
+HFPSIG=Param |
|
(0~5) 远端设备的网络信号强度 |
+HFPROAM - HFP远端设备漫游状态
Format |
+HFPROAM=Param |
|
(0/1) 远端设备的漫游状态 |
+HFPBATT - HFP远端设备电池电量
Format |
+HFPBATT=Param |
|
(0~5) 远程设备的电池电量 |
+HFPNET - HFP远端设备网络运营商
Format |
+HFPNET=Param |
|
(UTF8)远程设备的网络运营商选择 |
+HFPMANU - HFP远端设备制造商
Format |
+HFPMANU=Param |
|
(UTF8)远程设备制造商 |
+HFPNUM - HFP远端设备本机号码
Format |
+HFPNUM=Param |
|
(ASCII)远端设备的本机号码 |
+HFPIBR - HFP远端设备支持来电铃声
Format |
+HFPIBR=Param |
|
0-不支持 1-支持 |
Description |
指示当前连接的手机是否支持来电铃声 |
+HFPRING - HFP远端设备来电铃声指示
Format |
+HFPRING=Param |
|
0-不支持in-bang-ring 1-支持in-band-ring |
Description |
来电时手机正在响铃,如果远程手机不支持in-band-ring,模块播放本地铃声 |
A2DP/AVRCP指示
+A2DPSTAT - A2DP状态
Format |
+A2DPSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Paused
(5) Streaming
|
+A2DPDEV - A2DP远端设备信息
Format |
+A2DPDEV=Param1{,Param2} |
|
(12 Bytes ASCII), 当前A2DP连接远端设备的MAC地址 |
|
(UTF8), 当前A2DP连接远端设备的名称 |
+AVRCPSTAT - AVRCP状态
Format |
+AVRCPSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
|
+PLAYSTAT - 媒体播放器播放状态
Format |
+PLAYSTAT=Param |
|
(0) Stopped
(1) Playing
(2) Paused
(3) Fast Forwarding
(4) Fast Rewinding
|
+PLAYMODE - 媒体播放器重复播放/随机播放模式
Format |
+PLAYMODE=Param1,Param2 |
|
Repeat Mode (1~4)
(1) Off
(2) Single Track
(3) All Tracks
(4) Group
|
|
Shuffle Mode (1~3)
(1) Off
(2) All Tracks
(3) Group
|
+TRACKSTAT - 媒体播放器播放进度
Format |
+TRACKSTAT=Param1,Param2,Param3 |
|
(0~4), 媒体播放器状态 |
|
(Decimal ASCII),当前音乐播放的时间(秒) |
|
(Decimal ASCII),当前音乐的总时间(秒) |
+TRACKINFO - 媒体音乐信息
Format |
+TRACKINFO=Param1,Param2,Param3 |
|
标题 |
|
艺术家 |
|
专辑 |
+BROWSTAT - 媒体浏览状态
Format |
+BROWSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Browsing
|
+BROWDATA - 媒体播放器文件系统浏览数据
Format |
+BROWDATA=Param1, Param2 {, Param3{, Param4}} |
|
浏览类型,对于每种类型,以下数据表示: |
|
Parame1: media player information
Parame2: 0 – support browsing; 1- not support browsing
Parame3: media player id
Parame4: media player name
|
|
Parame1: root dictionary name
Parame2: root dictionary name
|
|
Parame1: folder ID and name
Parame2: folder ID
Parame3: folder name
|
|
Parame1: media track ID and name
Parame2: media track ID
Parame3: media track name
|
|
Parame1: browsing operation result code
Parame2: 0 - browsing success; other - browsing error code
|
Description |
请参阅应用场景: AVRCP文件系统浏览 |
+BIPSTAT - BIP状态
Format |
+BIPSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Downloading
|
Description |
BIP配置文件现在仅用于媒体播放器封面图片下载,请参阅应用场景: AVRCP专辑图片下载 |
+COVERART - 媒体曲目封面下载成功
Format |
+COVERART=Param |
|
Image ID |
Description |
封面图片放在名为ImageID.jpg的指定文件夹中,请参阅应用场景: AVRCP专辑图片下载 |
PBAP指示
+PBSTAT - PBAP状态
Format |
+PBSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Downloading
|
+PBCNT - 远端设备的电话簿条目
Format |
+PBCNT=Param |
|
远端设备的电话簿条目 |
+PBDATA - 电话本数据
Format1 |
+PBDATA=Param1,Param2,Param3{,Param4} |
|
类型
(0) Phonebook (SIM Storage)
(1) Phonebook (Phone Storage)
(2) Received call log
(3) Dialed call log
(4) Missed call log
|
|
电话名称 |
|
电话号码 |
|
(15 Bytes ASCII), 当前下载通话记录,则有此参数
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 下载完成 |
Description |
某些手机可能没有通话时间 |
SPP指示
Note
由于和 AAP(Android Auto Protocol) 的指示和SPP几乎相同,分别是:
+AAPSTAT, +AAPDATA for AAP profile
文档将忽略这些指示说明, 默认BT631D不支持该指令.
+SPPSTAT - SPP状态
Format |
+SPPSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
|
+SPPDATA - SPP接收数据
Format |
+SPPDATA=Param1,Param2 |
|
Payload length |
|
Payload |
GATT指示
+GATTSTAT - GATT状态
Format |
+GATTSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
|
+GATTDATA - GATT接收数据
Format |
+SPPDATA=Param1,Param2 |
|
Payload length |
|
Payload |
HID指示
+HIDSTAT - HID状态
Format |
+HIDSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
|
BIS指示
+BISSTAT - BIS状态
Format |
+BISSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Paused
(5) Streaming
|
CIS指示
+CISSTAT - CIS状态
Format |
+CISSTAT=Param |
|
(0) Unsupported
(1) Standby
(2) Connecting
(3) Connected
(4) Paused
(5) Streaming
|
应用场景
Profile初始化及修改参数
下图展示了Profile初始化以及修改名称
MCU 修改设备名CARKIT参考代码,修改任何参数建议先查询再修改最后校验:
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}
接收模式连接
Note
BT631D默认AUXCFG=2,PROFILE=9385
发射模式连接
Note
发射模式连接需将模块配置到A2DP Source 、 HFP Source, 程序默认连接耳机、音箱后不会主动进入音频发射模式或通话(对讲)模式,需发送指令: 启动音频发射(AT+AUDROUTE=1) 启动通话(AT+AUDROUTE=2)
MCU 连接AirPods,并启动音频发射 参考代码:
1#define PROFILE_HFP_HF (uint16)(BIT3)
2#define PROFILE_HFP_AG (uint16)(BIT4)
3#define PROFILE_A2DP_SINK (uint16)(BIT5)
4#define PROFILE_A2DP_SOURCE (uint16)(BIT6)
5
6void bt_connect(void)
7{
8 //enable hfp source,a2dp source,avrcp tg,spp,gatt
9 uart_send("AT+PROFILE=339\r\n"); //if profile changes,module will auto reboot,
10 wait_ms(500);
11 uart_send("AT+PROFILE\r\n");
12 uint32 profiles = uart_read("+PROFILE",profiles);
13 if(profiles & (PROFILE_A2DP_SOURCE|PROFILE_HFP_AG))
14 {
15 uint8 addr[6];
16 uint8 buf[30]={0};
17 uint8 a2dp_state=0
18 uart_send("AT+SCAN=1\r\n");
19 uart_read_scan_addr("+SCAN",addr);
20 sprintf(buf,"AT+A2DPCONN=%s\r\n",addr);
21 uart_send(buf); //send a2dp connect
22
23 uart_read("+A2DPSTAT",a2dp_state);
24 if(a2dp_state == 3) //a2dp connected
25 {
26 uart_send("AT+AUDROUTE=1"); // start a2dp audio
27 }
28 uart_read("+A2DPSTAT",a2dp_state);
29 if(a2dp_state == 5)
30 {
31 //a2dp streaming
32 }
33 }
34 else
35 {/*not support master*/}
36}
HFP三方通话操作
Note
BT631D等模块未打开三方通话功能,若需要测试该功能请和飞易通联系
AVRCP文件系统浏览
Note
BT631D模块未打开此功能,若需要测试该功能请和飞易通联系
AVRCP专辑图片下载
Note
专辑图片下载仅车载协议栈模块支持,BT631D模块不支持
Phonebook/Contact photo下载
Note
Contact photo 仅车载协议栈模块支持,BT631D模块不支持
CIS Client模式连接
Note
发射立体声,接收单声道