Power on bluetooth as part of setup

This commit is contained in:
Elara 2021-09-09 08:34:56 -07:00
parent df067d2c56
commit fa5072b1b0

View File

@ -1,6 +1,8 @@
package infinitime package infinitime
import ( import (
"os/exec"
bt "github.com/muka/go-bluetooth/api" bt "github.com/muka/go-bluetooth/api"
"github.com/muka/go-bluetooth/bluez/profile/adapter" "github.com/muka/go-bluetooth/bluez/profile/adapter"
) )
@ -14,10 +16,12 @@ func init() {
panic(err) panic(err)
} }
// Power on command (workaround as go-bluetooth does not have a power on function)
exec.Command("bluetoothctl", "power", "on").Start()
defaultAdapter = da defaultAdapter = da
} }
func Exit() error { func Exit() error {
return bt.Exit() return bt.Exit()
} }