summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-10-20 19:51:19 +0200
committerJoel Klinghed <the_jk@spawned.biz>2025-10-20 21:28:27 +0200
commit0687ec31d1d75500beaee0e983ebf73d7c4517f7 (patch)
tree4fdb1cdb8df7dd08ca54b5ef3f1274020c96a236 /src
parent61150560765e2875d83fed69248d0898d39604f5 (diff)
main: Accept audio connections
This is a jukebox after all, this is what we want.
Diffstat (limited to 'src')
-rw-r--r--src/main.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc
index 5a6f86e..ce20aee 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -280,8 +280,22 @@ class BluetoothManagerDelegate : public bt::Manager::Delegate, public Api {
void agent_authorize_service(bt::Device& device, std::string const& uuid,
std::function<void(bool)> callback) override {
- logger_.dbg(std::format("Device request authorize service: {} {}",
+ if (uuid == "0000110d-0000-1000-8000-00805f9b34fb") {
+ // Advanced Audio Distribution Profile
+ callback(true);
+ return;
+ }
+ if (uuid == "0000111e-0000-1000-8000-00805f9b34fb") {
+ // Hands-Free Service Class and Profile
+ // Not interrested.
+ callback(false);
+ return;
+ }
+
+ logger_.dbg(std::format("Device request authorize unknown service: {} {}",
device.name(), uuid));
+
+ // Do not authorize unknown services.
callback(false);
}