pub struct AudioSourceControlHandler { /* private fields */ }Expand description
Implementation of the logic for Audio Control requests (e.g., volume, mute)
Implementations§
Source§impl AudioSourceControlHandler
impl AudioSourceControlHandler
Sourcepub fn new(
sample_rates: &'static [u32],
ep_audio_addr: EndpointAddress,
ep_feedback_addr: EndpointAddress,
iface_ctrl_num: InterfaceNumber,
iface_stream_num: InterfaceNumber,
) -> Self
pub fn new( sample_rates: &'static [u32], ep_audio_addr: EndpointAddress, ep_feedback_addr: EndpointAddress, iface_ctrl_num: InterfaceNumber, iface_stream_num: InterfaceNumber, ) -> Self
Create a new AudioSourceControlHandler
Sourcepub fn get_audio_ep_addr(&self) -> u8
pub fn get_audio_ep_addr(&self) -> u8
Gets the audio endpoint address
Sourcepub fn get_feedback_ep_addr(&self) -> u8
pub fn get_feedback_ep_addr(&self) -> u8
Gets the feedback endpoint address
Sourcepub fn get_audio_ep_index(&self) -> usize
pub fn get_audio_ep_index(&self) -> usize
Gets the index part of the audio endpoint address
Sourcepub fn get_feedback_ep_index(&self) -> usize
pub fn get_feedback_ep_index(&self) -> usize
Gets the index part of the feedback endpoint address
Sourcepub fn get_ctrl_iface_num(&self) -> u8
pub fn get_ctrl_iface_num(&self) -> u8
Gets the bInterfaceNumber of the control interface
Sourcepub fn get_stream_iface_num(&self) -> u8
pub fn get_stream_iface_num(&self) -> u8
Gets the bInterfaceNumber of the streaming interface
Trait Implementations§
Source§impl<'d> Handler for AudioSourceControlHandler
impl<'d> Handler for AudioSourceControlHandler
Source§fn addressed(&mut self, addr: u8)
fn addressed(&mut self, addr: u8)
Called when the host has set the address of the device to addr.
Source§fn configured(&mut self, configured: bool)
fn configured(&mut self, configured: bool)
Called when the host has enabled or disabled the configuration of the device.
Source§fn remote_wakeup_enabled(&mut self, enabled: bool)
fn remote_wakeup_enabled(&mut self, enabled: bool)
Called when remote wakeup feature is enabled or disabled.
Source§fn set_alternate_setting(
&mut self,
iface: InterfaceNumber,
alternate_setting: u8,
)
fn set_alternate_setting( &mut self, iface: InterfaceNumber, alternate_setting: u8, )
Called when a “set alternate setting” control request is done on the interface.
Source§fn suspended(&mut self, suspended: bool)
fn suspended(&mut self, suspended: bool)
Called when the bus has entered or exited the suspend state.
Source§fn control_out(&mut self, req: Request, buf: &[u8]) -> Option<OutResponse>
fn control_out(&mut self, req: Request, buf: &[u8]) -> Option<OutResponse>
Called when a control request is received with direction HostToDevice.
Source§fn control_in<'a>(
&'a mut self,
req: Request,
buf: &'a mut [u8],
) -> Option<InResponse<'a>>
fn control_in<'a>( &'a mut self, req: Request, buf: &'a mut [u8], ) -> Option<InResponse<'a>>
Called when a control request is received with direction DeviceToHost.