<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[James's Programming Page — About HIDSharp V2.0.5 work on Mac system]]></title>
	<link rel="self" href="https://swforum.seekye.com/feed/atom/topic/10112/" />
	<updated>2018-12-17T08:55:11Z</updated>
	<generator>PunBB</generator>
	<id>https://swforum.seekye.com/topic/10112/</id>
		<entry>
			<title type="html"><![CDATA[Re: About HIDSharp V2.0.5 work on Mac system]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13015/#p13015" />
			<content type="html"><![CDATA[<p>For example, No.1 serial number is&nbsp; 0x11111. and No.2 serial number is 0x22222;&nbsp; when I plug No.2 HID device(move No1 HID device), the HIDsharp api still get No.1 device serial number:0x111111, not the latest serial number:ox22222</p>]]></content>
			<author>
				<name><![CDATA[andy.he]]></name>
				<uri>https://swforum.seekye.com/user/14231/</uri>
			</author>
			<updated>2018-12-17T08:55:11Z</updated>
			<id>https://swforum.seekye.com/post/13015/#p13015</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[About HIDSharp V2.0.5 work on Mac system]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13014/#p13014" />
			<content type="html"><![CDATA[<p>Sir,<br />&nbsp; &nbsp; We design one type HID device using at WIN and Mac system both;&nbsp; &nbsp;I have No.1 and No.2 HID device with different serial number,&nbsp; at windows platform when we plug and unplug HID, the operation system internal can be refreshed in time, so I can always get right serial number. But mac system is something difference, when I replace No1 with No2 Hid Device, the operation system already refresh device list, but HIDsharp related api can not get the latest one even I add list.changed.<br />Could you give me some advice on how to fix?<br />&nbsp; &nbsp;Thanks in advance</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DeviceList list = DeviceList.Local;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; list.Changed += (sender, e) =&gt; Console.Write(&quot;Device list changed.\n&quot;);&nbsp; &nbsp;//20181217<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HidDevice[] hidDeviceList = list.GetHidDevices().ToArray();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&lt;string&gt; arraylist = new List&lt;string&gt;();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arraylist.Clear(); //Clear buffer<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (HidDevice onehid in hidDeviceList)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( onehid.VendorID == 0x0483 &amp;&amp; onehid.ProductID == 0x5710)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arraylist.Add(onehid.GetSerialNumber());&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (arraylist.Count() == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw new Exception(&quot;not found device&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return arraylist.ToArray();</p>]]></content>
			<author>
				<name><![CDATA[andy.he]]></name>
				<uri>https://swforum.seekye.com/user/14231/</uri>
			</author>
			<updated>2018-12-17T08:51:18Z</updated>
			<id>https://swforum.seekye.com/post/13014/#p13014</id>
		</entry>
</feed>
