Displaying 8 results from an estimated 8 matches for "usb_subdriver".
2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
...--- a/drivers/libusb1.c
+++ b/drivers/libusb1.c
@@ -420,7 +420,7 @@ static int nut_libusb_open(libusb_device_handle **udevp,
upsdebugx(2, "Reading first configuration descriptor");
ret = libusb_get_config_descriptor(device,
- (uint8_t)usb_subdriver.hid_rep_index,
+ 0, //(uint8_t)usb_subdriver.hid_rep_index,
&conf_desc);
/*ret = libusb_get_active_config_descriptor(device,
&conf_desc);*/
When running from commit ab55bc0 on master, I end up with
usb_subdriver.hid_rep_index =...
2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
@jimklimov: Looking at the code that uses hid_rep_index, hid_desc_index,
and hid_ep_in|out in usb_subdriver (all in nut_libusb.h)
I don't see any use of the addvars mechanism. If I follow the examples that
set and use those struct members, it looks like everything relies on them
being initialized to 0 by default, then only set in subdrivers or
situations that need something different.
If I have this...
2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
...gt; @@ -420,7 +420,7 @@ static int nut_libusb_open(libusb_device_handle
>> **udevp,
>>
>> upsdebugx(2, "Reading first configuration descriptor");
>> ret = libusb_get_config_descriptor(device,
>> - (uint8_t)usb_subdriver.hid_rep_index,
>> + 0, //(uint8_t)usb_subdriver.hid_rep_index,
>> &conf_desc);
>> /*ret = libusb_get_active_config_descriptor(device,
>> &conf_desc);*/
>>
>> When running from commit ab55bc0 on...
2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
.../drivers/libusb1.c
> @@ -420,7 +420,7 @@ static int nut_libusb_open(libusb_device_handle
> **udevp,
>
> upsdebugx(2, "Reading first configuration descriptor");
> ret = libusb_get_config_descriptor(device,
> - (uint8_t)usb_subdriver.hid_rep_index,
> + 0, //(uint8_t)usb_subdriver.hid_rep_index,
> &conf_desc);
> /*ret = libusb_get_active_config_descriptor(device,
> &conf_desc);*/
>
> When running from commit ab55bc0 on master, I end up with
&...
2020 Apr 03
0
Powercool PCRACK-1200VA patch update
.../drivers/libusb.h
@@ -60,6 +60,8 @@ typedef struct usb_communication_subdriver_s {
unsigned char *buf, int bufsize, int timeout);
} usb_communication_subdriver_t;
+int nut_usb_get_string(usb_dev_handle *dev, int index, char *buf,
size_t buflen);
+
extern usb_communication_subdriver_t usb_subdriver;
#endif /* LIBUSB_H */
diff --git a/drivers/main.c b/drivers/main.c
index 0b6759dd..f05de30e 100644
--- a/drivers/main.c
+++ b/drivers/main.c
@@ -673,6 +673,7 @@ int main(int argc, char **argv)
/* get the base data established before allowing connections */
upsdrv_initinfo();
+
...
2007 Jan 23
2
Voltage override in megatec and megatec-over-usb [was: Re: nut-2.0.5 megatec + Online Xanto]
On 1/23/07, Henning Brauer <hb-nut@bsws.de> wrote:
> good new first: the megatec driverin 2.0.5 now works with the Online
> Xanto S3000R here - well, for the very basics.
>
> the UPS has NO way ofidentifying itself. It also does not respond to
> the power ratings query ("F"). I previously used a hacked up fentonups
> driver. This means the driver cannot figure out
2007 Feb 01
2
Re: [Nut-upsuser] Ablerex 625L USB version
...string
> + formatting etc. So in order to add support for another
> usb-to-serial device one
> + only needs to implement device-specific get/set functions and add
> an entry into
> + KnownDevices table.
> +
> + */
> +
> + static communication_subdriver_t *usb = &usb_subdriver;
> + static usb_dev_handle *udev=NULL;
> + static HIDDevice hiddevice;
> +
> + static int comm_usb_recv(char *buffer,size_t buffer_len,char
> endchar,const char *ignchars);
> +
> + typedef struct
> + {
> + uint16_t vid;
> +...
2006 Dec 05
3
megatec over USB - new driver patch
...river takes care of detection, opening a usb device, string
+formatting etc. So in order to add support for another usb-to-serial device one
+only needs to implement device-specific get/set functions and add an entry into
+KnownDevices table.
+
+*/
+
+static communication_subdriver_t *usb = &usb_subdriver;
+static usb_dev_handle *udev=NULL;
+static HIDDevice hiddevice;
+
+static int comm_usb_recv(char *buffer,size_t buffer_len,char endchar,const char *ignchars);
+
+typedef struct
+{
+ uint16_t vid;
+ uint16_t pid;
+ int (*get_data)(char *buffe...