search for: usb_get_str

Displaying 6 results from an estimated 6 matches for "usb_get_str".

2020 Apr 03
0
Patch to support Powercool PCRACK-1200VA
Hi Folks, This is my first post on nut-upsdev. I would like to share a small patch to enable support for the Powercool PCRACK 1200VA ups. I found that the UPS uses megatec/krauler protocol but is sensitive to the USB buffer length passed to it in requests via usb_get_string(), and usb_get_string_simple(). If the buflen is greater than 102 then the ups will reply to requests but does not behave correctly. In this case the responses to "Q1" commands contain constant stale data that is never updated. This patch adds a parameter to the nutdrv_qx driver t...
2010 Sep 24
1
Dynamix 650 VA USB - broken, have rough fix
...megatec_usb would consistently fail. After spending a week (hey, I'm unemployed) reading USB docs and poking at it from various directions, I now understand what's wrong, though not necessarily the best place to fix it. megatec_usb communicates primarily with the UPS via libusb 0.1's usb_get_string_simple. usb_get_string_simple begins by requesting supported LANGIDs from the UPS -- which fails, ending communication. (Megatec's USB implementation is not a good effort.) If you skip that step and go directly to usb_get_string with some arbitrary LANGID (I tried 0x0409 and 0x0000, both...
2020 Apr 03
0
Powercool PCRACK-1200VA patch update
Sorry about the noise guys. Below a significantly improved patch. The main difference is that all calls to usb_get_string_.. have been wrapped in a new function nut_usb_get_string()  that is implemented in libusb.c This was necessary in order to make the bufflen_fix available in libusb.c where usb_get_string() is called in libusb_open() This wrapper function mops up and hides all the work concerned with handl...
2011 Dec 17
1
[nut-commits] svn commit r3363 - in trunk: data docs/man drivers
...nut/changeset/3363 > > Log: > Try to fix language ID support for USB units from LDLC, Dynamix and no names in blazer_usb (reworked patch, from Brian R. Smith and Aur?lien Grenotton) ... > + if (testvar("langid_fix")) { > + /* Hardcode lang to 0x4095 */ > + ret = usb_get_string(udev, command[i].index, 0x4095, buf, buflen); > + } Arnaud, Could this code use the langid_fix value which is set in upsdrv_initups() instead of 0x4095? Or am I misunderstanding how this is supposed to work? - Charles
2006 Nov 20
0
valgrind and libusb calls
...an my own house" first. The problem is that the buffers returned from libusb are all being marked as invalid (the bytes themselves, not the address). I see at least two solutions to this: 1) Clear all buffers to zero before calling libusb functions that write to a buffer (usb_get_interrupt, usb_get_string*, usb_control_msg, etc.) 2) Mark the valid portions of the buffer after the libusb call with VALGRIND_MAKE_READABLE. The big advantage of the first method is that it keeps the code looking clean, and means we don't have to do any conditional inclusion of valgrind's memcheck.h or anythi...
2006 May 02
5
Newhidups gets unbound after a while
Hi everybody, If we let the feature running, it appears that the driver gets unbound after a while ( variable from quarter of hour to 6 hours ) and cannot reconnect. This behavior appear with both MGE Ellipse ASR and non-ASR models with connection to an UHCI and OHCI controllers. The USB core is from 2.4.28 kernel. We use nut-2.0.3. Start, powerfail and recovery detections, UPS shutdown work