bug练习2 车载设备三方通话合并

题目:BT carkit , missing conference options

[all; 100%; Xian Xiaohong]_[共同cell]_BT carkit
Pre: BT connect with carkit[MB BLUETOOTH]; insert 3 way calling card
Occur Process: on call conversation -> outgoing second call by carkit -> after it , make 3 way calling by carkit
Occur State: haven’t options “conference”

分析问题:

视频中,车载设备在第二个电话接通后没有显示合并通话按钮,其他正常。猜测是由于车载设备不支持合并通话所致,但此设备是有这个功能的,所以问题应该出在HF和AG连接过程中,双方交换特性信息时出现了错误。

查看log:

打开hci log,有:



与普通蓝牙耳机hci log对比,前半部分并无异常。留意到AT+CHLD=?和+CHLD:指令,查阅HFP的SPCE得知:

AT+CHLD=? :

    The test command AT+CHLD=? may be used for retrieving information about the call hold and multiparty services available in the AG

+CHLD:0  ,1,2,3,4:

0 = Releases all held calls or sets User Determined User Busy (UDUB) for a waiting call.
1 = Releases all active calls (if any exist) and accepts the other (held or waiting) call.
2 = Places all active calls (if any exist) on hold and accepts the other (held or waiting) call.
3 = Adds a held call to the conversation. 
4 = Connects the two calls and disconnects the subscriber from both calls (Explicit Call Transfer). Support for this value and its associated functionality is optional for the HF.



就是说HF端通过AT+CHLD?指令向AG查询三方通话支持的功能(合并通话是其中一种),AG端回复数字组合而成的功能列表。
hci log中的“+CHLD:(0,1,2)”缺少“3(Adds a held call to the conversation. )”,问题就在这里。

分析代码

当rfcomm连接回传数据时,以下方法会被触发:



根据cmd的类型进入如下处理分支:



其中bta_ag_send_result的功能为发送AT指令,指令内容为p_bta_ag_cfg->chld_val,其值为:



BTA_AG_CHLD_VAL的值为:



可以这个代码是发送了“(01,2,3,4)”的。

经过询问mentor,这个宏的值google默认是(01,2,3,4),三星会将其改为“(0,1,2,3)”。视频中出现的bug是因为该宏值为“(0,1,2)”所致。

经验教训

1. AT命令,三方通话,合并通话概念和流程均不熟悉导致分析起来很困难。

2. debug过程中可以通过与正常流程的log对比,来找到问题点。
3. 多点时间做前期分析,不要着急看代码。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据