From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: ID_SERIAL for udev bluetooth joystick events Date: Mon, 7 Feb 2011 23:48:42 -0800 Message-ID: <20110208074842.GC865@core.coreip.homeip.net> References: <20110204233427.09b32d7e.ospite@studenti.unina.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-yx0-f174.google.com ([209.85.213.174]:52249 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850Ab1BHHst (ORCPT ); Tue, 8 Feb 2011 02:48:49 -0500 Content-Disposition: inline In-Reply-To: <20110204233427.09b32d7e.ospite@studenti.unina.it> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Antonio Ospite Cc: linux-bluetooth@vger.kernel.org, linux-input@vger.kernel.org, Alan Ott On Fri, Feb 04, 2011 at 11:34:27PM +0100, Antonio Ospite wrote: > Hi, > > I have a question about udev events generated by a bluetooth joystick: > when the bt joystick generates the joystick event, the ID_SERIAL > property matches the one of the bt adapter not the one of the joystick. > > For example (using "udevadm monitor --property"), when connecting the > Sony Sixaxis via usb I get: > ID_SERIAL=Sony_PLAYSTATION_R_3_Controller > in the input and joystick events, but when I connect it via bt, I get: > ID_SERIAL=Broadcom_Corp_ANYCOM_Blue_USB-200_250 > which matches my bluetooth adapter. > > Is this expected/known, or is it a bug? > I am using kernel 2.6.37, udev 164 > > For the records, I also get ID_BUS=usb when connecting via bt, but I can > live with that since I can differenciate usb and bt operation using > ID_USB_DRIVER=usbhid > versus > ID_USB_DRIVER=btusb > > Some insight of what I am trying to achieve with udev: > 1. Monitor new joystick devices. > 2. If ID_SERIAL != Sony_PLAYSTATION_R_3_Controller, then STOP. > 3. Get the associated hidraw device node navigating the event tree. > 4. Set leds using the value from the ID_INPUT_JOYSTICK property. > 5. If ID_USB_DRIVER=usbhid do the needed pairing. > > And with the current behaviour for ID_SERIAL I cannot enforce 2. > I could listen for the (hid) event and use HID_NAME which seems to be a > little more consistent: > usb -> HID_NAME=Sony PLAYSTATION(R)3 Controller > bt -> HID_NAME=PLAYSTATION(R)3 Controller > and navigate the event hierarchy to get ID_INPUT_JOYSTICK, but that is > slightly more complicated, and I am curious about the ID_SERIAL > behavior anyways :) This should be directed to udev list as composition of ID_SERIAL is done exclusively by udev. It looks like it scans parent till it finds first USB device (thus skipping all BT-specific data). Thanks. -- Dmitry