From 0687ec31d1d75500beaee0e983ebf73d7c4517f7 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 20 Oct 2025 19:51:19 +0200 Subject: main: Accept audio connections This is a jukebox after all, this is what we want. --- src/main.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 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); } -- cgit v1.2.3-70-g09d2