+++ /dev/null
-#!/usr/bin/perl
-$|=1;
-for ($a=0xff; $a>=0x00; $a-=0x01) {
-#for ($a=0x6a; $a<=0x6a; $a+=0x01) {
- next if $a eq 0x43;
- next if $a eq 0x46;
- next if $a eq 0x53;
- next if $a eq 0x58;
- next if $a eq 0x6a;
-for ($b=0x40; $b<=0xc0; $b++) {
-#for ($b=0xff; $b<=0xff; $b++) {
-@l= ( $b,0xff,$a);
-print STDERR (join ' ', map { sprintf "%02x", $_ } @l), "\n";
-#next if $a eq 0x46;
- print pack("c*", @l) or die $!;
-}
-printf STDERR "---\n";
-#sleep 1;# if !($a & 0x0f);
-}
-
-__END__
-
- ??,0x00,0x43 ?? is something to do with mice; with ??=0, no mice visible
-speed,any?,0x46 rumble big weight (Left)
-0xff,0x00,0x53 swaps things round
- some,some,0x58 swaps things round - hat switch from joystick ?
- some,some,0x6a crashes ? no further output afaict
+++ /dev/null
-/**/
-
-int main(void) {
- usb_init();
- usb_find_busses();
- usb_find_devices();
- struct usb_bus busses= usb_get_busses();
- struct usb_bus *bus;
- struct usb_device *dev;
- for (bus=busses; bus; bus=bus->next) {
- for (dev=bus->devices; dev; dev=dev->next) {
- if (dev->descriptor.idVendor != 0x18b ||
- dev->descriptor.idProduct != 0x123)
- continue;
- goto found;
- }
- }
- die("not found");
-
- assert(dev->bNumConfigurations == 1);
- assert(dev->config[0].bNumInterfaces == 2);
- assert(dev->config[0].interface[0].
-
- usb_dev_handle *dh= usb_open(dev);
- int r= usb_claim_interface(dh, 0); assert(r>=0);
-
- r= usb_set_configuration(dh, dev->config[0].bConfigurationValue);
- assert(r>=0);
-
- usb_dev_handle *dh2= usb_open(dev);
- int r= usb_claim_interface(dh, 1); assert(r>=0);
-
- printf("ok\n");
- char hbuf[100];
- uint8_t cbuf[ sizeof(hbuf)/2 + 10 ];
- for (;;) {
- n:
- putchar('>');
- fflush(stdout);
- if (!fgets(hbuf, sizeof(hbuf), stdin)) break;
- const char *p= hbuf;
- uint8_t *o= cbuf;
- for (;;) {
- char h3[3];
- int c= *p++;
- if (c=='\n') break;
- if (isspace((unsigned char)c)) continue;
- if (!c) die("bad line");
- h3[0]= c;
- c= *p++;
- if (!c) die("bad line");
- h3[1]= c;
- h3[2]= 0;
- char *ep;
- o= strtoul(h3, &ep, 16);
- if (ep != h3+2) { fprintf(stderr,"bad hex\n"); goto n; }
- }
- r= usb_control_msg(dh,
-
- usb_control_msg
+++ /dev/null
-#!/usr/bin/perl
-$|=1;
-for ($a=0x43; $a<=0x53; $a+=0x10) {
- next if $a eq 0x46;
-#for ($b=90; $b<=95; $b++) {
- $b=0xff;
-printf STDERR "%02x %02x\n", $b, $a;
-#next if $a eq 0x46;
- print pack("c*", 0xff, $b,$a) or die $!;
-#}
-printf STDERR "---\n";
-#sleep 1;# if !($a & 0x0f);
-}
-
-__END__
-
-speed,0x00,0x46 rumble
- ??,0x00,0x43 ?? is something to do with mouse acceleration; with ??=0
- no mice visible
-0xff,0x00,0x53 swaps things round