蓝牙耳机编程流程HANDESET Programmers Guide文档格式.docx
- 文档编号:19310099
- 上传时间:2023-01-05
- 格式:DOCX
- 页数:21
- 大小:191.41KB
蓝牙耳机编程流程HANDESET Programmers Guide文档格式.docx
《蓝牙耳机编程流程HANDESET Programmers Guide文档格式.docx》由会员分享,可在线阅读,更多相关《蓝牙耳机编程流程HANDESET Programmers Guide文档格式.docx(21页珍藏版)》请在冰豆网上搜索。
1Anuserdialsanumberusingacellularphone(AG).
2Uponsuccessfulconnection,theuserbypressingabuttonontheHSinitiatesatransferoftheaudiodatafromthecellphonetotheHS.
Note:
1Headset'
stypicallyhaveauserinterfacebywhichintentionssuchascallaccept,calltransferareindicatedtotheAG.
2Thewordbuttonusedaboveisasimileforanysuchuserinterface
3IMPORTANT:
Althoughthewordcallisfrequentlyusedinthisdocument,itshallbereadas'
Audioconnection'
.ThisisbecausetheAGmaytreattheHSastheinputoroutputaudioportforpurposesotherthancallprocessing(suchastunes,beeps,alarms,etc..).
2.2控制路径和数据路径
1,AControlpathtypicallytransmitscommandsandresponsesrelatingtoaprofileandtheDatapathistypicallyusedtotransmitvoicedata
2AControlpathshouldbeestablishedpriortotheestablishmentoftheDatapath.
3TheexistenceofaDatapathisoptional
4.InthecontextoftheHeadsetprofilecommandsandresponsesrelatingtocallacceptance,audiodatatransfer,volumecontroletc..areexchangedbetweentheAGandHSovertheControlpathandtheDatapathisusedtotransferaudio(voice)databetweentheAGandtheHS
2.3MODULE
Theprofileimplementationconsistsofthreemodules.Theseareoutlinedbelow.
ThisprovidestheserialportinterfacethatbothHSandAGusetoSPChannelestablish/releaseControlandDatapaths.(SeeSPChannel
programmersguidefordetails).
ImplementationoftheHSportionoftheprofile;
usedbyapplicationsHeadset(HS)residingontheHS.
ImplementationoftheAGportionoftheprofile;
usedbyapplicationsAudio-Gateway(AG)residingontheAG.
第2页共20页
2.4Applicationstate
TheHeadsetAPIisstatelessinnature.Thismeansthattheapplicationhastokeeptrackofstates.
Thepossiblestatesofanapplication(withrespecttotheHeadsetprofile)aretypically
StateDescription
NOTHeretheControlpathisnotestablished.CONNECTED
HeretheControlpathisestablishedbuttheDatapathCONNECTEDisnot.
TheDatapathisalsoestablishedhereandisbeingusedIN_CALLtostreamvoicetheAGtotheHS.
2.5EstablishmentandreleaseofControlandDatapaths
ThefollowingmatrixspecifiesthecorrelationbetweentheControl/DatapathsandtherolesaspertheHeadsetprofilespecification.
ActionEstablishRelease
ControlHSorAGAGPathDataAGAG
第3页共20页
i.e.
1TheControlpathcanbeestablishedeitherbytheHSorAGwhileitsreleasecanbeperformedonlybytheAG.
2TheDatapathcanbeestablishedandreleasedonlybytheAG
2.6SPChannelAPI
TheSPChannelAPIthatprovidesameanstoestablishandreleaseControlandDatapathsisusedbytheHeadsetAPI.ThereaderisrecommendedtoreadtheSPChannelprogrammersguidebeforeproceedingfurther.
2.7HeadsetAPIusage
FromtheHSend
HSinitialization
Toacceptanincomingcall.
TotransferthecallfromtheAGtotheHS.
Toterminatethecall.
TonotifyAGaboutspeakerandmicrophonevolumelevels.
Proprietarycommands
HSun-initialization
NotethattheHSinitializationandun-initializationarenotnecessarilyrequirementsbuthavebeenincludedhereforthesakeofcompletenessoftheAPIusage.
FromtheAGend
AGinitialization
TonotifytheHSofanincomingcall.
TotransferthecallfromtheHStotheAG.
TocontrolthespeakerandmicrophonevolumelevelsoftheHS.
Proprietaryunsolicitedresultcodes
AGun-initialization
2.8Buttonpresshandling
TheHeadsetspecificationusestheword'
Userinitiatedaction'
tomeananindicationreceivedfromtheuser(typicallyabuttonpress,oraGUIclicketc..)toperformasuitableaction.The
第4页共20页
suitableactioninthecontextHSintheHeadsetspecificationiseitheracallaccept,calltransferorcallterminate.Thusthesame'
thatisconveyedbytheHStotheAGisinterpreteddifferently.ThisisbasedonthestatesoftheHSandAGapplicationsthatarecurrentlyinteractionwitheachother.
TheHS_SendButtonPressfunctionoftheHSAPIisusedtomodelthis'
Useinitiatedaction'
.Weshallnowlookatwhatitmeanstohandlethebuttonpressatthe
Headsetendand
Gatewayend
3.Requirements
TherequirementsontheHSandAGunitsofthisprofilearestatedinthetablebelow.
RequirementDescription
AbilitytoestablishaconnectioninordertotreattheIncomingaudioconnectionHSasanoutputaudioportoftheAG.
AbilitytoestablishaconnectioninordertotreattheOutgoingaudioconnectionHSasaninputaudioportoftheAG.
AudioconnectiontransferTransferringtheaudiobetweentheHSandAG.
RemoteaudiovolumecontrolAbilityoftheAGtoadjustthevolumelevelontheHS.
4.APIUsage
Thissectionpresentstheusageofheadset(HSandAG)APIfunction.ExampleusecasescenariosarepresentedheretohighlightAPIusage.
4.1UsageofHSAPI
TheusageoftheHSAPIispresentedinthefollowingsections.
第5页共20页
HANDESETProgrammersGuide洪林整理4.1.1HSinitializationTheHSapplicationmustfirstinitializetheHSprofile.Thisisdoneasfollows:
EstablishaSPChannelControlpath
Usetheactive(established)SPChannelhandletocreate(initialize)theHS_Handle.
ThisHF_HandlewillbeusedinalltheothercallsoftheHSAPI.
Notethatwhethertheapplicationislisteningorconnecting,successfulestablishmentofa
Controlpathwillbeindicatedusingthespchannel_open_cfmcallback.
4.1.2Toacceptanincomingcall(I)
HerewepresentthecaseonhowtheHSacceptsanincomingcall.
Thisisaccomplishedasfollows:
HSwaitsforanincomingControlpathestablishmentbytheAG.
HSreceivestheRINGcodeontheControlpaththat
indicatesthattheHScouldperformalocalringontheheadphone
thatthereisaincomingcall
UseratHSpressesabuttontosignalcallacceptanceoftheincomingcall.Thissignalissent
totheAG.
HSreceivesaconfirmation(response)fromtheAGforthecallaccept.
HSreceivesaDatapathestablishmentindication(theDatapathbeinginitiatedbytheAG).
VoicedataisreceivedontheDatapathandrenderedontheheadphoneappropriately.
第6页共20页
4.1.3Toacceptanincomingcall(II)
HerewepresentanothercasebywhichtheHSacceptsanincomingcall.
AringtoneiscommunicatedbytheAGtotheHSusingain-bandsignalontheDatapath
establishedearlier.
UseratHSpressesabuttontosignalacceptanceoftheincomingcall.Thissignalissentto
theAG.
HSreceivesaconfirmationfromtheAGforthecallacceptsentviathebuttonpressatHS.
第7页共20页
4.1.4CalltransferfromAGtoHSHerewepresentacasebywhichtheHStransfersacallfromtheAGtoitself(whenthecall
wasbeingattendedattheAG).Thisisaccomplishedasfollows:
UseratHSpressesabuttontosignalacceptanceofthecall.Thiscausesthefollowing
thingstohappen.
HSinitiatesaControlpathestablishmenttotheAG.
AfterwhichthebuttonpressiscommunicatedtotheAG.
TheAGrespondstothebuttonpressindicationwithapositiveresponse.
HSthenreceivesaDatapathestablishmentindication(theDatapathbeinginitiatedbythe
AG.
第8页共20页
4.1.5Calltermination
GiventhattheControlpathandDatapathhavebeenestablishedandvoicedataisstreamingfromtheAGtotheHSviatheDatapath;
theHScanterminatethecallasfollows:
Userpressesthebutton,thisleadstothebuttonpresscommandbeingsentfromtheHSto
theAG
Uponreceptionofpositiveconfirmation,theHSwaitsfortheAGto
releasetheDatapath
releasetheControlpath
第9页共20页
4.1.6TonotifyAGaboutcurrentvolumelevels
TheHStypicallyinformstheAGofthevolumelevelsofthespeakerandmicrophonesoonaftertheestablishmentoftheControlpathasfollows:
IssuethecommandintimatingtheAGofthecurrentspeakervolumelevel.
ReceiveaconfirmationforthesamefromtheAG.
第10页共20页
4.1.7Proprietarycommands
Incert
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 蓝牙耳机编程流程HANDESET Programmers Guide 蓝牙 耳机 编程 流程 HANDESET