Displaying 8 results from an estimated 8 matches for "curdevice".
2007 Feb 16
1
Re: [nut-commits] svn commit r808 - in trunk: . drivers
...o" ".deps/libusb.Po"; else rm -f
".deps/libusb.Tpo"; exit 1; fi
../../drivers/libusb.c:93: error: expected declaration specifiers or
'...' before 'HIDDevice_t'
../../drivers/libusb.c: In function 'libusb_open':
../../drivers/libusb.c:138: error: 'curDevice' undeclared (first use
in this function)
../../drivers/libusb.c:138: error: (Each undeclared identifier is
reported only once
../../drivers/libusb.c:138: error: for each function it appears in.)
../../drivers/libusb.c: At top level:
../../drivers/libusb.c:415: warning: initialization from incom...
2007 Feb 16
1
Re: [nut-commits] svn commit r808 - in trunk: . drivers
> next_device:
> + free(curDevice->Vendor);
> + free(curDevice->Product);
> + free(curDevice->Serial);
> + free(curDevice->Bus);
> usb_close(udev);
> udev = NULL;
> }
Wouldn't it be necessary to check whether there is anything to free or
not? Vendor, Product and Serial are set con...
2007 Aug 23
1
[nut-commits] svn commit r1073 - in trunk: . drivers
...t make sense to
confine libhid to low-level operations, and leave the decision of
trying to reopen vs. retrying to open to the high-level driver, in
this case usbhid-ups?
I envision that the code in usbhid-ups:reconnect_ups() could be
changed to something like:
hd = HIDOpenDevice(&udev, &curDevice, reopen_matcher, MODE_REOPEN);
if (hd == NULL) {
/* reopening failed, try opening new device */
hd = HIDOpenDevice(&udev, &curDevice, regex_matcher, MODE_OPEN);
}
if (hd == NULL) {
return 0;
}
Note "regex_matcher", not "reopen_matcher", in the second call, and...
2010 May 11
1
possible code change to drivers/libusb.c
...claim USB
device: %s", usb_strerror());
+ if (retries-- > 1) {
+ continue;
+ }
+
+ fatalx(EXIT_FAILURE, "Can't claim USB
device [%04x:%04x]: %s", curDevice->VendorID, curDevice->ProductID,
usb_strerror());
+ }
+
+ if (retries > 1) {
if (usb_detach_kernel_driver_np(udev,
0) < 0) {
upsdebugx(2, "failed to detach
kerne...
2020 Apr 03
0
Powercool PCRACK-1200VA patch update
...{
+ langid_fix = tbuf[2] | (tbuf[3] << 8);
+ upsdebugx(1, "First supported language ID: 0x%x (please
report to the NUT maintainer!)", langid_fix);
+ }
+ }
+ return usb_get_string_simple(dev, index, buf, blen);
+}
+
+
+
/* On success, fill in the curDevice structure and return the report
* descriptor length. On failure, return -1.
* Note: When callback is not NULL, the report descriptor will be
@@ -152,7 +228,7 @@ static int libusb_open(usb_dev_handle **udevp,
USBDevice_t *curDevice, USBDevice
int ret, res;
unsigned char buf[20];...
2010 Apr 19
2
Too much logging from libusb.c (patch supplied)
...d so on and so on)
I found the location where this is happening and did the following patch:
diff --git a/drivers/libusb.c b/drivers/libusb.c
index 50bfc7f..3eae478 100644
--- a/drivers/libusb.c
+++ b/drivers/libusb.c
@@ -353,7 +353,7 @@ static int libusb_open(usb_dev_handle **udevp, USBDevice_t *curDevice, USBDevice
*/
static int libusb_strerror(const int ret, const char *desc)
{
- if (ret > 0) {
+ if (ret >= 0) {
return ret;
}
I've been running that patched version since April 16th, monitoring two
UPSes (APC Back UPS XS 1000 and Cyber Power 100...
2007 Jun 21
2
[nut-commits] svn commit r971 - in trunk: . drivers
...n
> {
> upsdebugx(2, "==================================================");
> upsdebugx(2, "= device has been disconnected, try to reconnect =");
> @@ -1001,8 +1001,12 @@
> udev = NULL;
> #endif
>
> - if ((hd = HIDOpenDevice(&udev, &curDevice, reopen_matcher,
> MODE_REOPEN)) == NULL)
> - dstate_datastale();
> + if ((hd = HIDOpenDevice(&udev, &curDevice, reopen_matcher,
> MODE_REOPEN)) == NULL) {
> + dstate_datastale();
> +
> + /* Wait a bit before retrying... */
> + sleep(5);
> + }
> }
&g...
2010 Mar 25
1
new TSSHARA SOHO II ups
...char *name; /* name of this
subdriver */
char *version; /* version of this
subdriver */
int (*open)(usb_dev_handle **sdevp, /* try to open the next
available */
USBDevice_t *curDevice, /* device matching
USBDeviceMatcher_t */
USBDeviceMatcher_t *matcher,
int (*callback)(usb_dev_handle *udev, USBDevice_t *hd,
unsigned char *rdbuf, int rdlen));
void (*close)(usb_dev_handle *sdev);
int (*get_report)(usb_dev_handle *sdev, int...