linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aras Vaichas <arasv@magtech.com.au>
To: linux-hotplug@vger.kernel.org
Subject: Bluetooth wireless activity triggers udev rule
Date: Wed, 13 Aug 2008 04:04:31 +0000	[thread overview]
Message-ID: <48A25D4F.3000807@magtech.com.au> (raw)

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="add", ENV{SUBSYSTEM}="bluetooth", RUN+="/usr/bin/sv up bluetooth"

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     
/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0 (bluetooth)
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0
SUBSYSTEM=bluetooth
SEQNUM17
UDEVD_EVENT=1

UDEV  [883613231.342314] add     
/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F3D5F7205
(bluetooth)
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F3D5F7205
SUBSYSTEM=bluetooth
SEQNUM25
UDEVD_EVENT=1



Events caused by trying to connect to the USB Bluetooth dongle from
another Bluetooth device:

UDEV  [883613131.133343] add     
/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F3D5F7205
(bluetooth)
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/platform/at91_ohci/usb1/1-1/1-1.2/1-1.2:1.0/hci0/acl000F3D5F7205
SUBSYSTEM=bluetooth
SEQNUM)5
UDEVD_EVENT=1


Aras Vaichas


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

             reply	other threads:[~2008-08-13  4:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13  4:04 Aras Vaichas [this message]
2008-08-13  6:46 ` Bluetooth wireless activity triggers udev rule Aras Vaichas
2008-08-13  8:58 ` Kay Sievers
2008-08-14  0:09 ` Aras Vaichas
2008-08-14 12:31 ` Sujit Karataparambil
2008-08-15  0:56 ` Aras Vaichas
2008-08-15  2:50 ` Sujit Karataparambil
2008-08-15  3:19 ` Aras Vaichas
2008-08-17 11:43 ` Sujit Karataparambil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48A25D4F.3000807@magtech.com.au \
    --to=arasv@magtech.com.au \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).