Created
May 30, 2020 15:58
-
-
Save anisbhsl/2737bf3d2d9b113774820dfd2379d6ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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