• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #pragma once
2 
3 /***
4   This file is part of PulseAudio.
5 
6   Copyright 2022 Dylan Van Assche <me@dylanvanassche.be>
7 
8   PulseAudio is free software; you can redistribute it and/or modify
9   it under the terms of the GNU Lesser General Public License as
10   published by the Free Software Foundation; either version 2.1 of the
11   License, or (at your option) any later version.
12 
13   PulseAudio is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   General Public License for more details.
17 
18   You should have received a copy of the GNU Lesser General Public
19   License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
20 ***/
21 
22 #include "bluez5-util.h"
23 
24 #define UPOWER_SERVICE "org.freedesktop.UPower"
25 #define UPOWER_DEVICE_INTERFACE ".Device"
26 #define UPOWER_DISPLAY_DEVICE_OBJECT "/org/freedesktop/UPower/devices/DisplayDevice"
27 
28 struct pa_upower_backend {
29     pa_core *core;
30     pa_dbus_connection *connection;
31     pa_bluetooth_discovery *discovery;
32     unsigned int battery_level;
33 
34     PA_LLIST_HEAD(pa_dbus_pending, pending);
35 };
36 
37 pa_upower_backend *pa_upower_backend_new(pa_core *c, pa_bluetooth_discovery *d);
38 void pa_upower_backend_free(pa_upower_backend *backend);
39 unsigned int pa_upower_get_battery_level(pa_upower_backend *backend);
40