From fa5072b1b0e6dcd45d0d59416db5eee71a6527d9 Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Thu, 9 Sep 2021 08:34:56 -0700 Subject: [PATCH] Power on bluetooth as part of setup --- btsetup.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/btsetup.go b/btsetup.go index 1da97b0..8395224 100644 --- a/btsetup.go +++ b/btsetup.go @@ -1,6 +1,8 @@ package infinitime import ( + "os/exec" + bt "github.com/muka/go-bluetooth/api" "github.com/muka/go-bluetooth/bluez/profile/adapter" ) @@ -13,11 +15,13 @@ func init() { if err != nil { panic(err) } - + + // Power on command (workaround as go-bluetooth does not have a power on function) + exec.Command("bluetoothctl", "power", "on").Start() + defaultAdapter = da } - func Exit() error { return bt.Exit() -} \ No newline at end of file +}