From: Marcel Holtmann <marcel@holtmann.org>
To: James Cameron <james.cameron@hp.com>
Cc: Albert Huang <ashuang@gmail.com>,
BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] how to do asynchronous device inquiry?
Date: Wed, 30 Jun 2004 11:09:34 +0200 [thread overview]
Message-ID: <1088586574.22940.13.camel@pegasus> (raw)
In-Reply-To: <20040630014836.GI15948@hp.com>
Hi James,
> > > You could certainly fork() a process to exec() hcitool, and when it
> > > finishes it could send the information to your program, through a pipe
> > > that your program is select()ing on, or something similar.
> >
> > very bad idea :(
>
> Aww, it's just another way to do it, that doesn't require as much
> dependency or learning. ;-)
It is not fork() that is bad. It the combination of exec() and hcitool
you propose to use. If you fork or use a thread then use hci_inquiry().
> > You don't looked into the details. The inquiry ioctl() is one way. The
> > other one is the HCI raw socket. Open and bind a device and then set an
> > event filter on it. Send an inquiry command according to the spec. and
> > listen for the incoming inquiry result events.
>
> I stand corrected.
>
> Albert, there is a good example of this in src/btctl-discovery-source.c
> in the libbtctl-0.4.1 package.
> http://usefulinc.com/software/gnome-bluetooth/
>
> btctl_discovery_source_new()
> The hci device is opened, then set O_NONBLOCK, and the event filters are
> set. There's no sign of binding.
If you use hci_open_dev() the binding is done by that call.
Regards
Marcel
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2004-06-30 9:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-29 2:43 [Bluez-devel] how to do asynchronous device inquiry? Albert Huang
2004-06-29 4:33 ` James Cameron
2004-06-29 21:37 ` Marcel Holtmann
2004-06-30 1:48 ` James Cameron
2004-06-30 9:09 ` Marcel Holtmann [this message]
2004-06-29 9:21 ` Marcel Holtmann
2004-06-29 18:30 ` Albert Huang
2004-06-29 21:50 ` Marcel Holtmann
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=1088586574.22940.13.camel@pegasus \
--to=marcel@holtmann.org \
--cc=ashuang@gmail.com \
--cc=bluez-devel@lists.sourceforge.net \
--cc=james.cameron@hp.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.