Charles Lepple
2008-Jan-02 20:50 UTC
[Nut-upsdev] [nut-commits] svn commit r1210 - in trunk: . drivers
On Jan 2, 2008 3:34 PM, Arjen de Korte <adkorte-guest at alioth.debian.org> wrote:> Author: adkorte-guest > Date: Wed Jan 2 20:34:26 2008 > New Revision: 1210 > > Log: > Parsing continues if the HID path for a report ends in 0x00000000 (these will not be made available). Commonly used as placeholders. > > It looks like (but correct me if I'm wrong) that reports for which the HID path ends in 0x00000000 are placeholders only.I agree with the rest of your logic about complexity, but they are less like placeholders, and more like bugs in the parser. A common idiom in HID report descriptors is to have an array of bytes or bitstrings, and the hidparser code tends to show the first array element properly, then it prints several duplicates of the first element with 0x00000000 instead of the last usage ID. -- - Charles Lepple
Arjen de Korte
2008-Jan-03 11:20 UTC
[Nut-upsdev] [nut-commits] svn commit r1210 - in trunk: . drivers
> I agree with the rest of your logic about complexity, but they are > less like placeholders, and more like bugs in the parser. A common > idiom in HID report descriptors is to have an array of bytes or > bitstrings, and the hidparser code tends to show the first array > element properly, then it prints several duplicates of the first > element with 0x00000000 instead of the last usage ID.Question is, is this worth to be fixed? Even if it used the last usage ID, this would mean that we'll have a one (HID path) to many (values) mapping. Correct me if I'm wrong, but it doesn't make a whole lot of difference if we have Path: UPS.PowerSummary.PresentStatus.WhatEver, Type: Input, ReportID: 0x32, Offset: 0, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 1, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 2, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 3, Size: 1, Value: 0.000000 or Path: UPS.PowerSummary.PresentStatus.WhatEver, Type: Input, ReportID: 0x32, Offset: 0, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.WhatEver, Type: Input, ReportID: 0x32, Offset: 1, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.WhatEver, Type: Input, ReportID: 0x32, Offset: 2, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.WhatEver, Type: Input, ReportID: 0x32, Offset: 3, Size: 1, Value: 0.000000 In both cases, whatever these reports are pointing at, they are not of any use (we'd only use the first one that matches). Best regards, Arjen -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57
Arjen de Korte
2008-Jan-04 08:08 UTC
[Nut-upsdev] [nut-commits] svn commit r1210 - in trunk: . drivers
>> It looks like (but correct me if I'm wrong) that reports for which the >> HID path ends in 0x00000000 are placeholders only. > > I agree with the rest of your logic about complexity, but they are > less like placeholders, and more like bugs in the parser.Looking at the output from the Tripplite UPS I wrote about lately, this doesn't seem to be due to a bug in the parser. Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: 0x35, Offset: 0, Size: 16, Value: 2379.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 0, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 1, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 2, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 3, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 4, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 5, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 6, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.InternalFailure, Type: Input, ReportID: 0x32, Offset: 7, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 8, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Input, ReportID: 0x32, Offset: 9, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 10, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 11, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 12, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 13, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 14, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 15, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x32, Offset: 16, Size: 1, Value: 1.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Input, ReportID: 0x32, Offset: 17, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x32, Offset: 18, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.FullyCharged, Type: Input, ReportID: 0x32, Offset: 19, Size: 1, Value: 1.000000 Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x32, Offset: 20, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x32, Offset: 21, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.FullyDischarged, Type: Input, ReportID: 0x32, Offset: 22, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Input, ReportID: 0x32, Offset: 23, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 0, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 1, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 2, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 3, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 4, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 5, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 6, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.InternalFailure, Type: Feature, ReportID: 0x32, Offset: 7, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 8, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type: Feature, ReportID: 0x32, Offset: 9, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 10, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 11, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 12, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 13, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 14, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 15, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x32, Offset: 16, Size: 1, Value: 1.000000 Path: UPS.PowerSummary.PresentStatus.00000000, Type: Feature, ReportID: 0x32, Offset: 17, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x32, Offset: 18, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.FullyCharged, Type: Feature, ReportID: 0x32, Offset: 19, Size: 1, Value: 1.000000 Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x32, Offset: 20, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x32, Offset: 21, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.FullyDischarged, Type: Feature, ReportID: 0x32, Offset: 22, Size: 1, Value: 0.000000 Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Feature, ReportID: 0x32, Offset: 23, Size: 1, Value: 0.000000 Path: UPS.BatterySystem.Battery.ConfigVoltage, Type: Feature, ReportID: 0x04, Offset: 0, Size: 16, Value: 48.000000 I think that the UPS is trying to tell us the following. Peter Selinger already figured out many of these about a year ago (for the same device), I added some missing ones: byte 0, bit 0-6: unused byte 0, bit 7: UPS.PowerSummary.PresentStatus.InternalFailure byte 1, bit 0: unused byte 1, bit 1: UPS.PowerSummary.PresentStatus.ShutdownImminent byte 1, bit 2-7: unused byte 2, bit 0: UPS.PowerSummary.PresentStatus.ACPresent byte 2, bit 1: unused byte 2, bit 2: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit byte 2, bit 3: UPS.PowerSummary.PresentStatus.FullyCharged byte 2, bit 4: UPS.PowerSummary.PresentStatus.Charging byte 2, bit 5: UPS.PowerSummary.PresentStatus.Discharging byte 2, bit 6: UPS.PowerSummary.PresentStatus.FullyDischarged byte 2, bit 7: UPS.PowerSummary.PresentStatus.NeedReplacement So it may be a good idea after all to disregard HID paths that end in 0x00000000, even if the hidparser would be fixed. Although it would be nice to get a confirmation that this is indeed to be interpreted as 'unused'. Best regards, Arjen -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57