Skip to main content

OH_AudioDeviceDescriptor_GetDeviceRole

Function OH_AudioDeviceDescriptor_GetDeviceRole 

Source
pub unsafe extern "C" fn OH_AudioDeviceDescriptor_GetDeviceRole(
    audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
    deviceRole: *mut OH_AudioDevice_Role,
) -> OH_AudioCommon_Result
Available on crate feature api-12 only.
Expand description

Query the device role of the target audio device descriptor.

§Arguments

  • audioDeviceDescriptor - reference returned by [OH_AudioRoutingManager_GetDevices] or [OH_AudioRouterManager_OnDeviceChangedCallback].

  • deviceRole - the pointer [OH_AudioDevice_DeviceRole] variable that will be set the device role value.

§Returns

  • [#AUDIOCOMMON_RESULT_SUCCESS] or [#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM].

Available since API-level: 12