mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-18 22:05:37 -05:00
bluetooth: Provide (HSP/HFP-received) battery level as device property
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/482>
This commit is contained in:
parent
d2c97190ef
commit
c667befe9a
4 changed files with 42 additions and 0 deletions
|
|
@ -64,6 +64,7 @@ typedef struct pa_bluetooth_backend pa_bluetooth_backend;
|
|||
typedef enum pa_bluetooth_hook {
|
||||
PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED, /* Call data: pa_bluetooth_device */
|
||||
PA_BLUETOOTH_HOOK_DEVICE_UNLINK, /* Call data: pa_bluetooth_device */
|
||||
PA_BLUETOOTH_HOOK_DEVICE_BATTERY_LEVEL_CHANGED, /* Call data: pa_bluetooth_device */
|
||||
PA_BLUETOOTH_HOOK_TRANSPORT_STATE_CHANGED, /* Call data: pa_bluetooth_transport */
|
||||
PA_BLUETOOTH_HOOK_TRANSPORT_SOURCE_VOLUME_CHANGED, /* Call data: pa_bluetooth_transport */
|
||||
PA_BLUETOOTH_HOOK_TRANSPORT_SINK_VOLUME_CHANGED, /* Call data: pa_bluetooth_transport */
|
||||
|
|
@ -150,6 +151,9 @@ struct pa_bluetooth_device {
|
|||
pa_bluetooth_transport *transports[PA_BLUETOOTH_PROFILE_COUNT];
|
||||
|
||||
pa_time_event *wait_for_profiles_timer;
|
||||
|
||||
bool has_battery_level;
|
||||
uint8_t battery_level;
|
||||
};
|
||||
|
||||
struct pa_bluetooth_adapter {
|
||||
|
|
@ -197,6 +201,7 @@ void pa_bluetooth_transport_load_a2dp_sink_volume(pa_bluetooth_transport *t);
|
|||
|
||||
bool pa_bluetooth_device_any_transport_connected(const pa_bluetooth_device *d);
|
||||
bool pa_bluetooth_device_switch_codec(pa_bluetooth_device *device, pa_bluetooth_profile_t profile, pa_hashmap *capabilities_hashmap, const pa_a2dp_endpoint_conf *endpoint_conf, void (*codec_switch_cb)(bool, pa_bluetooth_profile_t profile, void *), void *userdata);
|
||||
void pa_bluetooth_device_report_battery_level(pa_bluetooth_device *d, uint8_t level);
|
||||
|
||||
pa_bluetooth_device* pa_bluetooth_discovery_get_device_by_path(pa_bluetooth_discovery *y, const char *path);
|
||||
pa_bluetooth_device* pa_bluetooth_discovery_get_device_by_address(pa_bluetooth_discovery *y, const char *remote, const char *local);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue