From 52b85ab3618c67aab20b79ab8ce569421a3e8f8c Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Mon, 2 May 2022 20:17:38 -0700 Subject: [PATCH] Allow changing bluetooth adapter ID --- config.go | 2 ++ go.mod | 2 +- go.sum | 4 ++-- itd.toml | 3 +++ main.go | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 405dce5..e0eccc4 100644 --- a/config.go +++ b/config.go @@ -55,6 +55,8 @@ func cfgWatch(provider *file.File) { func setCfgDefaults() { k.Load(confmap.Provider(map[string]interface{}{ + "bluetooth.adapter": "hci0", + "socket.path": "/tmp/itd/socket", "conn.reconnect": true, diff --git a/go.mod b/go.mod index 3168ab2..3bf0fee 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/mozillazg/go-pinyin v0.19.0 github.com/rs/zerolog v1.26.1 github.com/urfave/cli/v2 v2.3.0 - go.arsenm.dev/infinitime v0.0.0-20220424030849-6c3f1b14c948 + go.arsenm.dev/infinitime v0.0.0-20220503031446-5e5eef15dc4c go.arsenm.dev/lrpc v0.0.0-20220502232450-5e99a660073e golang.org/x/text v0.3.7 ) diff --git a/go.sum b/go.sum index adb6b25..cdc7c99 100644 --- a/go.sum +++ b/go.sum @@ -198,8 +198,8 @@ github.com/yuin/goldmark v1.3.8/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.arsenm.dev/infinitime v0.0.0-20220424030849-6c3f1b14c948 h1:OX1SyEIFz4ae2z468lBQvRTNRvqLEwjfJ8lcssUH5+w= -go.arsenm.dev/infinitime v0.0.0-20220424030849-6c3f1b14c948/go.mod h1:1cBQ3fp6QlRbSqu9kEBAHsVThINj31FtqHIYVsQ7wgg= +go.arsenm.dev/infinitime v0.0.0-20220503031446-5e5eef15dc4c h1:N743kUJJVRQ5wsK6/fJMA3fLordceti3WACEnI0EZ+I= +go.arsenm.dev/infinitime v0.0.0-20220503031446-5e5eef15dc4c/go.mod h1:1cBQ3fp6QlRbSqu9kEBAHsVThINj31FtqHIYVsQ7wgg= go.arsenm.dev/lrpc v0.0.0-20220502232450-5e99a660073e h1:JFnaJK9Ew6u+qpUfapjmlZL0wX64PfqcGnlLMjVdRng= go.arsenm.dev/lrpc v0.0.0-20220502232450-5e99a660073e/go.mod h1:3Apd8bykiyd+L+bR/ANzT/CbVn60a5vM6zsH9jSp59U= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/itd.toml b/itd.toml index 4e3385e..e246aed 100644 --- a/itd.toml +++ b/itd.toml @@ -1,3 +1,6 @@ +[bluetooth] + adapter = "hci0" + [socket] path = "/tmp/itd/socket" diff --git a/main.go b/main.go index abdf3fe..8f5deee 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,7 @@ func main() { } // Initialize infinitime library - infinitime.Init() + infinitime.Init(k.String("bluetooth.adapter")) // Cleanly exit after function defer infinitime.Exit()