From 26dc6a8c8847248450bf902124b7cd867e027274 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 2 Mar 2022 16:48:04 -0500 Subject: Add Bluetooth enable Use the network API interface object to enable Bluetooth via ConnMan, thus deactivating the default rfkill state and persisting the new one across reboots (since ConnMan will restore the enabled state on boot). This used to be done in the agl-service-bluetooth binding, doing it here should be considered a likely temporary placeholder for further investigation into Bluetooth device management in future AGL releases. At the moment device auto-connection is not likely to match pre-Marlin releases unless a device manages to connect on its own versus the active auto-connect that was in agl-service-bluetooth. The latter is now dependent on this application being run until further re-architecting takes place. Bug-AGL: SPEC-4253 Signed-off-by: Scott Murray Change-Id: Ic18452a65345da82a27370a46fbc7121cbf85aea --- app/main.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/main.cpp b/app/main.cpp index 4c989ae..bf82588 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -66,7 +66,21 @@ int main(int argc, char *argv[]) } context->setContextProperty("bluetooth", new Bluetooth(true, context)); - context->setContextProperty("network", new Network(true, context)); + + // Use the network API interface to enable Bluetooth via ConnMan, thus + // deactivating the default rfkill state and persisting the new one across + // reboots (since ConnMan will restore the enabled state on boot). + // This used to be done in the agl-service-bluetooth binding, doing it + // here should be considered a likely temporary placeholder for further + // investigation into Bluetooth device management in future AGL releases. + // At the moment device auto-connection is not likely to match pre-Marlin + // releases unless a device manages to connect on its own versus the + // active auto-connect that was in agl-service-bluetooth. The latter is + // now dependent on this application being run until further re-architecting + // takes place. + Network *network = new Network(true, context); + network->power(true, QString("bluetooth")); + context->setContextProperty("network", network); engine.load(QUrl(QStringLiteral("qrc:/Settings.qml"))); -- cgit 1.2.3-korg