Skip to content

Commit c35174e

Browse files
ZipFiledeadprogram
authored andcommitted
windows: Fix Notify/Indicate characteristics detection
1 parent 0d1c723 commit c35174e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gattc_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@ func (c DeviceCharacteristic) Read(data []byte) (int, error) {
374374
// Configuration Descriptor (CCCD). And it favors Notify over Indicate.
375375
func (c DeviceCharacteristic) EnableNotifications(callback func(buf []byte)) error {
376376
var err error
377-
if c.properties&genericattributeprofile.GattCharacteristicPropertiesNotify == 0 {
377+
if c.properties&genericattributeprofile.GattCharacteristicPropertiesNotify != 0 {
378378
err = c.EnableNotificationsWithMode(NotificationModeNotify, callback)
379-
} else if c.properties&genericattributeprofile.GattCharacteristicPropertiesIndicate == 0 {
379+
} else if c.properties&genericattributeprofile.GattCharacteristicPropertiesIndicate != 0 {
380380
err = c.EnableNotificationsWithMode(NotificationModeIndicate, callback)
381381
} else {
382382
return errNoNotifyOrIndicate

0 commit comments

Comments
 (0)