From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aras Vaichas Date: Wed, 13 Aug 2008 04:04:31 +0000 Subject: Bluetooth wireless activity triggers udev rule Message-Id: <48A25D4F.3000807@magtech.com.au> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Hi, I'm currently integrating runit and udev. I have a udev rule which runs my Blue-Z startup scripts when I plug in the USB BT dongle: ACTION=3D"add", ENV{SUBSYSTEM}=3D"bluetooth", RUN+=3D"/usr/bin/sv up blueto= oth" This works really well, cold plugging, etc. No problems. I've found an interesting quirk though. Here is the sequence of events: Computer A: I start up my system with the BT dongle inserted, the Blue-Z scripts are started via udev coldplugging script Computer B: I set up a task which searches for BT devices and tries to form a PPP connection Computer B: Detects the BT dongle on Computer A, records the address and forms a PPP connection Computer A: I disable the Blue-Z scripts # sv down bluetooth Computer B: Attempts to connect to A again, and sends a BT signal to connect ... Computer A: The BT dongle sends a wireless wakeup (wake-on-lan?) signal which causes udev to run the Blue-Z utils startup script again ... I looked at the udev events to see what was happening when Computer B tried to connect to Computer A. It appears that the two series of events are nearly identical. Can someone suggest a way for me to start the Blue-Z utils *only* when the USB dongle is *inserted* (or first detected). events caused by plugging in USB Bluetooth dongle: UDEV [883613218.457062] add =20 /devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0 (bluetooth) UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0 SUBSYSTEM=3Dbluetooth SEQNUM17 UDEVD_EVENT=3D1 UDEV [883613231.342314] add =20 /devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F3D5F7205 (bluetooth) UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F= 3D5F7205 SUBSYSTEM=3Dbluetooth SEQNUM25 UDEVD_EVENT=3D1 Events caused by trying to connect to the USB Bluetooth dongle from another Bluetooth device: UDEV [883613131.133343] add =20 /devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F3D5F7205 (bluetooth) UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F= 3D5F7205 SUBSYSTEM=3Dbluetooth SEQNUM)5 UDEVD_EVENT=3D1 Aras Vaichas ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________