本文主要是介绍BQB pts测试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
测试BQB的pts dongle是在蓝牙SIG官网买的,链接是
https://store.bluetooth.com/12210888/orders/d3b63cfd9d3d5a22c2e08ad9711a91c4
pts dongle最新的测试结果
ACS-BV-07-I/ACS-BV-12-I/ACS-BI-13-I 这三个是接完电话就fail
ICA-BV-02-I/TCA-BV-01-I 这两个是挂不了电话
ICR-BV-01-I 这个是拒接电话的
TCA-BV-04-I 这个需要拨打电话,再挂断的
ATH-BV-04-I 建立SCO连接
OOR-BV-02-I/SLC-bv-03-c 建立SLC连接
pts_setup_7_4_1.exe下载链接
安装pts_setup_6_0_1.exe后,接入dongle,dongle的驱动在安装目录下
选择设备管理,重新导入就可以安装驱动成功
打开pts
file->new workspace
填入设备的mac地址
点next
输入工程的名字与路径
解锁
这些测试是反项测试,fail表示支持这个profile,只需要在ics里配置并再次测试通过即可
这里表示相应打勾都支持了
如下是支持a2dp sink,headset HF ,avrcp TG的角色
测试hfp
添加一下工程HFP
打开ICS,如图选HFP
所有选项,不需要全部都要测试的,Matter部分一定要测试,Option可以选测的,后边有M的都是Matter部分,带O的是Option部分
如同样的方法创建a2dp
方法选择测试什么选项,下面都有要求在ICS里打上哪些勾
测试失败的都打!,成功的都打勾
测试中需要关掉不必要的profile,修改avrcp tg的版本为非1.4,因为1.4在BQB测试中已弃用了
Index: android/packages/apps/Bluetooth/res/values/config.xml
===================================================================
--- android/packages/apps/Bluetooth/res/values/config.xml (revision 266)
+++ android/packages/apps/Bluetooth/res/values/config.xml (revision 267)
@@ -17,15 +17,15 @@<bool name="profile_supported_a2dp_sink">true</bool><bool name="profile_supported_hdp">true</bool><bool name="profile_supported_hs_hfp">true</bool>
- <bool name="profile_supported_hfpclient">false</bool>
- <bool name="profile_supported_hid">true</bool>
- <bool name="profile_supported_opp">true</bool>
- <bool name="profile_supported_pan">true</bool>
- <bool name="profile_supported_pbap">true</bool>
+ <bool name="profile_supported_hfpclient">true</bool>
+ <bool name="profile_supported_hid">false</bool>
+ <bool name="profile_supported_opp">false</bool>
+ <bool name="profile_supported_pan">false</bool>
+ <bool name="profile_supported_pbap">false</bool><bool name="profile_supported_gatt">true</bool>
- <bool name="pbap_include_photos_in_vcard">true</bool>
- <bool name="pbap_use_profile_for_owner_vcard">true</bool>
- <bool name="profile_supported_map">true</bool>
+ <bool name="pbap_include_photos_in_vcard">false</bool>
+ <bool name="pbap_use_profile_for_owner_vcard">false</bool>
+ <bool name="profile_supported_map">false</bool><bool name="profile_supported_avrcp_controller">true</bool><bool name="profile_supported_sap">false</bool><bool name="profile_supported_pbapclient">false</bool>
Index: android/device/qcom/msm8909/msm8909.mk
===================================================================
--- android/device/qcom/msm8909/msm8909.mk (revision 266)
+++ android/device/qcom/msm8909/msm8909.mk (revision 267)
@@ -273,3 +273,4 @@PRODUCT_PROPERTY_OVERRIDES += ro.custom.build.version=$(BUILD_VERSION)PRODUCT_PROPERTY_OVERRIDES += ro.custom.build.mic.version=$(BUILD_MIC_VERSION)PRODUCT_PROPERTY_OVERRIDES += persist.service.bt.a2dp.sink=true
+PRODUCT_PROPERTY_OVERRIDES += persist.service.bt.hfp.client=true
\ No newline at end of file
Index: android/device/qcom/common/product/overlay/packages/apps/Bluetooth/res/values/config.xml
===================================================================
--- android/device/qcom/common/product/overlay/packages/apps/Bluetooth/res/values/config.xml (revision 266)
+++ android/device/qcom/common/product/overlay/packages/apps/Bluetooth/res/values/config.xml (revision 267)
@@ -33,5 +33,5 @@<bool name="profile_supported_hfpclient">false</bool><bool name="profile_supported_avrcp_controller">true</bool><bool name="profile_supported_a2dp_sink">true</bool>
- <bool name="profile_supported_sap">true</bool>
+ <bool name="profile_supported_sap">false</bool></resources>
Index: android/vendor/qcom/opensource/bluetooth/res/values/config.xml
===================================================================
--- android/vendor/qcom/opensource/bluetooth/res/values/config.xml (revision 278)
+++ android/vendor/qcom/opensource/bluetooth/res/values/config.xml (revision 279)
@@ -13,8 +13,8 @@limitations under the License.--><resources>
- <bool name="profile_supported_ftp">true</bool>
+ <bool name="profile_supported_ftp">false</bool><bool name="profile_supported_map">false</bool><bool name="profile_supported_sap">false</bool>
- <bool name="profile_supported_dun">true</bool>
+ <bool name="profile_supported_dun">false</bool></resources>
Index: android/system/bt/bta/av/bta_av_main.cc
===================================================================
--- android/system/bt/bta/av/bta_av_main.cc (revision 278)
+++ android/system/bt/bta/av/bta_av_main.cc (revision 279)
@@ -520,7 +520,8 @@profile_version = AVRC_REV_1_6;} else if (profile_initialized == UUID_SERVCLASS_AUDIO_SINK) {// Initialize AVRCP1.4 to provide Absolute Volume control.
- profile_version = AVRC_REV_1_4;
+ profile_version = AVRC_REV_1_3;
+ //profile_version = AVRC_REV_1_4;}bta_ar_reg_avrc(
添加接电话挂电话的功能
用平台的两个按键支持,这里为电话键是接听挂断,录音按键是拒接
只需要在原来接听按键的基础上添加判断正在通话,再挂断电话,在录音按键中处理挂断按键的功能
Index: android/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
===================================================================
--- android/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java (revision 279)
+++ android/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java (revision 280)
@@ -6305,6 +6305,38 @@msg.setAsynchronous(true);msg.sendToTarget();}
+ if (down) {
+ TelecomManager telecomManager = getTelecommService();
+ boolean hungUp = false;
+ if (telecomManager != null) {
+ hungUp = telecomManager.endCall();
+ }
+ if (interactive && !hungUp) {
+ mEndCallKeyHandled = false;
+ mHandler.postDelayed(mEndCallLongPress,
+ ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
+ } else {
+ mEndCallKeyHandled = true;
+ }
+ } else {
+ if (!mEndCallKeyHandled) {
+ mHandler.removeCallbacks(mEndCallLongPress);
+ if (!canceled) {
+ if ((mEndcallBehavior
+ & Settings.System.END_BUTTON_BEHAVIOR_HOME) != 0) {
+ if (goHome()) {
+ break;
+ }
+ }
+ if ((mEndcallBehavior
+ & Settings.System.END_BUTTON_BEHAVIOR_SLEEP) != 0) {
+ goToSleep(event.getEventTime(),
+ PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON, 0);
+ isWakeKey = false;
+ }
+ }
+ }
+ }break;}@@ -6321,6 +6353,11 @@// (which is presumably the InCallScreen.)result &= ~ACTION_PASS_TO_USER;}
+ //add by zhongyk
+ else if (telecomManager.isInCall()){
+ telecomManager.endCall();
+ result &= ~ACTION_PASS_TO_USER;
+ }}}break;
添加以上代码后就可以支持按键挂断与拒接功能
测试情况如下:
测试因为我经常烧录,需要换mac地址,老是重建工程麻烦
后来问了同事说,pts dongle可以单独修改工程的测试mac地址,
修改后再次测试就生效了,沟通分享很重要
TCA-BV-04-I 这个需要拨打电话,再挂断的
末位重拨功能测试
末位重拨的功能可以在连接上ag后,hf上点上面的按键向ag申请打电话
末位重拨的功能流程
测试发现平台用的是有号码的拨号(本地之前拨号出去的,但清除之后也打不出去,不知道的问题在哪?)
/********************************************************************************* Function dial** Description place a call** Returns bt_status_t*******************************************************************************/
static bt_status_t dial(UNUSED_ATTR const RawAddress* bd_addr,const char* number) {btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr);if (cb == NULL || !is_connected(cb)) return BT_STATUS_FAIL;CHECK_BTHF_CLIENT_SLC_CONNECTED(cb);if (number) {BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_ATD, 0, 0, number);} else {BTA_HfClientSendAT(cb->handle, BTA_HF_CLIENT_AT_CMD_BLDN, 0, 0, NULL);}return BT_STATUS_SUCCESS;
}
以上协议栈代码说明上层传了电话号码下来,因为实际情况用了ATD而非 BLDN命令
OOR-BV-02-I
这个测试是将平台放地信号范围外,再放在信号范围内hf向 ag发起连接的过程
分析,从信号弱的地方平台回连pts dongle时, 没有发起sco连接,加上以下patch之后发起平台界面连接dongle时会发起sco连接
diff --git a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
index 3dd242ce7..08cfe8c7b 100755
--- a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
+++ b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
@@ -113,6 +113,7 @@ public class HeadsetClientStateMachine extends StateMachine {
public static final Integer HF_ORIGINATED_CALL_ID = new Integer(-1);
private long OUTGOING_TIMEOUT_MILLI = 10 * 1000; // 10 seconds
private long QUERY_CURRENT_CALLS_WAIT_MILLIS = 2 * 1000; // 2 seconds
+ static final int SETUP_XSCO_WHILE_SLC_PENDING = 5 * 1000; // 5seconds // Keep track of audio routing across all devices.
private static boolean sAudioIsRouted = true;
@@ -960,7 +961,6 @@ public class HeadsetClientStateMachine extends StateMachine {
case StackEvent.EVENT_TYPE_ROAMING_STATE:
case StackEvent.EVENT_TYPE_NETWORK_SIGNAL:
case StackEvent.EVENT_TYPE_BATTERY_LEVEL:
- case StackEvent.EVENT_TYPE_CALL:
case StackEvent.EVENT_TYPE_CALLSETUP:
case StackEvent.EVENT_TYPE_CALLHELD:
case StackEvent.EVENT_TYPE_RESP_AND_HOLD:
@@ -969,6 +969,13 @@ public class HeadsetClientStateMachine extends StateMachine {
case StackEvent.EVENT_TYPE_VOLUME_CHANGED:
deferMessage(message);
break;
+ case StackEvent.EVENT_TYPE_CALL:
+ if (event.valueInt == 1)
+ {
+ Log.d(TAG, "Connecting: setup SCO later if move to connected" + event.type);
+ sendMessageDelayed(CONNECT_AUDIO, SETUP_XSCO_WHILE_SLC_PENDING);
+ }
+ break;
case StackEvent.EVENT_TYPE_CMD_RESULT:
case StackEvent.EVENT_TYPE_SUBSCRIBER_INFO:
case StackEvent.EVENT_TYPE_CURRENT_CALLS:
cube_orr-bv-02-3.ca.cfa第636帧中发送
Command: HCI_Setup_Synchronous_Connection
且发送状态status:是成功的
之后638返回
Event: HCI_Synchronous_Connection_Complete
但event的status的状态表示:
Status: Unsupported Remote Feature/Unsupported LMP Feature
但PTS dongle的日志来看,没有收到HCI_Connect_request
且第一次pts dongle主动连接时平台时,平台在287帧收到
Event: HCI_Connection_Request
且回连了, Command: HCI_Accept_Synchronous_Connection_Request
是否是说明平台主动连接AG时,出错,命令发不出去
原因是:Unsupported Remote Feature/Unsupported LMP Feature
尽管AG和HF都可以触发音频连接,但是编解码和同步连接建立只能有AG侧真正发起(除非其中一个设备是legacy设备)。
仅当HF通知AG其支持Codec Negotiation时,AG才会通过当前的SLC发送AT+BAC命令发起CodecConnection。即才会发起Codec协商的动作,AG会根据HF对AT+BAC的应答来选择合适的Codec connection。如下图支持协商时有如下流程,
如不支持协商,即没有上图协调的流程
AG将会通知HF在建立Synchronous Connection前使用哪个codec ID。
AG将会发送未经请求的命令+BCS=给HF。HF将以AT+BCS=< CodecID>命令响应,只要该ID是支持的,ID将会和AG发来的未经请求的命令是一样的。但是如果ID不支持,HF将以AT+BAC和其可用的codec作为应答。
如果AG收到的AT+BCS命令的ID和之前其发送的一样,则会发送OK应答,否则发送ERROR。如果AG发送命令+BCS后没有收到AT+BCS而是AT+BAC,这一过程将会结束但是AG在重新选择codec ID后会重新这一过程。
在发送OK响应后,AG将会根据ID打开相应设置的同步连接,而HF在发送AT+BCS=命令后也能够接收同步连接建立请求。
在同步连接建立完成后,codec 连接建立也完成。+BCS命令是对这次和后续连接codec选择。
如果(e)SCOlink无法建立,AG将会重启启动CodecConnection建立过程。在Codec connection建立连接之前,CVSD编码将被启用。
可选的codec跟新
对AG和HF都支持CodecNegotiaton特性的SLC场景。HF可以发送AT+BAC通知AG可选codec的动态变化。如果AG已经发起Codec Connection建立过程,HF将会发起AT+BAC命令以响应AG的未经请求的+BCS命令的codec不可用的情况。
高通的人说是HF1.6支持的是mSBC解决1.5用的是CVSD
如小米6 1.6的sco连接包为mSBC
因此在建立SCO连接时不成功,不支持
sdp显示pts dongle此时为1.5的版本
为什么第一次连接会成功呢,查看一下支持的codec类型:测试平台这边 是两种解码器都支持,如果能让pts dongle变成1.6版本的,话也许可以通过连接
mSBC特征,取自HFP1.6协议手册
摘自:http://www.cnblogs.com/dylancao/p/9125221.html
蓝牙高级音频分发模型(A2DP)规定使用子带编码(SBC)为强制音频编解码系统,以保证手持电话和耳机间的互操作性。SBC是一种低复杂度的编解码技术,压缩比率适中,支持16kHz, 32kHz, 44.1kHz和48kHz的采样率,也因此成为蓝牙高清语音的当然之选。对于16kHz的宽带语音而言,SBC能以64kbps数据速率对其进行4:1的压缩。但是,当SBC编码帧通过蓝牙传输时,它可能与底层蓝牙数据包不相匹配。因此,mSBC编解码技术被开发用于匹配SBC和蓝牙数据包,并于2011年5月被定义为Bluetooth Hands-Free Profile 1.6中的强制编解码方式
窄带与宽带音频的特征如下:
CVSD: pcm: 8kHz, 16 bits, 1 channel.
compression ratio: 16 (controller encoding)insert ratio: 8pcm data rate= 16kB/s =8K*16/8CVSD data rate=8kB/s =16kB/s* 8/16air data: **CVSD**
mSBC: pcm 16kHz, 16 bits, 1 channel.
compression ratio: 4 (host encoding: 240->60)pcm data rate= 32kB/smSBC data rate=8kB/s = 32kB/s / 4air data: **transparent data** (mSBC)
这篇关于BQB pts测试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!