forked from Elara6331/infinitime
Power on bluetooth as part of setup
This commit is contained in:
parent
745b4bd37c
commit
dbfe8bb8c4
10
btsetup.go
10
btsetup.go
@ -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"
|
||||||
)
|
)
|
||||||
@ -13,11 +15,13 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user