<?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 — Issue with Exponent...]]></title>
		<link>https://swforum.seekye.com/topic/10137/</link>
		<atom:link href="https://swforum.seekye.com/feed/rss/topic/10137/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Issue with Exponent....]]></description>
		<lastBuildDate>Fri, 20 Dec 2019 18:57:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Issue with Exponent...]]></title>
			<link>https://swforum.seekye.com/post/13102/#p13102</link>
			<description><![CDATA[<p>Hi again -</p><p>Apologies for the long delay in replying...but got sidetracked on a different project and lost access to the UPS that was exhibiting the issue and just got back to it today.</p><p>The break was good though, because I took a fresh look at the changes you made and I&#039;m no longer able to reproduce the exception.&nbsp; I then tried it with the old version and got the exception, so your edits fixed the issue.</p><p>When do you think you might be able to update the Nuget Package version?</p><p>Kind regards -</p><p>John</p>]]></description>
			<author><![CDATA[null@example.com (johnbizios)]]></author>
			<pubDate>Fri, 20 Dec 2019 18:57:26 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13102/#p13102</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue with Exponent...]]></title>
			<link>https://swforum.seekye.com/post/13101/#p13101</link>
			<description><![CDATA[<p>Could you give me a stack trace for that? The new version shouldn&#039;t call DecodeExponent for values outside that range. (Assuming it&#039;s being called from ParseMainData.)</p>]]></description>
			<author><![CDATA[null@example.com (Zer)]]></author>
			<pubDate>Thu, 21 Nov 2019 18:54:45 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13101/#p13101</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue with Exponent...]]></title>
			<link>https://swforum.seekye.com/post/13100/#p13100</link>
			<description><![CDATA[<p>Hi James again -</p><p>Apologies, but I tested your fix on a different UPS device that was not reporting the UnitExponent as a -1.</p><p>When I plugged in my other UPS that had the -1, your code did not work.</p><p>The issue is in the method:</p><p> public static int DecodeExponent(uint value)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (value &gt; 15) { throw new ArgumentOutOfRangeException(&quot;value&quot;, &quot;Value range is [0, 15].&quot;); }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return value &gt;= 8 ? (int)value - 16 : (int)value;<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>The parameter is a uint value,&nbsp; which when it comes in as a -1 makes it &gt; 15 and throws the exception.</p><p>Not sure if this is what you intended.</p><p>Thanks again for looking into this.</p><p>... john ...</p>]]></description>
			<author><![CDATA[null@example.com (johnbizios)]]></author>
			<pubDate>Thu, 21 Nov 2019 18:03:42 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13100/#p13100</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue with Exponent...]]></title>
			<link>https://swforum.seekye.com/post/13099/#p13099</link>
			<description><![CDATA[<p>Hi James -</p><p>Thanks for this.&nbsp; It does fix my error.</p><p>When do you expect to update the NUGET package to reflect this edit?</p><p>Kind regards -</p><p>... john ...</p>]]></description>
			<author><![CDATA[null@example.com (johnbizios)]]></author>
			<pubDate>Thu, 21 Nov 2019 14:30:21 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13099/#p13099</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue with Exponent...]]></title>
			<link>https://swforum.seekye.com/post/13097/#p13097</link>
			<description><![CDATA[<p>It indicates that the integer value read should be multiplied by 0.1 to get the physical value.</p><p>Looking into this, there is an ambiguity in the USB HID specification and it sounds like your device takes the alternate interpretation from HIDSharp. I&#039;ve added handling for that alternative interpretation. Please try this version of HIDSharp and see if it fixes your problem:</p><p><a href="https://www.zer7.com/files/oss/hidsharp/HIDSharp_test_2019-11-20.zip">https://www.zer7.com/files/oss/hidsharp … -11-20.zip</a></p><p>Thanks!</p><p>James</p>]]></description>
			<author><![CDATA[null@example.com (Zer)]]></author>
			<pubDate>Thu, 21 Nov 2019 03:18:22 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13097/#p13097</guid>
		</item>
		<item>
			<title><![CDATA[Issue with Exponent...]]></title>
			<link>https://swforum.seekye.com/post/13096/#p13096</link>
			<description><![CDATA[<p>Hi -</p><p>I&#039;ve run into an issue retrieving the ReportDescriptor from a UPS device.&nbsp; HidSharp throws an exception of:</p><p>ArgumentOutOfRangeException(&quot;value&quot;, &quot;Value range is [0, 15] </p><p>in the method DecodeExponent.</p><p>When I step into the code, I see that the value being passed in is 0xFFFFFFFF (4294967295)</p><p>If I modify the code that validates the value to ignore the check for a valid range for the exponent, all the other values in the returned ReportDescriptor look valid.&nbsp; And I get good values for Exponent in other reports.</p><p>As I&#039;m new to HID and trying to understand, was curious as to what a -1 for Unit Exponent might indicate. I&#039;m assuming it&#039;s an undefined value and if I use a tool like USBlyzer and look at the HID Report Descriptor it returns, there is no value for Unit but it does not throw an exception.</p><p>Any help or information anyone could provide would be greatly appreciated.</p><p>Thanks in advance.</p>]]></description>
			<author><![CDATA[null@example.com (johnbizios)]]></author>
			<pubDate>Tue, 12 Nov 2019 23:48:13 +0000</pubDate>
			<guid>https://swforum.seekye.com/post/13096/#p13096</guid>
		</item>
	</channel>
</rss>
