Topic: DeviceList.Local.Changed not triggered on Linux without modifications
Without modification `DeviceList.Local.Changed` does not get triggered on Ubuntu 18.04
Filename: `LinuxHidManager.cs`
Line: ~69
This is the code in the current version
if (0 != (fds[0].revents & (NativeMethods.pollev.ERR | NativeMethods.pollev.HUP | NativeMethods.pollev.NVAL))) { break; }
if (0 != (fds[0].revents & NativeMethods.pollev.IN))
{
IntPtr device = NativeMethodsLibudev.Instance.udev_monitor_receive_device(monitor);
if (device != null)
{
NativeMethodsLibudev.Instance.udev_device_unref(device);
DeviceList.Local.RaiseChanged();
}
}
The following line never returns true:
if (0 != (fds[0].revents & NativeMethods.pollev.IN))
However, if I disable this check I get proper change notification and no exceptions.
Basically, the following version works:
if (ret == 1)
{
if (0 != (fds[0].revents & (NativeMethods.pollev.ERR | NativeMethods.pollev.HUP | NativeMethods.pollev.NVAL))) { break; }
IntPtr device = NativeMethodsLibudev.Instance.udev_monitor_receive_device(monitor);
if (device != null)
{
NativeMethodsLibudev.Instance.udev_device_unref(device);
DeviceList.Local.RaiseChanged();
}
}
Do you see any issue with this?
PS: Again, it would be really great if you had an official git repo for this, it is such a useful project.