muka/go-bluetooth

bluez 5.63 requires advertisements set Min and Max intervals.

james-lawrence opened this issue · 0 comments

bluez 5.63 emits the following error followed by a seg fault if the advertisement doesn't have a min interval specified.

Mar 06 13:36:16 bluetoothd[144262]: src/advertising.c:parse_advertisement() Error parsing MinInterval property

hack patch I added to fix it locally not a great solution but API doesn't seem to expose a way to actually configure the advertisement.

git diff ../vendor/github.com/muka/go-bluetooth/api/service/app.go
diff --git a/vendor/github.com/muka/go-bluetooth/api/service/app.go b/vendor/github.com/muka/go-bluetooth/api/service/app.go
index 0012727..20d679d 100644
--- a/vendor/github.com/muka/go-bluetooth/api/service/app.go
+++ b/vendor/github.com/muka/go-bluetooth/api/service/app.go
@@ -58,7 +58,9 @@ func NewApp(options AppOptions) (*App, error) {
        )
 
        app.advertisement = &advertising.LEAdvertisement1Properties{
-               Type: advertising.AdvertisementTypePeripheral,
+               Type:        advertising.AdvertisementTypePeripheral,
+               MinInterval: 1000,
+               MaxInterval: 1000,
        }
 
        if app.Options.AgentCaps == "" {