File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -262,18 +262,17 @@ func (c DeviceCharacteristic) EnableNotifications(callback func(buf []byte)) err
262
262
if sig .Name == "org.freedesktop.DBus.Properties.PropertiesChanged" {
263
263
interfaceName := sig .Body [0 ].(string )
264
264
265
- if interfaceName == "org.bluez.Device1" && sig .Path == devicePath {
265
+ switch {
266
+ case interfaceName == "org.bluez.Device1" && sig .Path == devicePath :
266
267
changes := sig .Body [1 ].(map [string ]dbus.Variant )
267
268
268
269
if connected , ok := changes ["Connected" ].Value ().(bool ); ok && ! connected {
269
270
c .EnableNotifications (nil )
270
271
return
271
272
}
272
- } else if interfaceName != "org.bluez.GattCharacteristic1" {
273
+ case interfaceName != "org.bluez.GattCharacteristic1" :
273
274
continue
274
- }
275
-
276
- if sig .Path != c .characteristic .Path () {
275
+ case sig .Path != c .characteristic .Path ():
277
276
continue
278
277
}
279
278
You can’t perform that action at this time.
0 commit comments