File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 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
262262 if sig .Name == "org.freedesktop.DBus.Properties.PropertiesChanged" {
263263 interfaceName := sig .Body [0 ].(string )
264264
265- if interfaceName == "org.bluez.Device1" && sig .Path == devicePath {
265+ switch {
266+ case interfaceName == "org.bluez.Device1" && sig .Path == devicePath :
266267 changes := sig .Body [1 ].(map [string ]dbus.Variant )
267268
268269 if connected , ok := changes ["Connected" ].Value ().(bool ); ok && ! connected {
269270 c .EnableNotifications (nil )
270271 return
271272 }
272- } else if interfaceName != "org.bluez.GattCharacteristic1" {
273+ case interfaceName != "org.bluez.GattCharacteristic1" :
273274 continue
274- }
275-
276- if sig .Path != c .characteristic .Path () {
275+ case sig .Path != c .characteristic .Path ():
277276 continue
278277 }
279278
You can’t perform that action at this time.
0 commit comments