本文章主要講下電話免提協議HFP(Hands-Free Profile)接聽來電/掛斷來電(HFP Accept/Reject incoming call)以及在掛斷電話(Terminate a call)。就是一下HFP feature中的NO.4和NO.5以及NO.6。
其中Accept an incoming voice call包括:
1)Answer Incoming Call from the HF – In-Band Ringing(從HF端接聽In-Band Ringing電話的流程)
2)Answer Incoming Call from the HF – No In-Band Ringing(從HF端接聽No In-Band Ringing電話的流程)
3)Answer Incoming Call from the AG(從AG端接聽電話的流程)
4)Change the In-Band Ring Tone Setting(改變In-Band Ring鈴聲設定)
其中Reject an incoming voice call包括:
1)Reject an Incoming Call from the HF(從HF端拒接來電)
2)Rejection/Interruption of an Incoming Call in the AG(從AG端拒接來電)
其中Terminate a call包括:
1)Terminate a Call Process from the HF
2)Terminate a Call Process from the AG

本專欄文章我們會以連載的方式持續更新,本專欄計劃更新內容如下:

第一篇:藍牙綜合介紹 ,主要介紹藍牙的一些概念,產生背景,發展軌跡,市面藍牙介紹,以及藍牙開發板介紹。
第二篇:Transport層介紹,主要介紹藍牙協議棧跟藍牙芯片之前的硬件傳輸協議,比如基于UART的H4,H5,BCSP,基于USB的H2等
第三篇:傳統藍牙controller介紹,主要介紹傳統藍牙芯片的介紹,包括射頻層(RF),基帶層(baseband),鏈路管理層(LMP)等
第四篇:傳統藍牙host介紹,主要介紹傳統藍牙的協議棧,比如HCI,L2CAP,SDP,RFCOMM,HFP,SPP,HID,AVDTP,AVCTP,A2DP,AVRCP,OBEX,PBAP,MAP等等一系列的協議吧。
第五篇:低功耗藍牙controller介紹,主要介紹低功耗藍牙芯片,包括物理層(PHY),鏈路層(LL)
第六篇:低功耗藍牙host介紹,低功耗藍牙協議棧的介紹,包括HCI,L2CAP,ATT,GATT,SM等
第七篇:藍牙芯片介紹,主要介紹一些藍牙芯片的初始化流程,基于HCI vendor command的擴展
第八篇:附錄,主要介紹以上常用名詞的介紹以及一些特殊流程的介紹等。
另外,開發板如下所示,對于想學習藍牙協議棧的最好人手一套。以便更好的學習藍牙協議棧,相信我,學完這一套視頻你將擁有修改任何協議棧的能力(比如Linux下的bluez,Android下的bluedroid)。

-------------------------------------------------------------------------------------------------------------------------
CSDN學院鏈接(進入選擇你想要學習的課程):
藍牙交流扣扣群:970324688
Github代碼:
入手開發板:
藍牙學習目錄:
--------------------------------------------------------------------------------------------------------------------------
![]()
Upon an incoming call, the AG shall send a sequence of unsolicited RING alerts to the HF. The RING alert shall be repeated for as long as the call acceptance is pending, or until the incoming call is interrupted for any reason.The HF shall produce a local alerting in reaction to the RING. If the AG's SDP record (or BRSF message) indicates "In-band ring tone" is supported, the AG shall send in-band ring tones unless subsequently changed using procedures defined in Section 4.13.4. The AG may abort the incoming call when necessary. It shall then stop sending the RING alert to the HF
此部分會牽扯到一個in band ring的概念,支持in band ring的AG在incoming call的時候,會先建立audio connection(SCO),然后在RING AT command之后傳過來聲音,也就是手機鈴聲,直到被接聽或者掛斷,或者其他原因中斷incoming call為止。而no in band ring實在call active的時候才會建立SCO,所以此時候HF要在incoming call的時候自己做一個鈴聲。
流程如下:


下面我們就來看下以上in band ring和no in band ring的差別:
支持In band ring的AG首先會建立SCO,然后每次發送RING command給HF后,都會發送 ring tone(鈴聲)給HF,而no in band ring AG只會間隔發送RING command給HF,等到接聽后才會建立SCO
接著我們來看下設計到的AT command。
CIEV在上面已經介紹,此部分不再做介紹

CLIP會在Calling Line Identification (CLI)小節再做介紹

從AG端接聽incoming call的流程比較簡單,AG只是會通過 CIEV更新callsetup,call

雖然在SDP或者BRSF中能解析到AG是否支持in band ring,但是在后來的過程,AG可能通過 BSIR來變更是否support in band ring。

Command如下:

![]()


通過HF拒接來電,只需要下AT CHUP command就行了,然后AG會發送過來callsetup得而CIEV command過來,同on個過AG拒接,AG同樣會發送callsetup的CIEV過來。

![]()

AT command格式跟掛斷incoming call一樣,都是AT CHUP,所以不再重復。

掛斷電話跟拒接來電的很類似,差別在于AG發送過來的CIEV是call的value,不再重復說明