From: Marcel Holtmann <marcel@holtmann.org>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] [DBUS Patch] Device Property
Date: Tue, 13 Dec 2005 23:03:05 +0100 [thread overview]
Message-ID: <1134511385.24447.15.camel@blade> (raw)
In-Reply-To: <3013cac80512130927k1d83978ey33be0540e15a08ba@mail.gmail.com>
Hi Eduardo,
> here is the patch with the send_property_changed_signal function included.
nice, but please follow the coding style. I don't wanna correct the
whitespaces in all patches. Some examples what should be changed:
(void*)&pdata ==> (void *) &pdata
= SCAN_PAGE|SCAN_INQUIRY; ==> = SCAN_PAGE | SCAN_INQUIRY;
se = (rp.enable & SCAN_PAGE)?1:0; se = (rp.enable & SCAN_PAGE) ? 1 : 0;
This is also bad coding style:
if (dd < 0) {
syslog(LOG_ERR, "HCI device open failed: hci%d", id);
goto failed;
} else {
We don't need the else branch. I results in an needless indentation.
I also think that we need some more newlines in your code, but I am
going to fix it when applying the patch.
This part might work, but I don't like it:
if (ispscan) {
if (scan && !(rp.enable & SCAN_PAGE))
enable = (rp.enable & SCAN_INQUIRY) | SCAN_PAGE;
else if (!scan && (rp.enable & SCAN_PAGE))
enable = (rp.enable & SCAN_INQUIRY);
else {
reply = dbus_message_new_method_return(msg);
goto failed;
}
} else {
if (scan && !(rp.enable & SCAN_INQUIRY))
enable = (rp.enable & SCAN_PAGE) | SCAN_INQUIRY;
else if (!scan && (rp.enable & SCAN_INQUIRY))
enable = (rp.enable & SCAN_PAGE);
else {
reply = dbus_message_new_method_return(msg);
goto failed;
}
}
And this includes this:
if((rp.enable & SCAN_PAGE) != (old_data & SCAN_PAGE)) {
se = (rp.enable & SCAN_PAGE)?1:0;
send_property_changed_signal(id, DEV_PROPERTY_PSCAN, DBUS_TYPE_BOOLEAN, &se);
}
if ((rp.enable & SCAN_INQUIRY) != (old_data & SCAN_INQUIRY)) {
se = (rp.enable & SCAN_INQUIRY)?1:0;
send_property_changed_signal(id, DEV_PROPERTY_ISCAN, DBUS_TYPE_BOOLEAN, &se);
}
dbus_connection_flush(connection);
I don't have any better idea to solve this at the moment, but if you
read this code it takes too much time too understand what it is actually
doing. And normally this is not a good idea. However we might fix it
later and get the patch in now for further testing. So please correct
the other parts and resend it.
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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2005-12-13 22:03 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-04 14:03 [Bluez-devel] [DBUS Patch] Device Property Eduardo Rocha
2005-11-04 15:44 ` Marcel Holtmann
2005-11-08 20:41 ` Claudio Takahasi
2005-11-08 22:20 ` Marcel Holtmann
2005-11-08 22:20 ` Johan Hedberg
2005-11-08 22:38 ` Marcel Holtmann
2005-11-17 19:16 ` Eduardo Rocha
2005-11-17 20:52 ` Eduardo Rocha
2005-11-18 8:28 ` Johan Hedberg
2005-11-18 10:51 ` Eduardo Rocha
2005-11-18 11:26 ` Johan Hedberg
2005-11-18 13:00 ` Eduardo Rocha
2005-11-22 11:51 ` Marcel Holtmann
2005-11-22 19:52 ` Eduardo Rocha
2005-11-24 4:17 ` Marcel Holtmann
2005-11-24 18:50 ` Eduardo Rocha
2005-11-24 22:54 ` Marcel Holtmann
2005-11-25 13:47 ` Claudio Takahasi
2005-11-25 14:32 ` Eduardo Rocha
2005-11-25 18:08 ` Marcel Holtmann
2005-11-25 18:34 ` Eduardo Rocha
2005-11-25 18:41 ` Marcel Holtmann
2005-11-25 19:52 ` Claudio Takahasi
2005-11-25 20:06 ` Marcel Holtmann
2005-12-01 16:55 ` Eduardo Rocha
2005-12-01 21:05 ` Marcel Holtmann
2005-12-07 12:29 ` Eduardo Rocha
2005-12-07 12:55 ` Johan Hedberg
2005-12-07 13:02 ` Marcel Holtmann
2005-12-07 16:01 ` Eduardo Rocha
2005-12-13 17:27 ` Eduardo Rocha
2005-12-13 22:03 ` Marcel Holtmann [this message]
2005-12-14 19:02 ` Eduardo Rocha
2005-12-16 18:37 ` Eduardo Rocha
2005-12-16 18:40 ` Marcel Holtmann
2005-11-25 16:51 ` Johan Hedberg
2005-11-25 18:12 ` 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=1134511385.24447.15.camel@blade \
--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).