lior-自杀死
HANDESET Programmers Guide
洪林整理
HANDESET Programmers Guide
1.
Introduction
Headset profile is used to enable wireless connectivity among Bluetooth enabled Headsets,
PCs and the cellular phones.
2.
Concepts
2.1
USAGE (
用法
)
Two use cases are presented here for understanding the AG and HS roles. Note that these
cases are not comprehensive.
Incoming call
1
Incoming call arrives at a cellular phone connected to a mobile network.
2 The cellular phone acting as an AG indicates this call arrival to a Headset. This is
typically perceived as a ring on the HS.
3 The user accepts the incoming call, by pressing a button on the HS.
第
1
页
共
20
页
HANDESET Programmers Guide
洪林整理
4 The AG on receiving this acceptance routes the audio data from the network to HS.
Outgoing call
1
An user dials a number using a cellular phone (AG).
2 Upon successful connection, the user by pressing a button on the HS initiates a transfer
of the audio data from the cell phone to the HS.
Note:
1
Headset's typically have a user interface by which intentions such as call accept, call
transfer are indicated to the AG.
2 The word button used above is a simile for any such user interface
3
IMPORTANT
: Although the word call is frequently used in this document, it shall be read
as 'Audio connection'. This is because the AG may treat the HS as the input or output audio
port for purposes other than call processing (such as tunes, beeps, alarms, etc..).
2.2
控制路径和数据路径
1, A Control path typically transmits commands and responses relating to a profile and the Data path is
typically used to transmit voice data
2A Control path should be established prior to the establishment of the Data path.
3 The existence of a Data path is optional
4. In the context of the Headset profile commands and responses relating to call acceptance, audio data
transfer, volume control etc.. are exchanged between the AG and HS over the Control path and the Data
path is used to transfer audio (voice) data between the AG and the HS
2.3
MODULE
The profile implementation consists of three modules. These are outlined below
.
This provides the serial port interface that both HS and AG use to
SPChannel
establish/release Control and Data paths. (See SPChannel
programmers guide for details).
Implementation of the HS portion of the profile; used by applications
Headset (HS)
residing on the HS.
Implementation of the AG portion of the profile; used by applications
Audio-Gateway (AG)
residing on the AG.
第
2
页
共
20
页
HANDESET Programmers Guide
洪林整理
2.4
Application state
The Headset API is stateless in nature. This means that the application has to keep track of
states.
The possible states of an application (with respect to the Headset profile) are typically
State
NOT
CONNECTED
CONNECTED
IN_CALL
Description
Here the Control path is not established.
Here the Control path is established but the Data path
is not.
The Data path is also established here and is being used
to stream voice the AG to the HS.
2.5
Establishment and release of
Control and Data paths
The following matrix specifies the correlation between the Control/Data paths and the roles
as per the Headset profile specification.
Action
Control
Data
Establish
HS or AG
AG
Release
AG
AG
Path
第
3
页
共
20
页
HANDESET Programmers Guide
洪林整理
i.e.
1 The Control path can be established either by the HS or AG while its release can be
performed only by the AG.
2 The Data path can be established and released only by the AG
2.6
SPChannel API
The SPChannel API that provides a means to establish and release Control and Data paths is used by
the
Headset
API.
The
reader
is
recommended
to
read
the
SPChannel
programmers
guide
before
proceeding further.
2.7
Headset API usage
From the HS end
H
S initialization
T
o accept an incoming call.
T
o transfer the call from the AG to the HS.
T
o terminate the call.
T
o notify AG about speaker and microphone volume levels.
P
roprietary commands
H
S un- initialization
Note that the HS initialization and un-initialization are not necessarily requirements but have
been included here for the sake of completeness of the API usage.
From the AG end
A
G initialization
T
o notify the HS of an incoming call.
T
o transfer the call from the HS to the AG.
T
o control the speaker and microphone volume levels of the HS.
P
roprietary unsolicited result codes
A
G un-initialization
2.8
Button press handling
The Headset specification uses the word 'User initiated action' to mean an indication received
from the user (typically a button press, or a GUI click etc..) to perform a suitable action. The
第
4
页
共
20
页
HANDESET Programmers Guide
洪林整理
suitable action in the context HS in the Headset specification is either a call accept, call
transfer or call terminate. Thus the same 'User initiated action' that is conveyed by the HS to
the AG is interpreted differently. This is based on the states of the HS and AG applications that
are currently interaction with each other.
The HS_SendButtonPress function of the HS API is used to model this 'Use initiated action'.
We shall now look at what it means to handle the button press at the
Headset end and
Gateway end
3.
Requirements
The requirements on the HS and AG units of this profile are stated in the table below.
Requirement
Incoming audio connection
Outgoing audio connection
Audio connection transfer
Remote audio volume control
Description
Ability to establish a connection in order to treat the
HS as an output audio port of the AG.
Ability to establish a connection in order to treat the
HS as an input audio port of the AG.
Transferring the audio between the HS and AG.
Ability of the AG to adjust the volume level on the HS.
4.
API Usage
This section presents the usage of headset (HS and AG) API function. Example use case
scenarios are presented here to highlight API usage.
4.1
Usage of HS API
The usage of the HS API is presented in the following sections.
第
5
页
共
20
页
HANDESET Programmers Guide
洪林整理
4.1.1
H
S initialization
The HS application must first initialize the HS profile. This is done as follows:
E
stablish a SPChannel Control path
U
se the active (established) SPChannel handle to create (initialize) the HS_Handle.
T
his HF_Handle will be used in all the other calls of the HS API.
N
ote that whether the application is listening or connecti
ng, successful establishment of a
Control path will be indicated using the spchannel_open_cfm callback.
4.1.2
T
o accept an incoming call (I)
Here we present the case on how the HS accepts an incoming call.
This is accomplished as follows:
H
S waits for an incoming Control path establishment by the AG.
H
S receives the RING code on the Control path that
i
ndicates that the HS could perform a local ring on the headphone
t
hat there is a incoming call
U
ser at HS presses a button to signal call acceptance of the incoming call. This signal is sent
to the AG.
H
S receives a confirmation (response) from the AG for the call accept.
H
S receives a Data path establishment indication (the Data path being initiated by the AG).
V
oice data is received on the Data path and rendered on the headphone appropriately.
第
6
页
共
20
页
HANDESET Programmers Guide
洪林整理
4.1.3
T
o accept an incoming call (II)
Here we present another case by which the HS accepts an incoming call.
This is accomplished as follows:
H
S waits for an incoming Control path establishment by the AG.
H
S receives the RING code on the Control path that
i
ndicates that the HS could perform a local ring on the headphone
t
hat there is a incoming call
H
S receives a Data path establishment indication (the Data path being initiated by the AG).
A
ring tone
is communicated by the AG to the HS using a
in- band
signal on the Data path
established earlier.
U
ser at HS presses a button to signal acceptance of the incoming call. This signal is sent to
the AG.
H
S receives a confirmation from the AG for the call accept sent via the button press at HS.
V
oice data is received on the Data path and rendered on the headphone appropriate
ly.
第
7
页
共
20
页
HANDESET Programmers Guide
洪林整理
4.1.4
C
all transfer from AG to HS
Here we present a case by which the HS transfers a call from the AG to itself (when the call
was being attended at the AG). This is accomplished as follows:
U
ser at HS presses a button to signal acceptance of the call. This causes the following
things to happen.
H
S initiates a Control path establishment to the AG.
A
fter which the button press is communicated to the AG.
T
he AG responds to the button press indication with a positive response.
H
S then receives a Data path establishment indication (the Data path being initiated by the
AG.
V
oice data is received on the Data path and rendered on the headphone appropriately.
第
8
页
共
20
页
HANDESET Programmers Guide
洪林整理
4.1.5
C
all termination
Given that the Control path and Data path have been established and voice data is streaming
from the AG to the HS via the Data path; the HS can terminate the call as follows:
U
ser presses the button, this leads to the button press command being sent from the HS to
the AG
U
pon reception of positive confirmation, the HS waits for the AG to
r
elease the Data path
r
elease the Control path
第
9
页
共
20
页
HANDESET Programmers Guide
洪林整理
4.1.6
T
o notify AG about current volume levels
The HS typically informs the AG of the volume levels of the speaker and microphone soon
after the establishment of the Control path as follows:
I
ssue the command intimating the AG of the current speaker volume level.
R
eceive a confirmation for the same from the AG.
第
10
页
共
20
页
lior-自杀死
lior-自杀死
lior-自杀死
lior-自杀死
lior-自杀死
lior-自杀死
lior-自杀死
lior-自杀死
本文更新与2021-01-19 09:52,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/531890.html