Displaying 8 results from an estimated 8 matches for "get_interrupt".
2024 Nov 23
0
Missing portions of USB response
...lementation is serial protocol over USB (hey, it is what it is). I
am able to find the device (regex) and open it, send it a command and
get a response. The problem is that I see all of the transactions in
my USB sniffing tool (8-byte chunks) but the buffer that is used for
the response in 'get_interrupt' is missing one or more of the
beginning chunks (using printf ("%s", response); to show it).
Any ideas why the response buffer would not have the complete
response from the get_interrupt call when I can see it all on the bus?
Thanks,
Bill
--
This email has been checked for vir...
2009 Aug 02
2
Driver fix for Ippon BCP800 (06da/0003), blazer_usb.c
...zer_usb.c (revision 1896)
+++ drivers/blazer_usb.c (working copy)
@@ -94,6 +94,23 @@
}
+static int phoenix_flush_io()
+{
+ static
+ char buf[SMALLBUF+1];
+ int i, ret;
+ upsdebugx(3, "phoenix_flush_io");
+ for(i = 0; i < 10; i++) {
+ memset(buf, 0, sizeof(buf));
+ /* ret = usb->get_interrupt(udev, (unsigned char *)buf, 8, 1000); */
+ ret = usb_interrupt_read(udev, 0x81, buf, SMALLBUF, 1000);
+ upsdebugx(4, "flush(%d,%d) <- '%s'", ret, strlen(buf), buf);
+ if (ret < 1)
+ break;
+ }
+ return 0;
+}
+
static int phoenix_command(const char *cmd, char *buf, size...
2007 Oct 03
2
[nut-commits] svn commit r1136 - in trunk: . drivers
...added ability to do subdriver-specific
> initialization, and moved some shared code to agiler init function
> since krauler doesn't need it.
[...]
I'm not very thrilled about this patch:
1) Down at the subdriver level, one shouldn't use ser_get_line() anymore,
but usb->get_interrupt() instead or alternatively, get_data_agiler().
Hopping back-and-forth between various layers in the code is bad coding
style as it makes the code difficult to understand.
2) So what is the benefit of this patch? It seem to try to optimize
something away that complicates the subdrivers and really p...
2010 Mar 25
1
new TSSHARA SOHO II ups
...in that
sense. To be more specific: In order to communicate with this UPS both input
and output have to be performed as USB interrupts I/O as this UPS doesn't
recognizes Control IO, so libusb_get_report() and libusb_set_report() will
not work. Looking at libusb.c I realized there's a libusb_get_interrupt()
which can be used to read from the endpoint, however there's no counterpart
libusb_set_interrupt() API and usb_communication_subdriver_t structure
doesn't contain a *set_interrupt element as well:
libusb.h
....
typedef struct usb_communication_subdriver_s {
char *name;...
2007 Sep 12
2
PowerWalker and megatec_usb
Hi!
I've (finally) decided to try and make my PowerWalker work with
megatec_usb. So far it seems the agiler subdriver is the way to go,
but it doesn't work. The initial detection process sometimes succeeds
in 1 out of 5 "Q1" commands, but that's about it (which is better than
what the krauler subdriver can do... absolutely nothing).
So, what needs to be done to obtain more
2007 Feb 01
2
Re: [Nut-upsuser] Ablerex 625L USB version
...+ static int get_data_agiler(char *buffer,int buffer_size)
> + {
> + int i,len;
> + char buf[AGILER_REPORT_SIZE*AGILER_REPORT_COUNT+1];
> +
> + memset(buf,0,sizeof(buf));
> +
> + for (i=0;i<AGILER_REPORT_COUNT;i++)
> + {
> + len = usb->get_interrupt(udev,(unsigned char
> *)buf+i*AGILER_REPORT_SIZE,AGILER_REPORT_SIZE,AGILER_TIMEOUT);
> + if (len!=AGILER_REPORT_SIZE) {
> + if (len<0) len=0;
> + buf[i*AGILER_REPORT_SIZE+len]=0;
> + break;
> + }
> + }
> +
> +...
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
2006 Dec 05
3
megatec over USB - new driver patch
...t_report(udev,0,report_buf,sizeof(report_buf));
+}
+
+static int get_data_agiler(char *buffer,int buffer_size)
+{
+ int i,len;
+ char buf[AGILER_REPORT_SIZE*AGILER_REPORT_COUNT+1];
+
+ memset(buf,0,sizeof(buf));
+
+ for (i=0;i<AGILER_REPORT_COUNT;i++)
+ {
+ len = usb->get_interrupt(udev,buf+i*AGILER_REPORT_SIZE,AGILER_REPORT_SIZE,AGILER_TIMEOUT);
+ if (len!=AGILER_REPORT_SIZE) {
+ if (len<0) len=0;
+ buf[i*AGILER_REPORT_SIZE+len]=0;
+ break;
+ }
+ }
+
+ len = strlen(buf);
+
+ if (len > buffer_size)
+ {
+...