蓝牙耳机编程流程HANDESET Programmers Guide.docx

上传人:b****5 文档编号:6301026 上传时间:2023-01-05 格式:DOCX 页数:21 大小:191.41KB
下载 相关 举报
蓝牙耳机编程流程HANDESET Programmers Guide.docx_第1页
第1页 / 共21页
蓝牙耳机编程流程HANDESET Programmers Guide.docx_第2页
第2页 / 共21页
蓝牙耳机编程流程HANDESET Programmers Guide.docx_第3页
第3页 / 共21页
蓝牙耳机编程流程HANDESET Programmers Guide.docx_第4页
第4页 / 共21页
蓝牙耳机编程流程HANDESET Programmers Guide.docx_第5页
第5页 / 共21页
点击查看更多>>
下载资源
资源描述

蓝牙耳机编程流程HANDESET Programmers Guide.docx

《蓝牙耳机编程流程HANDESET Programmers Guide.docx》由会员分享,可在线阅读,更多相关《蓝牙耳机编程流程HANDESET Programmers Guide.docx(21页珍藏版)》请在冰豆网上搜索。

蓝牙耳机编程流程HANDESET Programmers Guide.docx

蓝牙耳机编程流程HANDESETProgrammersGuide

蓝牙耳机编程流程-HANDESETProgrammersGuide

HANDESETProgrammersGuide洪林整理

HANDESETProgrammersGuide

1.Introduction

HeadsetprofileisusedtoenablewirelessconnectivityamongBluetoothenabledHeadsets,PCsandthecellularphones.

2.Concepts

2.1USAGE(用法)

TwousecasesarepresentedhereforunderstandingtheAGandHSroles.Notethatthesecasesarenotcomprehensive.

Incomingcall

1Incomingcallarrivesatacellularphoneconnectedtoamobilenetwork.

2ThecellularphoneactingasanAGindicatesthiscallarrivaltoaHeadset.ThisistypicallyperceivedasaringontheHS.

3Theuseracceptstheincomingcall,bypressingabuttonontheHS.

第1页共20页

HANDESETProgrammersGuide洪林整理

4TheAGonreceivingthisacceptanceroutestheaudiodatafromthenetworktoHS.Outgoingcall

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页

HANDESETProgrammersGuide洪林整理

2.4Applicationstate

TheHeadsetAPIisstatelessinnature.Thismeansthattheapplicationhastokeeptrackofstates.

Thepossiblestatesofanapplication(withrespecttotheHeadsetprofile)aretypically

StateDescription

NOTHeretheControlpathisnotestablished.CONNECTED

HeretheControlpathisestablishedbuttheDatapathCONNECTEDisnot.

TheDatapathisalsoestablishedhereandisbeingusedIN_CALLtostreamvoicetheAGtotheHS.

2.5EstablishmentandreleaseofControlandDatapaths

ThefollowingmatrixspecifiesthecorrelationbetweentheControl/DatapathsandtherolesaspertheHeadsetprofilespecification.

ActionEstablishRelease

ControlHSorAGAGPathDataAGAG

第3页共20页

HANDESETProgrammersGuide洪林整理

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页

HANDESETProgrammersGuide洪林整理

suitableactioninthecontextHSintheHeadsetspecificationiseitheracallaccept,calltransferorcallterminate.Thusthesame'Userinitiatedaction'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页

HANDESETProgrammersGuide洪林整理

4.1.3Toacceptanincomingcall(II)

HerewepresentanothercasebywhichtheHSacceptsanincomingcall.

Thisisaccomplishedasfollows:

HSwaitsforanincomingControlpathestablishmentbytheAG.

HSreceivestheRINGcodeontheControlpaththat

indicatesthattheHScouldperformalocalringontheheadphone

thatthereisaincomingcall

HSreceivesaDatapathestablishmentindication(theDatapathbeinginitiatedbytheAG).

AringtoneiscommunicatedbytheAGtotheHSusingain-bandsignalontheDatapath

establishedearlier.

UseratHSpressesabuttontosignalacceptanceoftheincomingcall.Thissignalissentto

theAG.

HSreceivesaconfirmationfromtheAGforthecallacceptsentviathebuttonpressatHS.

VoicedataisreceivedontheDatapathandrenderedontheheadphoneappropriately.

第7页共20页

HANDESETProgrammersGuide洪林整理

4.1.4CalltransferfromAGtoHSHerewepresentacasebywhichtheHStransfersacallfromtheAGtoitself(whenthecall

wasbeingattendedattheAG).Thisisaccomplishedasfollows:

UseratHSpressesabuttontosignalacceptanceofthecall.Thiscausesthefollowing

thingstohappen.

HSinitiatesaControlpathestablishmenttotheAG.

AfterwhichthebuttonpressiscommunicatedtotheAG.

TheAGrespondstothebuttonpressindicationwithapositiveresponse.

HSthenreceivesaDatapathestablishmentindication(theDatapathbeinginitiatedbythe

AG.

VoicedataisreceivedontheDatapathandrenderedontheheadphoneappropriately.

第8页共20页

HANDESETProgrammersGuide洪林整理

4.1.5Calltermination

GiventhattheControlpathandDatapathhavebeenestablishedandvoicedataisstreamingfromtheAGtotheHSviatheDatapath;theHScanterminatethecallasfollows:

Userpressesthebutton,thisleadstothebuttonpresscommandbeingsentfromtheHSto

theAG

Uponreceptionofpositiveconfirmation,theHSwaitsfortheAGto

releasetheDatapath

releasetheControlpath

第9页共20页

HANDESETProgrammersGuide洪林整理

4.1.6TonotifyAGaboutcurrentvolumelevels

TheHStypicallyinformstheAGofthevolumelevelsofthespeakerandmicrophonesoonaftertheestablishmentoftheControlpathasfollows:

IssuethecommandintimatingtheAGofthecurrentspeakervolumelevel.

ReceiveaconfirmationforthesamefromtheAG.

第10页共20页

HANDESETProgrammersGuide洪林整理

4.1.7Proprietarycommands

Incert

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 党团工作 > 入党转正申请

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1