Date: Fri, 11 Jan 2008 18:50:58 +0100 From: Hans Petter Selasky <hselasky@c2i.net> To: perryh@pluto.rain.com Cc: freebsd-usb@freebsd.org Subject: Re: ZyXEL Omni 56K Plus USB/serial modem Message-ID: <200801111850.59173.hselasky@c2i.net> In-Reply-To: <47871344.bvH7YPY9QJF3xIgB%perryh@pluto.rain.com> References: <477a00ea.73gFojnRSqtUufCO%perryh@pluto.rain.com> <200801101638.19620.hselasky@c2i.net> <47871344.bvH7YPY9QJF3xIgB%perryh@pluto.rain.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 11 January 2008, perryh@pluto.rain.com wrote: > > > > To me it looks like they are using some kind of propritary > > > > protocol. You could try and see if any of the endpoints, > > > > which appear like /dev/ugen0.x files respond with "OK" when > > > > you send "AT\r\n" to the endpoint ... > > > > > > How would I go about doing that? > > > > I think the best will be to write a small C-program: > > > > Here is the basic: > > > > ... > > Either the device doesn't like this sort of thing, > or I did something wrong: > > # ls -l /dev/ugen* > crw-r--r-- 1 root operator 1, 15 Nov 24 21:17 /dev/ugen0 > crw-r--r-- 1 root operator 1, 16 Nov 24 21:17 /dev/ugen0.1 > crw-r--r-- 1 root operator 1, 17 Nov 24 21:17 /dev/ugen0.2 > crw-r--r-- 1 root operator 1, 18 Nov 24 21:17 /dev/ugen0.3 > crw-r--r-- 1 root operator 1, 19 Nov 24 21:17 /dev/ugen0.4 Hi, It is strange that you cannot open "/dev/ugen0.X". And you are running the application like root ? And what happens if you do "cat /dev/ugen0.1 > /dev/null" ? --HPS > > Not sure where that Nov 24 date comes from -- > I just plugged the modem in a couple of days ago. > They do go away when I turn it off, and then come > back (still dated 11/24) when I turn it back on. > > # ./usbEpProbe /dev/ugen0.1 > usbEpProbe: Cannot open '/dev/ugen0.1': Device not configured > # ./usbEpProbe /dev/ugen0.2 > usbEpProbe: Cannot open '/dev/ugen0.2': Device not configured > # ./usbEpProbe /dev/ugen0.3 > usbEpProbe: Cannot open '/dev/ugen0.3': Device not configured > # ./usbEpProbe /dev/ugen0.4 > usbEpProbe: Cannot open '/dev/ugen0.4': Device not configured > # ./usbEpProbe /dev/ugen0 > usbEpProbe: Cannot set short XFER > > : Invalid argument > > # cat usbEpProbe.c > #include <stdio.h> > #include <sys/fcntl.h> > #include <sys/ioctl.h> > #include <dev/usb/usb.h> > > #define STIMULUS "AT\r\n" > > main(int argc, char *argv[]) > { > int f, error, count; > char buf[4]; > > if (argc != 2) { > err(1, "Usage: %s /dev/ugen0.[1-4]", argv[0]); > } > > f = open(argv[1], O_RDWR); > if (f < 0) { > err(1, "Cannot open '%s'", argv[1]); > } > > /* allow short transfers */ > error = 1; > error = ioctl(f, USB_SET_SHORT_XFER, &error); > if (error < 0) { > err(1, "Cannot set short XFER\n"); > } > > error = 1000; > error = ioctl(f, USB_SET_TIMEOUT, &error); > if (error < 0) { > err(1, "Cannot set timeout"); > } > > error = write(f, STIMULUS, sizeof(STIMULUS)-1); > > for ( count = 0 ; ; ++count ) { > error = read(f, buf, 1); > if (error > 0) > printf("%c", buf[0]); > else > break; > } > printf("\ngot %d bytes\n", count); > }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801111850.59173.hselasky>