<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[James's Programming Page — DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
		<link>https://swforum.seekye.com/topic/10120/</link>
		<atom:link href="https://swforum.seekye.com/feed/rss/topic/10120/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in DeviceList.Local.Changed not triggered on Linux without modifications.]]></description>
		<lastBuildDate>Sat, 20 Jul 2019 21:20:20 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13078/#p13078</link>
			<description><![CDATA[<p>Try this:<br /><a href="https://www.zer7.com/files/oss/hidsharp/HIDSharp_test_2019-07-20.zip">https://www.zer7.com/files/oss/hidsharp … -07-20.zip</a></p>]]></description>
			<author><![CDATA[null@example.com (Zer)]]></author>
			<pubDate>Sat, 20 Jul 2019 21:20:20 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13078/#p13078</guid>
		</item>
		<item>
			<title><![CDATA[Re: DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13077/#p13077</link>
			<description><![CDATA[<p>Just on the possibility that this is Platform Invoke related, would you mind trying:</p><p>In Platform\Linux\NativeMethods.cs</p><p>change</p><p>public static extern int poll(pollfd[] fds, IntPtr nfds, int timeout);</p><p>to</p><p>public static extern int poll([In][Out] pollfd[] fds, IntPtr nfds, int timeout);</p>]]></description>
			<author><![CDATA[null@example.com (Zer)]]></author>
			<pubDate>Mon, 15 Jul 2019 14:34:36 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13077/#p13077</guid>
		</item>
		<item>
			<title><![CDATA[Re: DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13076/#p13076</link>
			<description><![CDATA[<p>`fds[0].revents` is always 0</p><p>So far I have only tested on x64, can try on ARM later.</p>]]></description>
			<author><![CDATA[null@example.com (timothyp)]]></author>
			<pubDate>Mon, 15 Jul 2019 02:48:23 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13076/#p13076</guid>
		</item>
		<item>
			<title><![CDATA[Re: DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13075/#p13075</link>
			<description><![CDATA[<p>Hmm. I am not encountering this problem on Linux Mint 19. (Are you running 32 or 64-bit? Which architecture?)</p><p>&quot;if (0 != (fds[0].revents &amp; NativeMethods.pollev.IN))&quot; runs in an endless loop? What is the value of fds[0].revents? Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (Zer)]]></author>
			<pubDate>Sat, 13 Jul 2019 13:52:57 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13075/#p13075</guid>
		</item>
		<item>
			<title><![CDATA[Re: DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13074/#p13074</link>
			<description><![CDATA[<p>So in my case revents always equals 0 in this check:</p><p>`if (0 != (fds[0].revents &amp; NativeMethods.pollev.IN))`</p><p>And if I remove this check, all is fine.</p><p>Also note that once a device is connected this code is executed in an endless loop,</p>]]></description>
			<author><![CDATA[null@example.com (timothyp)]]></author>
			<pubDate>Fri, 12 Jul 2019 02:56:47 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13074/#p13074</guid>
		</item>
		<item>
			<title><![CDATA[Re: DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13073/#p13073</link>
			<description><![CDATA[<p>Sorry to get back to this so late.<br />Was using my version so forgot about the issue.<br />Now I switched back to your latest version (since you solved some other issues)<br />and found that this issue still exists.</p>]]></description>
			<author><![CDATA[null@example.com (timothyp)]]></author>
			<pubDate>Fri, 12 Jul 2019 02:46:31 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13073/#p13073</guid>
		</item>
		<item>
			<title><![CDATA[Re: DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13044/#p13044</link>
			<description><![CDATA[<p>Very odd. What is revents returning for you, then?<br />Also, is it blocking in poll in your version, or blocking in udev_monitor_receive_device? Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (Zer)]]></author>
			<pubDate>Fri, 22 Mar 2019 16:33:06 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13044/#p13044</guid>
		</item>
		<item>
			<title><![CDATA[DeviceList.Local.Changed not triggered on Linux without modifications]]></title>
			<link>https://swforum.seekye.com/post/13043/#p13043</link>
			<description><![CDATA[<p>Without modification `DeviceList.Local.Changed` does not get triggered on Ubuntu 18.04</p><p>Filename: `LinuxHidManager.cs`<br />Line: ~69</p><p>This is the code in the current version</p><div class="codebox"><pre><code>if (0 != (fds[0].revents &amp; (NativeMethods.pollev.ERR | NativeMethods.pollev.HUP | NativeMethods.pollev.NVAL))) { break; }                       
if (0 != (fds[0].revents &amp; NativeMethods.pollev.IN))
{                                
    IntPtr device = NativeMethodsLibudev.Instance.udev_monitor_receive_device(monitor);
    if (device != null)
    {                                    
        NativeMethodsLibudev.Instance.udev_device_unref(device);
        DeviceList.Local.RaiseChanged();
    }
}</code></pre></div><p>The following line never returns true:</p><div class="codebox"><pre><code>if (0 != (fds[0].revents &amp; NativeMethods.pollev.IN))</code></pre></div><p>However, if I disable this check I get proper change notification and no exceptions.<br />Basically, the following version works:</p><div class="codebox"><pre><code>if (ret == 1)
{

    if (0 != (fds[0].revents &amp; (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();
    }
   
}</code></pre></div><br /><p>Do you see any issue with this? </p><p>PS: Again, it would be really great if you had an official git repo for this, it is such a useful project.</p>]]></description>
			<author><![CDATA[null@example.com (timothyp)]]></author>
			<pubDate>Tue, 19 Mar 2019 02:15:53 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13043/#p13043</guid>
		</item>
	</channel>
</rss>
