pub enum HeadsetGainRequest {
SetSpeakerGain {
requested: u8,
control_handle: HeadsetGainControlHandle,
},
WatchSpeakerGain {
responder: HeadsetGainWatchSpeakerGainResponder,
},
SetMicrophoneGain {
requested: u8,
control_handle: HeadsetGainControlHandle,
},
WatchMicrophoneGain {
responder: HeadsetGainWatchMicrophoneGainResponder,
},
}
Expand description
Control Headset Speaker and Microphone gain and receive reports of current values as specified in HFP v1.8, Section 4.29. This protocol is served by the Hfp service.
Gain is represented as an absolute value on a scale from 0 to 15. 0 is the minimum gain and 15 is the maximum gain. It is related to a particular (implementation dependent) volume level controlled by the Headset.
Epitaphs:
This channel will be closed with a ZX_ERR_ALREADY_BOUND
epitaph if there
is already an active HeadsetGain
channel.
This channel will be closed with a ZX_ERR_NOT_SUPPORTED
epitaph if the Hfp
service is not configured to support remote volume control or the peer
headset does not support remote volume control. If the channel is closed
with this error, the client should not attempt to reopen it using the
PeerHandler::GainControl
request on the same PeerHandler connection.
This channel will be closed with a ZX_ERR_INVALID_ARGUMENT
epitaph if
invalid arguments are passed to requests. See documentation on specific
requests for more details.
Variants§
SetSpeakerGain
Make a request to the headset to set the speaker gain to requested
.
requested
must be in the range [0-15] inclusive. Any values outside of
this range will result in the channel closing with a
ZX_ERR_INVALID_ARGUMENT
epitaph.
WatchSpeakerGain
Hanging get to watch for updates to the headset speaker gain. Responses represent the current gain value that is set.
The returned gain
value will always be in the range [0-15] inclusive.
Fields
responder: HeadsetGainWatchSpeakerGainResponder
SetMicrophoneGain
Make a request to the Headset to set the microphone gain to requested
.
requested
must be in the range [0-15] inclusive. Any values outside of
this range will result in the channel closing with a
ZX_ERR_INVALID_ARGUMENT
epitaph.
WatchMicrophoneGain
Hanging get to watch for updates to the headset microphone gain. Responses represent the current gain value that is set.
The returned gain
value will always be in the range [0-15] inclusive.
Fields
responder: HeadsetGainWatchMicrophoneGainResponder
Implementations§
Source§impl HeadsetGainRequest
impl HeadsetGainRequest
pub fn into_set_speaker_gain(self) -> Option<(u8, HeadsetGainControlHandle)>
pub fn into_watch_speaker_gain( self, ) -> Option<HeadsetGainWatchSpeakerGainResponder>
pub fn into_set_microphone_gain(self) -> Option<(u8, HeadsetGainControlHandle)>
pub fn into_watch_microphone_gain( self, ) -> Option<HeadsetGainWatchMicrophoneGainResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL