Hi,
I'm trying to generate a skeleton driver with usbhid-ups and
gen-usbhid-subdriver but the output seems to be incorrect. Same
behavior with stable 2.6.5, so I guess there is something wrong with
data coming out of device.
I attached the output of usbhid-ups and gen-usbhid-subdriver from the commands:
drivers/usbhid-ups -DD -u root -x explore -x vendorid=04d8 -a
openups>& openups-dump.txt
./gen-usbhid-subdriver.sh -n openUPS -v 04d8 -p d004 -k <
../../openups-dump.txt
Thanks,
Nicu
-------------- next part --------------
0.000000 debug level is '2'
0.000504 upsdrv_initups...
0.306826 Checking device (04D8/D004) (008/003)
0.319507 - VendorID: 04d8
0.319538 - ProductID: d004
0.319546 - Manufacturer: Mini-Box.Com
0.319553 - Product: OPEN-UPS
0.319560 - Serial Number: PBSO4-LiFePO
0.319567 - Bus: 008
0.319574 Trying to match device
0.319622 Device matches
0.321508 HID descriptor length 519
0.325501 Report Descriptor size = 519
0.325668 Using subdriver: EXPLORE HID 0.1
0.326510 Path: UPS.PowerSummary.PowerSummaryID, Type: Feature, ReportID:
0x01, Offset: 0, Size: 8, Value: 1
0.327502 refresh_report_buffer: expected 4 bytes, but got 2 instead
0.327516 Path: UPS.PowerSummary.iName, Type: Feature, ReportID: 0x10, Offset:
0, Size: 8, Value: 1
0.328503 refresh_report_buffer: expected 4 bytes, but got 2 instead
0.328518 Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 0x11,
Offset: 0, Size: 8, Value: 2
0.329501 refresh_report_buffer: expected 4 bytes, but got 2 instead
0.329515 Path: UPS.PowerSummary.iSerialNumber, Type: Feature, ReportID: 0x12,
Offset: 0, Size: 8, Value: 3
0.330500 refresh_report_buffer: expected 4 bytes, but got 2 instead
0.330513 Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, ReportID:
0x13, Offset: 0, Size: 8, Value: 4
0.331502 refresh_report_buffer: expected 4 bytes, but got 2 instead
0.331516 Path: UPS.PowerSummary.iOEMInformation, Type: Feature, ReportID:
0x14, Offset: 0, Size: 8, Value: 1
0.332500 refresh_report_buffer: expected 4 bytes, but got 2 instead
0.332514 Path: UPS.PowerSummary.iManufacturer, Type: Feature, ReportID: 0x15,
Offset: 0, Size: 8, Value: 1
0.333500 refresh_report_buffer: expected 4 bytes, but got 2 instead
0.333514 Path: UPS.PowerSummary.00840087, Type: Feature, ReportID: 0x16,
Offset: 0, Size: 8, Value: 1
0.334499 refresh_report_buffer: expected 13 bytes, but got 5 instead
0.334514 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x20,
Offset: 0, Size: 16, Value: 0
0.334528 Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x20,
Offset: 48, Size: 16, Value: 0
0.335501 refresh_report_buffer: expected 13 bytes, but got 5 instead
0.335515 Path: UPS.PowerSummary.ConfigCurrent, Type: Feature, ReportID: 0x30,
Offset: 0, Size: 16, Value: 0
0.335529 Path: UPS.PowerSummary.Current, Type: Feature, ReportID: 0x30,
Offset: 48, Size: 16, Value: 0
0.336508 Path: UPS.PowerSummary.PresentStatus.Present, Type: Feature,
ReportID: 0x40, Offset: 0, Size: 1, Value: 0
0.336522 Path: UPS.PowerSummary.PresentStatus.Good, Type: Feature, ReportID:
0x40, Offset: 1, Size: 1, Value: 0.01
0.336535 Path: UPS.PowerSummary.PresentStatus.InternalFailure, Type: Feature,
ReportID: 0x40, Offset: 2, Size: 1, Value: 0
0.336547 Path: UPS.PowerSummary.PresentStatus.Overload, Type: Feature,
ReportID: 0x40, Offset: 3, Size: 1, Value: 0
0.336559 Path: UPS.PowerSummary.PresentStatus.OverCharged, Type: Feature,
ReportID: 0x40, Offset: 4, Size: 1, Value: 0
0.336571 Path: UPS.PowerSummary.PresentStatus.OverTemperature, Type: Feature,
ReportID: 0x40, Offset: 5, Size: 1, Value: 0
0.336583 Path: UPS.PowerSummary.PresentStatus.ShutdownRequested, Type:
Feature, ReportID: 0x40, Offset: 6, Size: 1, Value: 0
0.336595 Path: UPS.PowerSummary.PresentStatus.ShutdownImminent, Type:
Feature, ReportID: 0x40, Offset: 7, Size: 1, Value: 0
0.336608 Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit,
Type: Feature, ReportID: 0x40, Offset: 8, Size: 1, Value: 0
0.336620 Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired,
Type: Feature, ReportID: 0x40, Offset: 9, Size: 1, Value: 0
0.336632 Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature,
ReportID: 0x40, Offset: 10, Size: 1, Value: 0
0.336644 Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature,
ReportID: 0x40, Offset: 11, Size: 1, Value: 0
0.336656 Path: UPS.PowerSummary.PresentStatus.ConditioningFlag, Type:
Feature, ReportID: 0x40, Offset: 12, Size: 1, Value: 0
0.336668 Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Feature,
ReportID: 0x40, Offset: 13, Size: 1, Value: 0
0.336691 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature,
ReportID: 0x40, Offset: 14, Size: 1, Value: 0
0.336704 Path: UPS.PowerSummary.PresentStatus.BatteryPresent, Type: Feature,
ReportID: 0x40, Offset: 15, Size: 1, Value: 0
0.336716 Path: UPS.PowerSummary.00000000.Present, Type: Input, ReportID:
0x40, Offset: 0, Size: 1, Value: 0
0.336729 Path: UPS.PowerSummary.00000000.Good, Type: Input, ReportID: 0x40,
Offset: 1, Size: 1, Value: 0.01
0.336741 Path: UPS.PowerSummary.00000000.InternalFailure, Type: Input,
ReportID: 0x40, Offset: 2, Size: 1, Value: 0
0.336754 Path: UPS.PowerSummary.00000000.Overload, Type: Input, ReportID:
0x40, Offset: 3, Size: 1, Value: 0
0.336768 Path: UPS.PowerSummary.00000000.OverCharged, Type: Input, ReportID:
0x40, Offset: 4, Size: 1, Value: 0
0.336780 Path: UPS.PowerSummary.00000000.OverTemperature, Type: Input,
ReportID: 0x40, Offset: 5, Size: 1, Value: 0
0.336792 Path: UPS.PowerSummary.00000000.ShutdownRequested, Type: Input,
ReportID: 0x40, Offset: 6, Size: 1, Value: 0
0.336804 Path: UPS.PowerSummary.00000000.ShutdownImminent, Type: Input,
ReportID: 0x40, Offset: 7, Size: 1, Value: 0
0.336816 Path: UPS.PowerSummary.00000000.BelowRemainingCapacityLimit, Type:
Input, ReportID: 0x40, Offset: 8, Size: 1, Value: 0
0.336828 Path: UPS.PowerSummary.00000000.RemainingTimeLimitExpired, Type:
Input, ReportID: 0x40, Offset: 9, Size: 1, Value: 0
0.336841 Path: UPS.PowerSummary.00000000.Charging, Type: Input, ReportID:
0x40, Offset: 10, Size: 1, Value: 0
0.336853 Path: UPS.PowerSummary.00000000.Discharging, Type: Input, ReportID:
0x40, Offset: 11, Size: 1, Value: 0
0.336865 Path: UPS.PowerSummary.00000000.ConditioningFlag, Type: Input,
ReportID: 0x40, Offset: 12, Size: 1, Value: 0
0.336877 Path: UPS.PowerSummary.00000000.NeedReplacement, Type: Input,
ReportID: 0x40, Offset: 13, Size: 1, Value: 0
0.336889 Path: UPS.PowerSummary.00000000.ACPresent, Type: Input, ReportID:
0x40, Offset: 14, Size: 1, Value: 0
0.336901 Path: UPS.PowerSummary.00000000.BatteryPresent, Type: Input,
ReportID: 0x40, Offset: 15, Size: 1, Value: 0
0.337503 Path: UPS.PowerSummary.CapacityMode, Type: Feature, ReportID: 0x50,
Offset: 0, Size: 8, Value: 0.02
0.338506 Path: UPS.PowerSummary.DesignCapacity, Type: Feature, ReportID:
0x51, Offset: 0, Size: 8, Value: 100
0.339508 Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID:
0x52, Offset: 0, Size: 8, Value: 50
0.339523 Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, ReportID:
0x52, Offset: 0, Size: 8, Value: 50
0.340505 Path: UPS.PowerSummary.FullChargeCapacity, Type: Feature, ReportID:
0x53, Offset: 0, Size: 8, Value: 100
0.341504 Path: UPS.PowerSummary.RemainingCapacityLimit, Type: Feature,
ReportID: 0x54, Offset: 0, Size: 8, Value: 5
0.342505 Path: UPS.PowerSummary.WarningCapacityLimit, Type: Feature,
ReportID: 0x55, Offset: 0, Size: 8, Value: 20
0.343504 Path: UPS.PowerSummary.CapacityGranularity1, Type: Feature,
ReportID: 0x56, Offset: 0, Size: 8, Value: 5
0.344505 Path: UPS.PowerSummary.CapacityGranularity2, Type: Feature,
ReportID: 0x57, Offset: 0, Size: 8, Value: 5
0.345508 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID:
0x60, Offset: 0, Size: 24, Value: 3.9321e+06
0.345522 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x60,
Offset: 0, Size: 24, Value: 3.9321e+06
0.346515 Can't retrieve Report b1: Broken pipe
0.346528 Path: ff000001.ff000001, Type: Output, ReportID: 0xb1, Offset: 0,
Size: 248
0.347502 Can't retrieve Report b2: Broken pipe
0.347514 Path: ff000001.ff000001, Type: Input, ReportID: 0xb2, Offset: 0,
Size: 248
0.348506 Can't retrieve Report 81: Broken pipe
0.348520 Path: ff000001.ff000001, Type: Output, ReportID: 0x81, Offset: 0,
Size: 248
0.349501 Can't retrieve Report 82: Broken pipe
0.349513 Path: ff000001.ff000001, Type: Input, ReportID: 0x82, Offset: 0,
Size: 248
0.350503 Can't retrieve Report 83: Broken pipe
0.350523 Path: ff000001.ff000001, Type: Output, ReportID: 0x83, Offset: 0,
Size: 248
0.351503 Can't retrieve Report 84: Broken pipe
0.351514 Path: ff000001.ff000001, Type: Input, ReportID: 0x84, Offset: 0,
Size: 248
0.352500 Can't retrieve Report 85: Broken pipe
0.352511 Path: ff000001.ff000001, Type: Output, ReportID: 0x85, Offset: 0,
Size: 248
0.353505 Can't retrieve Report 86: Broken pipe
0.353517 Path: ff000001.ff000001, Type: Input, ReportID: 0x86, Offset: 0,
Size: 248
0.354505 Can't retrieve Report a2: Broken pipe
0.354518 Path: ff000001.ff000001, Type: Input, ReportID: 0xa2, Offset: 0,
Size: 248
0.355502 Can't retrieve Report a1: Broken pipe
0.355514 Path: ff000001.ff000001, Type: Output, ReportID: 0xa1, Offset: 0,
Size: 248
0.356506 Can't retrieve Report a4: Broken pipe
0.356520 Path: ff000001.ff000001, Type: Input, ReportID: 0xa4, Offset: 0,
Size: 248
0.357502 Can't retrieve Report a3: Broken pipe
0.357513 Path: ff000001.ff000001, Type: Output, ReportID: 0xa3, Offset: 0,
Size: 248
0.358504 Can't retrieve Report a5: Broken pipe
0.358515 Path: ff000001.ff000001, Type: Output, ReportID: 0xa5, Offset: 0,
Size: 248
0.359503 Can't retrieve Report a9: Broken pipe
0.359515 Path: ff000001.ff000001, Type: Output, ReportID: 0xa9, Offset: 0,
Size: 248
0.360504 Can't retrieve Report aa: Broken pipe
0.360515 Path: ff000001.ff000001, Type: Input, ReportID: 0xaa, Offset: 0,
Size: 248
0.361504 Can't retrieve Report cc: Broken pipe
0.361516 Path: ff000001.ff000001, Type: Input, ReportID: 0xcc, Offset: 0,
Size: 248
Network UPS Tools - Generic HID driver 0.37 (2.6.5-3766M)
USB communication driver 0.31
0.361537 Report descriptor retrieved (Reportlen = 519)
0.361544 Found HID device
0.361552 Detected a UPS: Mini-Box.Com/OPEN-UPS
0.361561 find_nut_info: unknown info type: load.off.delay
0.361569 find_nut_info: unknown info type: load.on.delay
0.361576 find_nut_info: unknown info type: load.off.delay
0.361589 upsdrv_initinfo...
0.361601 upsdrv_updateinfo...
0.613528 libusb_get_interrupt: Connection timed out
0.613565 Got 0 HID objects...
0.613574 Quick update...
0.613681 dstate_init: sock /var/state/ups/usbhid-ups-openups open on fd 5
0.613697 upsdrv_updateinfo...
0.865536 libusb_get_interrupt: Connection timed out
0.865568 Got 0 HID objects...
0.865577 Quick update...
2.615467 upsdrv_updateinfo...
2.867631 libusb_get_interrupt: Connection timed out
2.867666 Got 0 HID objects...
2.867675 Quick update...
4.617224 upsdrv_updateinfo...
4.868724 libusb_get_interrupt: Connection timed out
4.868758 Got 0 HID objects...
4.868767 Quick update...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openups-hid.c
Type: text/x-csrc
Size: 13426 bytes
Desc: not available
URL:
<http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20121022/7c09f005/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openups-hid.h
Type: text/x-chdr
Size: 1143 bytes
Desc: not available
URL:
<http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20121022/7c09f005/attachment-0001.h>