Skip to content

Instantly share code, notes, and snippets.

@anisbhsl
Created May 30, 2020 15:58
Show Gist options
  • Save anisbhsl/2737bf3d2d9b113774820dfd2379d6ee to your computer and use it in GitHub Desktop.
Save anisbhsl/2737bf3d2d9b113774820dfd2379d6ee to your computer and use it in GitHub Desktop.
package service
import (
"log"
"github.com/bettercap/gatt"
)
var (
attrGATTUUID = gatt.UUID16(0x1801)
attrServiceChangedUUID = gatt.UUID16(0x2A05)
)
func NewGattService() *gatt.Service {
s := gatt.NewService(attrGATTUUID)
s.AddCharacteristic(attrServiceChangedUUID).HandleNotifyFunc(
func(r gatt.Request, n gatt.Notifier) {
go func() {
log.Printf("TODO: indicate client when the services are changed")
}()
})
return s
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment