search for: usb_dev_handl

Displaying 19 results from an estimated 19 matches for "usb_dev_handl".

Did you mean: usb_dev_handle
2010 Mar 25
1
new TSSHARA SOHO II ups
...n a *set_interrupt element as well: libusb.h .... typedef struct usb_communication_subdriver_s { 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));...
2020 Apr 03
0
Powercool PCRACK-1200VA patch update
...b/drivers/libusb.c @@ -36,6 +36,7 @@  #define USB_DRIVER_NAME        "USB communication driver"  #define USB_DRIVER_VERSION    "0.33" +  /* driver description structure */  upsdrv_info_t comm_upsdrv_info = {      USB_DRIVER_NAME, @@ -52,6 +53,10 @@ static void libusb_close(usb_dev_handle *udev);  /*! Add USB-related driver variables with addvar().   * This removes some code duplication across the USB drivers.   */ +#define USB_BUFLEN_MAX 256 +static int                langid_fix = -1; +static int                buflen_fix = -1; +  void nut_usb_addvars(void)  {      /* allow...
2007 Feb 16
1
Re: [nut-commits] svn commit r808 - in trunk: . drivers
...@@ > failure, return -1. Note: ReportDesc must point to a large enough > buffer. There's no way to know the size ahead of time. Matcher is > a linked list of matchers (see libhid.h), and the opened device > - must match all of them. */ > -static int libusb_open(usb_dev_handle **udevp, HIDDevice *curDevice, HIDDeviceMatcher_t *matcher, unsigned char *ReportDesc, int mode) > + must match all of them. Also note: the string components of > + curDevice are filled with allocated strings that must later be > + freed. */ > +static int libusb_open(usb_dev_h...
2007 Nov 20
2
Mustek Powermust 600VA
Hi, I'm having a hard time configuring a Mustek Powermust 600VA ups to work via USB with nut. I read somewhere that nut works OK via the rs232 cable, but unfortunately I don't have a COM port in my computer. The kernel detects the ups as an Xbox pad :) and loads the xpad module. I tried running /lib/nut/megatec with different /dev/ttySx but it displays megatec protocol UPS was not
2010 Apr 19
2
Too much logging from libusb.c (patch supplied)
...40 | libusb_get_report: No error (and 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 Bac...
2007 Jan 31
3
Re: [Nut-upsuser] Ablerex 625L USB version
Peter, I have been doing some more testing and I find that if I modify the libusb.c file to set a report size in libusb_get_report to 16 the error messages go away. This is the code as it currently stands: static int libusb_get_report(usb_dev_handle *udev, int ReportId, unsigned char *raw_buf, int ReportSize ) { int ReportSize_test = 16; unsigned char raw_buf_test[ReportSize_test + 1]; int rc; unsigned char *p_raw_buf_test; upsdebugx(4, "Entering libusb_get_report, ReportSize: %i, ReportSize_test: %i",ReportSiz...
2009 Jul 10
1
PowerWare USB debug messages
...led. (Ignore the commented-out goto.) Since these messages are at the LOG_ERR level, should we add usb_strerror() to all of the calls in nut_usb.c? diff --git a/drivers/nut_usb.c b/drivers/nut_usb.c index 494a1fa..4ca2691 100644 --- a/drivers/nut_usb.c +++ b/drivers/nut_usb.c @@ -165,8 +165,8 @@ usb_dev_handle *nutusb_open(const char *port) if (usb_clear_halt(dev_h, 0x81) < 0) { - upslogx(LOG_ERR, "Can't reset POWERWARE USB endpoint"); - goto errout; + upslogx(LOG_ERR, "Can't reset POWERWARE USB endpoint: %s", usb_strerror()); +...
2005 Nov 08
1
TrippLite OMNI1000LCD hiddev
Joel Peshkin wrote: > > I hacked in the following additonal changes... > > Index: newhidups.c > =================================================================== > RCS file: /cvsroot/nut/nut/drivers/newhidups.c,v > retrieving revision 1.1.1.1.8.6.2.21 > diff -u -r1.1.1.1.8.6.2.21 newhidups.c > --- newhidups.c 7 Nov 2005 22:14:20 -0000 1.1.1.1.8.6.2.21 > +++
2007 Jan 19
5
Install problem & Geek Squad UPS
I Seem to have made some progress in getting nut-2.0.5 installed, but hidups still has a version number of 0.13. First is hidups 0.13 the correct version? if not how do I find the correct version. Second if my Geek Squad GS1285U UPS is not supported how do I proceed. I have been a programmer for 35 years(mostly high level computer aided design), written code in 20 some languages, am retired
2007 May 13
0
No subject
...ou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "main.h" #include "nut_usb.h" #include "sweex_usb.h" usb_dev_handle *upsdev = NULL; int query_ups (unsigned char *reply) { unsigned char buf[4]; int ret; /* * This packet is a status request to the UPS */ buf[0]=0x01; buf[1]=0x00; buf[2]=0x00; buf[3]=0x30; return execute_and_retri...
2007 May 13
0
No subject
...You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "main.h" #include "nut_usb.h" #include "sweex_usb.h" usb_dev_handle *upsdev = NULL; int query_ups (unsigned char *reply) { unsigned char buf[4]; int ret; /* * This packet is a status request to the UPS */ buf[0]=0x01; buf[1]=0x00; buf[2]=0x00; buf[3]=0x30; return execute_and_retrieve_query(...
2007 May 13
0
No subject
...You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "main.h" #include "nut_usb.h" #include "sweex_usb.h" usb_dev_handle *upsdev = NULL; int query_ups (unsigned char *reply) { unsigned char buf[4]; int ret; /* * This packet is a status request to the UPS */ buf[0]=0x01; buf[1]=0x00; buf[2]=0x00; buf[3]=0x30; return execute_and_retrieve_query(...
2005 Sep 21
0
Compre facil seu imóvel consorcio (11) 2121-4103
...ad.c: In function `load_firmware`: amload.c:412: `adsl_handle` undeclared (first use in this function) amload.c: In function `init_modem`: amload.c:677: dereferencing pointer to incomplete type amload.c:678: dereferencing pointer to incomplete type amload.c: In function `main`: amload.c:721: `usb_dev_handle` undeclared (first use in this function) amload.c:721: `adsl_handle` undeclared (first use in this function) amload.c:772: warning: implicit declaration of function `usb_init` amload.c:773: warning: implicit declaration of function `usb_find_busses` amload.c:778: warning: implicit declaration...
2005 Aug 25
3
Tr : NUT patches
Hi Peter, I've forwarded your mail to upsdev as it will be of interest for several people that are working on it. As I'm also on vacation (again) for a week and 1/2 as of this evening, I don't think I'll have the time for it before I get back.... I've not yet audited the patches, but these are queued on the Alioth tracker:
2007 Aug 23
1
[nut-commits] svn commit r1073 - in trunk: . drivers
....c (original) > +++ trunk/drivers/libusb.c Thu Aug 23 19:43:41 2007 > @@ -90,7 +90,8 @@ > opened device must match all of them. Also note: the string > components of curDevice are filled with allocated strings that > must later be freed. */ > -static int libusb_open(usb_dev_handle **udevp, HIDDevice_t *curDevice, HIDDeviceMatcher_t *matcher, unsigned char *ReportDesc, int mode) > +static int libusb_open(usb_dev_handle **udevp, HIDDevice_t *curDevice, HIDDeviceMatcher_t *matcher, > + unsigned char *ReportDesc, int *mode) > { > int found = 0; > #if LIBUSB_H...
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
.... 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; >...
2006 Dec 05
3
megatec over USB - new driver patch
...ection, 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 *buffer,int buffer_size); +...
2005 Sep 23
11
trying to use powerware 3110 USB with NUT
Ok, I installed the ups, and installed nut, and /proc/bus/usb/devices says this T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=06da ProdID=0002 Rev= 0.01 S: Manufacturer=POWERWARE S: Product=Powerware UPS C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 20mA I: If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00