Skip to content

EnableNotifications calls StartNotify, but there is no StopNotify ?? #106

@rvt

Description

@rvt

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(..)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions