Displaying 3 results from an estimated 3 matches for "free_reportdesc".
2018 Feb 04
0
[PATCH 2/3] Add generic facility to override HID report descriptor in usbhid-ups
...fseek(f, 0, SEEK_SET);
+
+ buf = xmalloc(size);
+
+ if (fread(buf, size, 1, f) != 1) {
+ upslog_with_errno(LOG_CRIT, "Short read of %s", descfile);
+ fclose(f);
+ free(buf);
+ return 0;
+ }
+ fclose(f);
+
+ rdbuf = buf;
+ rdlen = size;
+ }
+
/* Parse Report Descriptor */
Free_ReportDesc(pDesc);
pDesc = Parse_ReportDesc(rdbuf, rdlen);
+
+ if (descfile)
+ free(rdbuf);
+
if (!pDesc) {
upsdebug_with_errno(1, "Failed to parse report descriptor!");
return 0;
--
2.7.4
--
Russell King
2007 Aug 23
1
[nut-commits] svn commit r1073 - in trunk: . drivers
...== MODE_REOPEN) {
> + if (*mode == MODE_REOPEN) {
> upsdebugx(4, "Device reopened successfully");
> return hd;
> }
> @@ -632,6 +683,7 @@
> upsdebug_hex(3, "Report Descriptor", ReportDesc, ReportSize);
>
> /* Parse Report Descriptor */
> + Free_ReportDesc(pDesc);
> pDesc = Parse_ReportDesc(ReportDesc, ReportSize);
> if (!pDesc) {
> HIDCloseDevice(*udevp);
> @@ -639,6 +691,7 @@
> }
>
> /* prepare report buffer */
> + free_report_buffer(rbuf);
> rbuf = new_report_buffer(pDesc);
> if (!rbuf) {
> Free...
2018 Feb 04
5
[PATCH 0/3] OpenUPS updates
Hi,
I've been checking out NUT with an OpenUPS board over the last couple
of weekends, and have noticed that it doesn't seem to report sensible
values. This lead me to investigate usbhid-ups and delve into various
issues.
As mentioned in a github issue, one of the problems is with the report
descriptor - dumping this from the usbhid-ups debug output and picking
through it reveals that