From: "Dominic Sacré" <dominic.sacre@gmx.de>
To: linux-bluetooth@vger.kernel.org
Subject: Polling in rfcomm listen
Date: Wed, 17 Jun 2009 15:28:31 +0200 [thread overview]
Message-ID: <200906171528.31651.dominic.sacre@gmx.de> (raw)
Hi,
I'm trying to use "rfcomm listen" (or "rfcomm watch") to run a command as
soon as a client connects. The problem is that after starting the command,
rfcomm enters a loop which continually calls ppoll() with a timeout of 200
nanoseconds. This causes a very high CPU load, and also a chirping noise on
my laptop, presumably from ther CPU entering a power save mode, and
immediately being woken up again.
Is there any reason to use such an extremely short timeout? I tried
replacing the timeout with 2 milliseconds (that's 10000 times the original
value...), and rfcomm works much better now. Probably even higher values
would work.
Another issue is that occasionally, the command started by rfcomm fails to
open /dev/rfcomm0. Apparently rfcomm starts the command before the device is
properly created and its permissions set?
Regards,
Dominic
reply other threads:[~2009-06-17 13:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200906171528.31651.dominic.sacre@gmx.de \
--to=dominic.sacre@gmx.de \
--cc=linux-bluetooth@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