The API has:
func (c DeviceCharacteristic) EnableNotifications(callback func(buf []byte)) error {
ch, err := c.characteristic.WatchProperties()
if err != nil {
return err
}
go func() {
for update := range ch {
if update.Interface == "org.bluez.GattCharacteristic1" && update.Name == "Value" {
callback(update.Value.([]byte))
}
}
}()
return c.characteristic.StartNotify()
}
But I do not see a way to call StopNotify()
Wouldn't EnableNotifications(..) not keep creating duplicate events? when calling EnableNotifications(...)
Added to it, I though also Confirm(..) if I do not confirm it looks like I receive duplicate messages in the byte array of EnableNotifications(..)