蓝牙 宽带通话 (wide band speech)WBS 剖析(一) -- profile层

一.概述

WBS(wide band speech)通俗来讲就是蓝牙宽带通话,通话数据frequency 16K,采用msbc编解码(chip中实现)
和NBS(narrow band speech)相对,NBS通俗来讲是窄带通话,通话数据frequency 8K,采用CSVD编解码(chip中实现)
NBS是默认

二.实现

要实现WBS,总体来说比较复杂
要分两个阶段进行:
1.profile层(HFP AT COMMAND)
2.control bluetooth chip(如 CSR 通过 BCCMD)

三.profile层实现:

步骤:
1.First, in the initialization procedure, the HF shall send the AT+BRSF= 
command to the AG to both notify the AG of the supported features in the HF, as well as to 
retrieve the supported features in the AG using the +BRSF result code.
2.Secondly, in the initialization procedure, if the HF supports the Codec Negotiation feature, it 
shall check if the AT+BRSF command response from the AG has indicated that it supports the 
Codec Negotiation feature. If both the HF and AG do support the Codec Negotiation feature 
then the HF shall send the AT+BAC= command to the AG to notify the 
AG of the available codecs in the HF.


HF Feature:

蓝牙 宽带通话 (wide band speech)WBS 剖析(一) -- profile层_第1张图片

AG Feature:

蓝牙 宽带通话 (wide band speech)WBS 剖析(一) -- profile层_第2张图片

3.通话时,AG会发送过来+BCS=ID
我们回复AT+BCS=ID

四.流程图:

蓝牙 宽带通话 (wide band speech)WBS 剖析(一) -- profile层_第3张图片
实例:

蓝牙 宽带通话 (wide band speech)WBS 剖析(一) -- profile层_第4张图片

蓝牙 宽带通话 (wide band speech)WBS 剖析(一) -- profile层_第5张图片

这样接受了SCO连接,相当于profile层面启动了WBS
蓝牙 宽带通话 (wide band speech)WBS 剖析(一) -- profile层_第6张图片
通过空中包分析发现编码方式确实变成了msbc

通常这时候要把MIC,PCM_IN,PCM_OUT,SPEAKER切换成16K

但是现在问题来了,切换16K后为什么还全都是杂音呢?
揭晓答案:
HFP profile层面只是通知手机要进行WBS通话了,但是local chip并不知道,也不会解析HFP层面的AT command
所以我们应该有一些机制告知chip一些消息,如CSR 需要 BCCMD告知,每个chip厂商都有自己的策略

由于告知芯片这个过程比较复杂,所以在下篇文章介绍(拿CSR举例)

你可能感兴趣的:(蓝牙协议剖析)