From: Marcel Holtmann <marcel@holtmann.org>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] [DBUS PATCH] scan mode
Date: Tue, 14 Feb 2006 13:51:26 +0100 [thread overview]
Message-ID: <1139921486.21873.18.camel@localhost> (raw)
In-Reply-To: <e1effdeb0602140426x662ffa26id1fb386397280da8@mail.gmail.com>
Hi Claudio,
> > I applied the patch to keep it going, but we need to rework the data
> > object associated with the device path. Using it like this
> >
> > const uint8_t hci_mode = dbus_data->path_data;
> >
> > won't work forever and actually it is bad coding.
>
> I don't know exactly what is problem, but I guess it should be related
> to uint32 to uint8 casting.
the casting is not that big problem. It is a misuse of the variable,
because the name is not clear. In other code paths you might use the
path_data variable too and then it clashes. These things are really hard
to debug.
> I will change the path_data to a device settings structure, where I
> want store the scan mode and the discoverable timeout. In my opinion
> the discoverable timeout should be unique for each local adapter. Do
> you have any comments or suggestion?
>
>
> struct device_settings {
> uint32_t discoverable_to;
> uint8_t scan_mode;
> };
>
> struct hci_dbus_data {
> uint16_t dev_id;
> uint16_t path_id;
> struct device_settings dev_settings;
> };
I don't see any need for another nested structure. Actually I would
prefer using something like this:
struct hci_dbus_data {
uint16_t dev_id;
uint16_t path_id;
uint8_t mode;
uint32_t discoverable_timeout;
}
> I am planning use the SIGALARM. Another option is integrate inside the
> main loop, using a poll timeout. However it is a little bit more
> complicated.
In the end we might need to integrate it into the main loop, because
this looks like the cleanest approach to me. However for now it might be
enough to use SIGALARM.
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
prev parent reply other threads:[~2006-02-14 12:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-13 17:50 [Bluez-devel] [DBUS PATCH] scan mode Claudio Takahasi
2006-02-14 7:40 ` Marcel Holtmann
2006-02-14 12:26 ` Claudio Takahasi
2006-02-14 12:51 ` Marcel Holtmann [this message]
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=1139921486.21873.18.camel@localhost \
--to=marcel@holtmann.org \
--cc=bluez-devel@lists.sourceforge.net \
/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).