Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Dec 2003 19:49:40 +0100
From:      Steve O'Hara-Smith <steve@sohara.org>
To:        Lars Eggert <larse@ISI.EDU>
Cc:        current@FreeBSD.ORG
Subject:   Re: X10 Wireless Technology Inc USB Receiver
Message-ID:  <20031213194940.44073338.steve@sohara.org>
In-Reply-To: <3F6DE165.1020404@isi.edu>
References:  <3F57B0A0.2040508@isi.edu> <20030905072228.3def6a8b.steve@sohara.org> <3F63E246.8030801@isi.edu> <20030915190350.3e0fe0ec.steve@sohara.org> <20030918165710.GB19984@genius.tao.org.uk> <3F69FFC9.80308@isi.edu> <20030918231742.GB41432@genius.tao.org.uk> <3F6DE165.1020404@isi.edu>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Sun, 21 Sep 2003 10:35:33 -0700
Lars Eggert <larse@ISI.EDU> wrote:

LE> Hi,
LE> 
LE> I'm trying to get the USB RF remote control that comes with some ATI 
LE> Wonder cards to do something meaningful under -current.

	I've returned to this under a bit of USENET prodding - with
an up to date RELENG_4 and the latest USB from -current patchset I
am starting to get somewhere - the attached code at least does not
produce errors, unfortunately it doesn't produce output either.

	Ideas anyone ??

-- 
C:>WIN                                      |     Directable Mirrors
The computer obeys and wins.                |A Better Way To Focus The Sun
You lose and Bill collects.                 |  licenses available - see:
                                            |   http://www.sohara.org/

[-- Attachment #2 --]
#include <fcntl.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <stdio.h>
#include <usb.h>
#include <sys/ioctl.h>
#include <dev/usb/usb.h>

#define USB_ERROR -1

static char init1[]={ 0x01, 0x00, 0x20, 0x14 };
static char init2[]={ 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };

main (int argc, char **argv)
{
	int fd;
	int rfd, wfd;
	int err;
	int iov;
	char c;
	usb_device_descriptor_t usbdd;

	fd = open ("/dev/ugen0", O_RDWR);
	if (fd  == -1)
		{ perror ("Open ugen0"); exit(1); }

	err = ioctl(fd, USB_GET_DEVICE_DESC, &usbdd);
	if (err == -1)
		{ perror ("Get device descriptor"); exit(1); }

	rfd = open ("/dev/ugen0.1", O_RDONLY|O_NONBLOCK);
	if (rfd == -1)
		{ perror ("Open ugen0.1"); exit(1); }
	iov = 1;
	err = ioctl (rfd, USB_SET_SHORT_XFER, &iov);
	if (err == -1)
		{ perror ("Set short XFER"); exit(1); }

	iov = 5000;
	err = ioctl (rfd,  USB_SET_TIMEOUT, &iov);
	if (err == -1)
		{ perror ("Set Timeout"); exit(1); }

	wfd = open ("/dev/ugen0.2", O_WRONLY);
	if (wfd == -1)
		{ perror ("Open ugen0.2"); exit(1); }

	err = write (wfd, init1, 4);
	if (err != 4)
		{ perror ("Write init1"); exit(1); }
	err = write (wfd, init2, 7);
	if (err != 7)
		{ perror ("Write init2"); exit(1); }

   while (read (rfd, &c, 1)) putchar (c);
}
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031213194940.44073338.steve>