<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>So, going with the proposed initial design, I created a report descriptor to describe the battery.  I thought that I’d then see how NUT responded to it.  The good news is that the descriptor showed up and all of the paths were correct.  Unfortunately, after that, nothing happened…no reports were requested, and it just kept timing out.  Is there some minimum amount of functionality I need to provide in this report descriptor in order for NUT to work correctly?  I assume it’s not requesting reports because there is nothing it wants to know about.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Here is what I have so far:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>USAGE_PAGE (Power Device)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>USAGE (UPS)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>COLLECTION (Application)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>  USAGE (BatterySystem)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>  COLLECTION (Physical)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_ID (1)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    USAGE (Voltage)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_SIZE (8)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_COUNT (1)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    UNIT (SI Lin:Volts)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    LOGICAL_MINIMUM (0)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    LOGICAL_MAXIMUM (255)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    FEATURE (Data,Var,Abs)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_ID (2)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    USAGE (Temperature)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_SIZE (8)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_COUNT (1)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    LOGICAL_MINIMUM (0)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    LOGICAL_MAXIMUM (255)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    UNIT (SI Lin:Temperature)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    FEATURE (Data,Var,Abs)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    USAGE_PAGE (Battery System)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_ID (3)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    USAGE (RemainingCapacity)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_SIZE (8)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    REPORT_COUNT (1)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    LOGICAL_MINIMUM (0)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    LOGICAL_MAXIMUM (100)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>    FEATURE (Data,Var,Abs)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>  END_COLLECTION<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>END_COLLECTION<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Nut-upsdev [mailto:nut-upsdev-bounces+rgroner=rtd.com@lists.alioth.debian.org] <b>On Behalf Of </b>Rob Groner<br><b>Sent:</b> Wednesday, March 12, 2014 10:48 AM<br><b>To:</b> nut-upsdev@lists.alioth.debian.org<br><b>Subject:</b> Re: [Nut-upsdev] Developing the UPS side of the UPS-NUT equation (via usbhid)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>The syntax is beginning (just beginning) to make sense to me now, so I’m looking now to try and implement just a few items in the report descriptor, and then I figured I can progress from there if all goes well. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The power HID docs seem to encourage drawing out your system first, and then letting the report descriptor flow from there.  So, my very simplified system goes like this:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>[Battery]===DC Flow </span><span style='font-family:Wingdings;color:#1F497D'>č</span><span style='color:#1F497D'>[Power Summary]<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>All of the drawings seem to end in a power summary, and the doc seemed to stress that it was essential to power management software being able to effectively use it, so I’ll include it.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I think I understand how the usages work now….they’re basically like establishing the namespace (like com.java.class, etc).  I had been confused before when I would see multiple usage() statements all following each other, but seeing it in the nut output as the path makes it more clear.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>So, pretty much everything should be under the UPS usage.  Then I would define things under the battery usage, then the flow usage, and then the power summary usage…right?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Where I’m still foggy is two things….first collections.  I’m pretty sure there’s supposed to be an application collection, and then I usually see a physical collection, but I’m still not completely understanding what their purpose is.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The second thing I still don’t understand is the minimum/maximum descriptors.  Ok, Logical min/max I get…that’s just the range of the actual value in the report…basically a way to indicate if it is unsigned or signed.  If you only have an 8 bit value specified, then I’d guess you can’t have a logical max greater than 255.  But physical min/max are a bit confusing.  Is it just a means of scaling or offsetting the logical value?  <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>So, for instance temperature.  Our UPS has a temperature monitor on it, but HID temperature values are in Kelvin.  I could define an 8-bit temperature field, with a logical min/max of 0/100, and a physical min/max of 273/373.  So if I pass 50 as a value, then it gets read as 323 on the PC side?  And if the physical range is much greater than the logical range, then it just scales it?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The other min/max I don’t quite understand is usage min/max.  I’m thinking they have something to do with the usages “OutputID”, “FlowID”, etc.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thank you for the help so far.  I really wish there were better learning docs out there for the un-initiated.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Rob<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p></div></body></html>