<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<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;}
@font-face
        {font-family:Wingdings-Regular;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"\@Wingdings-Regular";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* 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'>Ok, using the tutorial at silabs (<a href="https://www.silabs.com/Support%20Documents/TechnicalDocs/AN249.pdf">https://www.silabs.com/Support%20Documents/TechnicalDocs/AN249.pdf</a>), collections make more sense to me now.  They are quite well explained:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:Wingdings-Regular'> </span><i><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Application Collections </span></i><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>group variables that carry out a common purpose. All report items must be contained<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>inside an application collection.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:Wingdings-Regular'> </span><i><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Logical Collections </span></i><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>group variables of different types that form a composite data structure. Think of logical<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>collections as a collection designator for “struct” data types, such as a struct that groups a buffer with index<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>variables for that buffer.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;font-family:Wingdings-Regular'> </span><i><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Physical Collections </span></i><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>group data describing a single data point. For instance, a physical collection of data could<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>contain readings from a temperature sensor.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>So, everything needs to go in an application collection, items grouped in a report go in a logical collection…but I guess I still don’t quite understand why or how you’d use a physical collection.  A single data point…ok, but isn’t that true of your temperature data without it being in a “collection”?  <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><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><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>