From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 8 22:33:34 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55C4F16A4CE for ; Fri, 8 Apr 2005 22:33:34 +0000 (GMT) Received: from mailgate1b.savvis.net (mailgate1b.savvis.net [216.91.182.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id D43B043D2F for ; Fri, 8 Apr 2005 22:33:33 +0000 (GMT) (envelope-from Maksim.Yevmenkin@savvis.net) Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate1b.savvis.net (Postfix) with ESMTP id 2E2AC3C162; Fri, 8 Apr 2005 17:33:33 -0500 (CDT) Received: from mailgate1b.savvis.net ([127.0.0.1]) by localhost (mailgate1b.savvis.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14639-01-68; Fri, 8 Apr 2005 17:33:33 -0500 (CDT) Received: from out001.email.savvis.net (out001.apptix.savvis.net [216.91.32.44]) by mailgate1b.savvis.net (Postfix) with ESMTP id 028483BEBF; Fri, 8 Apr 2005 17:33:33 -0500 (CDT) Received: from s228130hz1ew171.apptix-01.savvis.net ([10.146.4.29]) by out001.email.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Fri, 8 Apr 2005 17:33:11 -0500 Received: from [10.254.186.111] ([66.35.239.94]) by s228130hz1ew171.apptix-01.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Fri, 8 Apr 2005 17:32:57 -0500 Message-ID: <42570698.4070205@savvis.net> Date: Fri, 08 Apr 2005 15:32:56 -0700 From: Maksim Yevmenkin User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040822 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Gilbert References: <16982.46075.115518.130213@canoe.dclg.ca> <4256B5EB.9080506@savvis.net> <16982.47024.135663.645297@canoe.dclg.ca> <20050408190514.GS96690@cicely12.cicely.de> <16983.465.572693.73195@canoe.dclg.ca> In-Reply-To: <16983.465.572693.73195@canoe.dclg.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Apr 2005 22:32:57.0846 (UTC) FILETIME=[E9F88960:01C53C8A] X-Virus-Scanned: amavisd-new at savvis.net cc: freebsd-hackers@freebsd.org cc: ticso@cicely.de Subject: Re: Tricky USB device. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2005 22:33:34 -0000 David, > Bernd> Then it really shouldn't have claimed to be one in the > Bernd> interface descriptor :( But the HID specification is more today > Bernd> than just _human_ interface. e.g. there are extensions for > Bernd> USV, ... > > [...] > > Bernd> Has this device multiple interfaces? e.g. one HID and another > Bernd> as described. I often thought about getting ugen working at > Bernd> interface level too. > > Here's the output of udesc_dump on it. Right now, using the current > version of libusb (not the version from ports), I can use > usb_interrupt_write(dev, 1, "MK255", 5, 0) to send data to it --- and > the data is sent --- at least lights on the USB hub flash. If I > replace '1' with anything else, it doesn't accept it. However, it > doesn't seem to have opened the relays. hmm... why even use libusb? cant you just "fd = open("/dev/ugen0.1", O_RDWR);" and then "write(fd, "MK255", 5)" and "read(fd, ...);". note: here i assume ugen0 is the device. > I'm also not entirely clear how/when to use usb_interrupt_read() > ... as many of the commands listed in the manual return data, but > usb_inerrupt_write() doesn't seem to allow for data to be returned, > but following usb_interrupt_write(), the read will hang. i'd guess you have to keep read pipe open at all times. that is what "fd = open("/dev/ugen0.1", O_RDWR);" will do - it will open both read and write pipes (because of O_RDWR). then you just write(fd, ...); read(fd, ...); max