* [Bluez-devel] [PATCH] dbus.c cleanup
@ 2005-10-29 17:53 Johan Hedberg
2005-10-29 18:07 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-10-29 17:53 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
Hi,
Here's a cleanup patch for the hcid dbus code. It changes several
sprintf calls to snprintf (better to risk string truncation than buffer
overflow), as well as removes unecessary byte parameters from the replys
of periodic inquiry methods.
Johan
[-- Attachment #2: dbus-cleanup.patch --]
[-- Type: text/plain, Size: 5104 bytes --]
Index: dbus.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus.c,v
retrieving revision 1.36
diff -u -r1.36 dbus.c
--- dbus.c 27 Oct 2005 17:08:13 -0000 1.36
+++ dbus.c 29 Oct 2005 17:44:37 -0000
@@ -886,12 +886,12 @@
for (; *fst_level; fst_level++) {
ptr1 = *fst_level;
- sprintf(snd_parent, "%s/%s", fst_parent, ptr1);
+ snprintf(snd_parent, sizeof(snd_parent), "%s/%s", fst_parent, ptr1);
if (dbus_connection_list_registered(connection, snd_parent, &snd_level)) {
if (!(*snd_level)) {
- sprintf(path, "%s/%s", MANAGER_PATH, ptr1);
+ snprintf(path, sizeof(path), "%s/%s", MANAGER_PATH, ptr1);
if (dbus_connection_get_object_path_data(connection,
path, &data)) {
@@ -909,7 +909,7 @@
for (; *snd_level; snd_level++) {
ptr2 = *snd_level;
- sprintf(path, "%s/%s/%s", MANAGER_PATH, ptr1, ptr2);
+ snprintf(path, sizeof(path), "%s/%s/%s", MANAGER_PATH, ptr1, ptr2);
if (dbus_connection_get_object_path_data(connection,
path, &data)) {
@@ -935,12 +935,12 @@
gboolean hcid_dbus_register_device(uint16_t id)
{
- char path[MAX_PATH_LENGTH+1];
- char dev[BLUETOOTH_DEVICE_NAME_LEN+1];
+ char path[MAX_PATH_LENGTH];
+ char dev[BLUETOOTH_DEVICE_NAME_LEN];
const char *pdev = dev;
- snprintf(dev, BLUETOOTH_DEVICE_NAME_LEN, HCI_DEVICE_NAME "%d", id);
- snprintf(path, MAX_PATH_LENGTH, "%s/%s", DEVICE_PATH, pdev);
+ snprintf(dev, sizeof(dev), HCI_DEVICE_NAME "%d", id);
+ snprintf(path, sizeof(path), "%s/%s", DEVICE_PATH, pdev);
/* register the default path*/
return register_dbus_path(path, id);
@@ -948,12 +948,12 @@
gboolean hcid_dbus_unregister_device(uint16_t id)
{
- char dev[BLUETOOTH_DEVICE_NAME_LEN+1];
- char path[MAX_PATH_LENGTH+1];
+ char dev[BLUETOOTH_DEVICE_NAME_LEN];
+ char path[MAX_PATH_LENGTH];
const char *pdev = dev;
- snprintf(dev, BLUETOOTH_DEVICE_NAME_LEN, HCI_DEVICE_NAME "%d", id);
- snprintf(path, MAX_PATH_LENGTH, "%s/%s", DEVICE_PATH, pdev);
+ snprintf(dev, sizeof(dev), HCI_DEVICE_NAME "%d", id);
+ snprintf(path, sizeof(path), "%s/%s", DEVICE_PATH, pdev);
return unregister_dbus_path(path);
}
@@ -986,7 +986,7 @@
goto failed;
}
- sprintf(dev, HCI_DEVICE_NAME "%d", id);
+ snprintf(dev, sizeof(dev), HCI_DEVICE_NAME "%d", id);
dbus_message_iter_init_append(message, &iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING ,&pdev);
@@ -1036,7 +1036,7 @@
goto failed;
}
- sprintf(dev, HCI_DEVICE_NAME "%d", id);
+ snprintf(dev, sizeof(dev), HCI_DEVICE_NAME "%d", id);
dbus_message_iter_init_append(message, &iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING ,&pdev);
@@ -1072,12 +1072,12 @@
/* register the default path*/
if (!dft_reg) {
- sprintf(path, "%s/%s/%s", MANAGER_PATH, HCI_DEFAULT_DEVICE_NAME, BLUEZ_HCI);
+ snprintf(path, sizeof(path), "%s/%s/%s", MANAGER_PATH, HCI_DEFAULT_DEVICE_NAME, BLUEZ_HCI);
register_dbus_path(path, DEFAULT_DEVICE_PATH_ID);
}
/* register the default path*/
- sprintf(path, "%s/%s%d/%s", MANAGER_PATH, HCI_DEVICE_NAME, id, BLUEZ_HCI);
+ snprintf(path, sizeof(path), "%s/%s%d/%s", MANAGER_PATH, HCI_DEVICE_NAME, id, BLUEZ_HCI);
register_dbus_path(path, id);
return 0;
@@ -1099,11 +1099,11 @@
char path[MAX_PATH_LENGTH];
if (unreg_dft) {
- sprintf(path, "%s/%s/%s", MANAGER_PATH, HCI_DEFAULT_DEVICE_NAME, BLUEZ_HCI);
+ snprintf(path, sizeof(path), "%s/%s/%s", MANAGER_PATH, HCI_DEFAULT_DEVICE_NAME, BLUEZ_HCI);
unregister_dbus_path(path);
}
- sprintf(path, "%s/%s%d/%s", MANAGER_PATH, HCI_DEVICE_NAME, id, BLUEZ_HCI);
+ snprintf(path, sizeof(path), "%s/%s%d/%s", MANAGER_PATH, HCI_DEVICE_NAME, id, BLUEZ_HCI);
unregister_dbus_path(path);
return ret;
@@ -1318,14 +1318,10 @@
syslog(LOG_ERR, "Can't send HCI commands:%s.", strerror(errno));
reply = bluez_new_failure_msg(msg, BLUEZ_ESYSTEM_OFFSET + errno);
goto failed;
- } else {
- uint8_t result = 0;
- /* return TRUE to indicate that operation was completed */
- reply = dbus_message_new_method_return(msg);
- dbus_message_iter_init_append(reply, &iter);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_BYTE ,&result);
}
+ reply = dbus_message_new_method_return(msg);
+
failed:
if (dd >= 0)
close(dd);
@@ -1335,7 +1331,6 @@
static DBusMessage* handle_cancel_periodic_inq_req(DBusMessage *msg, void *data)
{
- DBusMessageIter iter;
DBusMessage *reply = NULL;
struct hci_dbus_data *dbus_data = data;
int dd = -1;
@@ -1361,14 +1356,11 @@
if (hci_send_cmd(dd, OGF_LINK_CTL, OCF_EXIT_PERIODIC_INQUIRY, 0 , NULL) < 0) {
syslog(LOG_ERR, "Send hci command failed.");
reply = bluez_new_failure_msg(msg, BLUEZ_ESYSTEM_OFFSET + errno);
- } else {
- uint8_t result = 0;
- /* return TRUE to indicate that operation was completed */
- reply = dbus_message_new_method_return(msg);
- dbus_message_iter_init_append(reply, &iter);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_BYTE ,&result);
+ goto failed;
}
+ reply = dbus_message_new_method_return(msg);
+
failed:
if (dd >= 0)
close(dd);
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-29 17:53 [Bluez-devel] [PATCH] dbus.c cleanup Johan Hedberg
@ 2005-10-29 18:07 ` Marcel Holtmann
2005-10-29 18:48 ` Johan Hedberg
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-10-29 18:07 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> Here's a cleanup patch for the hcid dbus code. It changes several
> sprintf calls to snprintf (better to risk string truncation than buffer
> overflow), as well as removes unecessary byte parameters from the replys
> of periodic inquiry methods.
the patch is in the CVS now. Are there more cleanups coming? I think it
is time for the next release.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-29 18:07 ` Marcel Holtmann
@ 2005-10-29 18:48 ` Johan Hedberg
2005-10-29 19:07 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-10-29 18:48 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
On Sat, Oct 29, 2005, Marcel Holtmann wrote:
> the patch is in the CVS now. Are there more cleanups coming?
At least not from me. However I'm not sure about the INdT guys.
Johan
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-29 18:48 ` Johan Hedberg
@ 2005-10-29 19:07 ` Marcel Holtmann
2005-10-31 11:59 ` Claudio Takahasi
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-10-29 19:07 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> > the patch is in the CVS now. Are there more cleanups coming?
>
> At least not from me. However I'm not sure about the INdT guys.
I still consider the D-Bus interface as experimental and that we might
change it with further notification, but it will be good to have a new
release out there.
So I think that I will do some pending cleanups in the CVS and then
release a new version.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-29 19:07 ` Marcel Holtmann
@ 2005-10-31 11:59 ` Claudio Takahasi
2005-10-31 12:07 ` Johan Hedberg
2005-10-31 12:12 ` Marcel Holtmann
0 siblings, 2 replies; 27+ messages in thread
From: Claudio Takahasi @ 2005-10-31 11:59 UTC (permalink / raw)
To: bluez-devel
Hi,
I don't have cleanup patches to be sent. A new release can be good to
receive the users/developers feedback.
Some cleanups/improvements suggestions for the next release:
- find_conn is a shared function: put in a shared directory. It's used
by hcitool.c and dbus.c
- Disconnect signal: handle de disconnect signal sent when the
dbus-daemon exits.
- split dbus.c file:
- use session bus to send the PinRequest message: using the session
bus it's possible start the dbus pin helper application automatically
I think Eduardo is working on some services device configuration
services. Maybe it should be better wait his patch. I will ask him and
confirm soon.
Regards,
Claudio.
On 10/29/05, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Johan,
>
> > > the patch is in the CVS now. Are there more cleanups coming?
> >
> > At least not from me. However I'm not sure about the INdT guys.
>
> I still consider the D-Bus interface as experimental and that we might
> change it with further notification, but it will be good to have a new
> release out there.
>
> So I think that I will do some pending cleanups in the CVS and then
> release a new version.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-31 11:59 ` Claudio Takahasi
@ 2005-10-31 12:07 ` Johan Hedberg
2005-10-31 12:14 ` Marcel Holtmann
2005-10-31 12:12 ` Marcel Holtmann
1 sibling, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-10-31 12:07 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
On Mon, Oct 31, 2005, Claudio Takahasi wrote:
> - use session bus to send the PinRequest message: using the session
> bus it's possible start the dbus pin helper application automatically
I don't think that's the right thing or even a possible thing to do.
This is because hcid is a system-wide daemon and cannot know about users
session busses.
Johan
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-31 11:59 ` Claudio Takahasi
2005-10-31 12:07 ` Johan Hedberg
@ 2005-10-31 12:12 ` Marcel Holtmann
2005-10-31 13:47 ` Claudio Takahasi
1 sibling, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-10-31 12:12 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
> I don't have cleanup patches to be sent. A new release can be good to
> receive the users/developers feedback.
I have to do some other small fixes in other parts of bluez-utils, but
the release is actually planned for today.
> Some cleanups/improvements suggestions for the next release:
> - find_conn is a shared function: put in a shared directory. It's used
> by hcitool.c and dbus.c
I know, but this has time. Maybe you wanna move it into lib.c inside the
hcid directory first.
> - Disconnect signal: handle de disconnect signal sent when the
> dbus-daemon exits.
I have no idea what that means.
> - split dbus.c file:
> - use session bus to send the PinRequest message: using the session
> bus it's possible start the dbus pin helper application automatically
This sounds like a good idea. Is anybody working on it? However the
bluez-pin package needs to updated to support the latest D-Bus version,
because we don't support the D-Bus 0.23 anymore.
> I think Eduardo is working on some services device configuration
> services. Maybe it should be better wait his patch. I will ask him and
> confirm soon.
There is plenty of time after the release. I don't consider the current
D-Bus API as stable.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-31 12:07 ` Johan Hedberg
@ 2005-10-31 12:14 ` Marcel Holtmann
2005-10-31 12:30 ` Eduardo Rocha
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-10-31 12:14 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> > - use session bus to send the PinRequest message: using the session
> > bus it's possible start the dbus pin helper application automatically
>
> I don't think that's the right thing or even a possible thing to do.
> This is because hcid is a system-wide daemon and cannot know about users
> session busses.
so this is not working out. Then we still need a program that starts a
session time. Does anyone work on a Bluetooth applet for Gnome that will
also handle the PIN requests?
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-31 12:14 ` Marcel Holtmann
@ 2005-10-31 12:30 ` Eduardo Rocha
0 siblings, 0 replies; 27+ messages in thread
From: Eduardo Rocha @ 2005-10-31 12:30 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
I've implemented the DeviceList function from /org/bluez/Devices. I've
also made some code clean up in dbus.c. Right now I'm hunting a
segfault and as soon I have fixed this I'll send another patch.
BR,
Eduardo.
--
Eduardo Rocha
Instituto Nokia de Tecnologia - INdT
On 10/31/05, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Johan,
>
> > > - use session bus to send the PinRequest message: using the session
> > > bus it's possible start the dbus pin helper application automatically
> >
> > I don't think that's the right thing or even a possible thing to do.
> > This is because hcid is a system-wide daemon and cannot know about user=
s
> > session busses.
>
> so this is not working out. Then we still need a program that starts a
> session time. Does anyone work on a Bluetooth applet for Gnome that will
> also handle the PIN requests?
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-31 12:12 ` Marcel Holtmann
@ 2005-10-31 13:47 ` Claudio Takahasi
2005-11-01 13:11 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Claudio Takahasi @ 2005-10-31 13:47 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
Regarding the dbus pin helper app, I am trying develop a app using
python for test purpose, based on pygtk and pydbus. However, there is
an problem with asynchronous request, I sent an email to dbus mailing
list, but according with the received answer, I think will be not easy
implement the functionality that I want.
On 10/31/05, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Claudio,
>
> > I don't have cleanup patches to be sent. A new release can be good to
> > receive the users/developers feedback.
>
> I have to do some other small fixes in other parts of bluez-utils, but
> the release is actually planned for today.
>
> > Some cleanups/improvements suggestions for the next release:
> > - find_conn is a shared function: put in a shared directory. It's used
> > by hcitool.c and dbus.c
>
> I know, but this has time. Maybe you wanna move it into lib.c inside the
> hcid directory first.
[Claudio Takahasi]
Probably in the future when we start develop another features(rfcomm,
pan, ...) we will find more shared functions. I will put the find_conn
to a lib.c(inside de hcid) directory first according with your
suggestion. In the future we can discuss it later again.
Another file that I want create is the error.c
>
> > - Disconnect signal: handle de disconnect signal sent when the
> > dbus-daemon exits.
>
> I have no idea what that means.
[Claudio Takahasi]
When the dbus-daemon exits, the hcid will receive a "Disconnect"
signal. The hcid can start a task to re-establish the bus connection
each X seconds or it can exit.
Currently, hcid catches the signal, but there is no action associated
with this signal.
>
> > - split dbus.c file:
> > - use session bus to send the PinRequest message: using the session
> > bus it's possible start the dbus pin helper application automatically
>
> This sounds like a good idea. Is anybody working on it? However the
> bluez-pin package needs to updated to support the latest D-Bus version,
> because we don't support the D-Bus 0.23 anymore.
[Claudio Takahasi]
I updated the bluez-pin perform authentication tests. I will analize
it and send
a patch to fix it.
>
> > I think Eduardo is working on some services device configuration
> > services. Maybe it should be better wait his patch. I will ask him and
> > confirm soon.
>
> There is plenty of time after the release. I don't consider the current
> D-Bus API as stable.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-10-31 13:47 ` Claudio Takahasi
@ 2005-11-01 13:11 ` Marcel Holtmann
2005-11-01 13:21 ` Claudio Takahasi
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-01 13:11 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
> Probably in the future when we start develop another features(rfcomm,
> pan, ...) we will find more shared functions. I will put the find_conn
> to a lib.c(inside de hcid) directory first according with your
> suggestion. In the future we can discuss it later again.
> Another file that I want create is the error.c
send me a separate patch for the move to the lib.c file.
What do you wanna put into the error.c file. Explain me your idea behind
it and the benefits.
> When the dbus-daemon exits, the hcid will receive a "Disconnect"
> signal. The hcid can start a task to re-establish the bus connection
> each X seconds or it can exit.
> Currently, hcid catches the signal, but there is no action associated
> with this signal.
I see and it seems we need a patch to deal with the dbus-daemon exits in
case of restarts or errors in it. Please come up with a patch for it.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-01 13:11 ` Marcel Holtmann
@ 2005-11-01 13:21 ` Claudio Takahasi
2005-11-01 19:08 ` Claudio Takahasi
0 siblings, 1 reply; 27+ messages in thread
From: Claudio Takahasi @ 2005-11-01 13:21 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
I will wait the D-Bus path changes before submit this changes.
Regarding the error.c file it's just organization, I would like move
all error related function to other file.
Regards,
Claudio
On 11/1/05, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Claudio,
>
> > Probably in the future when we start develop another features(rfcomm,
> > pan, ...) we will find more shared functions. I will put the find_conn
> > to a lib.c(inside de hcid) directory first according with your
> > suggestion. In the future we can discuss it later again.
> > Another file that I want create is the error.c
>
> send me a separate patch for the move to the lib.c file.
>
> What do you wanna put into the error.c file. Explain me your idea behind
> it and the benefits.
>
> > When the dbus-daemon exits, the hcid will receive a "Disconnect"
> > signal. The hcid can start a task to re-establish the bus connection
> > each X seconds or it can exit.
> > Currently, hcid catches the signal, but there is no action associated
> > with this signal.
>
> I see and it seems we need a patch to deal with the dbus-daemon exits in
> case of restarts or errors in it. Please come up with a patch for it.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-01 13:21 ` Claudio Takahasi
@ 2005-11-01 19:08 ` Claudio Takahasi
2005-11-01 19:58 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Claudio Takahasi @ 2005-11-01 19:08 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 2615 bytes --]
Hi,
here is patch to move the find_conn function to lib.c file.
Regarding the error related functions, can I move to a error.c file or
it's better keep them in the dbus.c?
Another point is the Disconnect signal. Which approach you preffer
exit or create a timer to re-connect each x seconds?
IMHO, I think it not necessary handle this scenario. Restart the
dbus-daemon is not common.
Regards,
Claudio.
On 11/1/05, Claudio Takahasi <cktakahasi@gmail.com> wrote:
> Hi Marcel,
>
> I will wait the D-Bus path changes before submit this changes.
>
> Regarding the error.c file it's just organization, I would like move
> all error related function to other file.
>
> Regards,
> Claudio
>
>
> On 11/1/05, Marcel Holtmann <marcel@holtmann.org> wrote:
> > Hi Claudio,
> >
> > > Probably in the future when we start develop another features(rfcomm,
> > > pan, ...) we will find more shared functions. I will put the find_conn
> > > to a lib.c(inside de hcid) directory first according with your
> > > suggestion. In the future we can discuss it later again.
> > > Another file that I want create is the error.c
> >
> > send me a separate patch for the move to the lib.c file.
> >
> > What do you wanna put into the error.c file. Explain me your idea behind
> > it and the benefits.
> >
> > > When the dbus-daemon exits, the hcid will receive a "Disconnect"
> > > signal. The hcid can start a task to re-establish the bus connection
> > > each X seconds or it can exit.
> > > Currently, hcid catches the signal, but there is no action associated
> > > with this signal.
> >
> > I see and it seems we need a patch to deal with the dbus-daemon exits in
> > case of restarts or errors in it. Please come up with a patch for it.
> >
> > Regards
> >
> > Marcel
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by the JBoss Inc.
> > Get Certified Today * Register for a JBoss Training Course
> > Free Certification Exam for All Training Attendees Through End of 2005
> > Visit http://www.jboss.com/services/certification for more information
> > _______________________________________________
> > Bluez-devel mailing list
> > Bluez-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bluez-devel
> >
>
>
> --
> ---------------------------------------------------------
> Claudio Takahasi
> Instituto Nokia de Tecnologia - INdT
>
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
[-- Attachment #2: find_conn.patch --]
[-- Type: text/x-patch, Size: 2839 bytes --]
--- bluez-utils-cvs.orig/hcid/hcid.h 2005-11-01 14:41:12.000000000 -0200
+++ bluez-utils-cvs-hcid/hcid/hcid.h 2005-11-01 14:44:08.000000000 -0200
@@ -23,10 +23,6 @@
*
*/
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
@@ -153,32 +149,3 @@
int read_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key);
int read_pin_code(bdaddr_t *local, bdaddr_t *peer, char *pin);
-static inline int find_conn(int dd, int dev_id, long arg)
-{
- struct hci_conn_list_req *cl;
- struct hci_conn_info *ci;
- int i;
-
- cl = malloc(10 * sizeof(*ci) + sizeof(*cl));
- if (!cl) {
- syslog(LOG_ERR, "Can't allocate memory");
- return 0;
- }
-
- cl->dev_id = dev_id;
- cl->conn_num = 10;
- ci = cl->conn_info;
-
- if (ioctl(dd, HCIGETCONNLIST, (void *) cl)) {
- syslog(LOG_ERR, "Can't get connection list");
- return 0;
- }
-
- for (i = 0; i < cl->conn_num; i++, ci++)
- if (!bacmp((bdaddr_t *) arg, &ci->bdaddr))
- return 1;
-
- free(cl);
-
- return 0;
-}
--- bluez-utils-cvs.orig/hcid/dbus.c 2005-11-01 14:41:12.000000000 -0200
+++ bluez-utils-cvs-hcid/hcid/dbus.c 2005-11-01 14:39:02.000000000 -0200
@@ -29,6 +29,7 @@
#include <errno.h>
#include <unistd.h>
#include <string.h>
+#include <signal.h>
#include <syslog.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -42,6 +43,7 @@
#include "glib-ectomy.h"
#include "hcid.h"
+#include "lib.h"
#include "dbus.h"
static DBusConnection *connection;
--- bluez-utils-cvs.orig/hcid/lib.h 2005-11-01 14:41:12.000000000 -0200
+++ bluez-utils-cvs-hcid/hcid/lib.h 2005-11-01 15:17:50.000000000 -0200
@@ -25,6 +25,8 @@
#include <errno.h>
+int find_conn(int dd, int dev_id, long arg);
+
char *expand_name(char *dst, int size, char *str, int dev_id);
char *get_host_name(void);
--- bluez-utils-cvs.orig/hcid/lib.c 2005-11-01 14:41:12.000000000 -0200
+++ bluez-utils-cvs-hcid/hcid/lib.c 2005-11-01 15:22:12.000000000 -0200
@@ -34,6 +34,8 @@
#include <stdarg.h>
#include <string.h>
#include <signal.h>
+#include <sys/ioctl.h>
+#include <syslog.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
@@ -45,6 +47,36 @@
volatile sig_atomic_t __io_canceled;
+int find_conn(int dd, int dev_id, long arg)
+{
+ struct hci_conn_list_req *cl;
+ struct hci_conn_info *ci;
+ int i;
+
+ cl = malloc(10 * sizeof(*ci) + sizeof(*cl));
+ if (!cl) {
+ syslog(LOG_ERR, "Can't allocate memory");
+ return 0;
+ }
+
+ cl->dev_id = dev_id;
+ cl->conn_num = 10;
+ ci = cl->conn_info;
+
+ if (ioctl(dd, HCIGETCONNLIST, (void *) cl)) {
+ syslog(LOG_ERR, "Can't get connection list");
+ return 0;
+ }
+
+ for (i = 0; i < cl->conn_num; i++, ci++)
+ if (!bacmp((bdaddr_t *) arg, &ci->bdaddr))
+ return 1;
+
+ free(cl);
+
+ return 0;
+}
+
/*
* Device name expansion
* %d - device id
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-01 19:08 ` Claudio Takahasi
@ 2005-11-01 19:58 ` Marcel Holtmann
2005-11-01 20:23 ` Johan Hedberg
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-01 19:58 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
> here is patch to move the find_conn function to lib.c file.
I just realized that I already moved it out of dbus.c and so lets keep
it in hcid as inline function for now.
> Regarding the error related functions, can I move to a error.c file or
> it's better keep them in the dbus.c?
At the moment, I think it is better to keep them there. I don't have any
real opinion at the moment and so it might be better not to move to much
code around.
> Another point is the Disconnect signal. Which approach you preffer
> exit or create a timer to re-connect each x seconds?
We should try to re-connect. The security is still running and so we
can't exit.
> IMHO, I think it not necessary handle this scenario. Restart the
> dbus-daemon is not common.
Every time you update your D-Bus installation. The Ubuntu guys even
popup a message box that you should reboot your system ;)
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-01 19:58 ` Marcel Holtmann
@ 2005-11-01 20:23 ` Johan Hedberg
2005-11-01 20:40 ` Marcel Holtmann
2005-11-01 20:53 ` Claudio Takahasi
0 siblings, 2 replies; 27+ messages in thread
From: Johan Hedberg @ 2005-11-01 20:23 UTC (permalink / raw)
To: bluez-devel
On Tue, Nov 01, 2005, Marcel Holtmann wrote:
> > IMHO, I think it not necessary handle this scenario. Restart the
> > dbus-daemon is not common.
>
> Every time you update your D-Bus installation. The Ubuntu guys even
> popup a message box that you should reboot your system ;)
At least in debian there's a /etc/dbus-1/event.d directory where scripts
are automatically run when the dbus daemons starts or stops. E.g. hal
installs its own script there for starting/stoping hald at the right
moment.
Johan
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-01 20:23 ` Johan Hedberg
@ 2005-11-01 20:40 ` Marcel Holtmann
2005-11-01 20:53 ` Claudio Takahasi
1 sibling, 0 replies; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-01 20:40 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> > > IMHO, I think it not necessary handle this scenario. Restart the
> > > dbus-daemon is not common.
> >
> > Every time you update your D-Bus installation. The Ubuntu guys even
> > popup a message box that you should reboot your system ;)
>
> At least in debian there's a /etc/dbus-1/event.d directory where scripts
> are automatically run when the dbus daemons starts or stops. E.g. hal
> installs its own script there for starting/stoping hald at the right
> moment.
as long as D-Bus support is optional, this is no option.
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-01 20:23 ` Johan Hedberg
2005-11-01 20:40 ` Marcel Holtmann
@ 2005-11-01 20:53 ` Claudio Takahasi
1 sibling, 0 replies; 27+ messages in thread
From: Claudio Takahasi @ 2005-11-01 20:53 UTC (permalink / raw)
To: bluez-devel
Hi,
Hal also add a timer to try re-initialize the connection and register
the paths when the "Disconnect" signal is received.
Ok guys I will try implement a similar HAL approach :)
Regards,
Claudio.
On 11/1/05, Johan Hedberg <johan.hedberg@nokia.com> wrote:
> On Tue, Nov 01, 2005, Marcel Holtmann wrote:
> > > IMHO, I think it not necessary handle this scenario. Restart the
> > > dbus-daemon is not common.
> >
> > Every time you update your D-Bus installation. The Ubuntu guys even
> > popup a message box that you should reboot your system ;)
>
> At least in debian there's a /etc/dbus-1/event.d directory where scripts
> are automatically run when the dbus daemons starts or stops. E.g. hal
> installs its own script there for starting/stoping hald at the right
> moment.
>
> Johan
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Downl=
oad
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bluez-devel] [PATCH] dbus.c cleanup
@ 2005-11-03 7:20 Johan Hedberg
2005-11-03 8:34 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-11-03 7:20 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
Hi Marcel,
Here's a cleanup patch for dbus.c which fixes some issues with
whitespace, coding-style, unecessary variables, etc.
I've also fixed PeriodicInquiry functionality of the python test script
(http://www.iki.fi/~jhedberg/bluez-python/pybt.py). It should now
support all currently implemented D-BUS services in hcid. Do you think
it would be worth including it in the bluez-utils cvs?
Johan
[-- Attachment #2: cleanup.patch --]
[-- Type: text/plain, Size: 5065 bytes --]
Index: hcid/dbus.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus.c,v
retrieving revision 1.44
diff -u -r1.44 dbus.c
--- hcid/dbus.c 2 Nov 2005 18:46:46 -0000 1.44
+++ hcid/dbus.c 3 Nov 2005 07:12:24 -0000
@@ -106,7 +106,7 @@
typedef struct {
uint32_t code;
const char *str;
-}bluez_error_t;
+} bluez_error_t;
typedef struct {
char *str;
@@ -381,14 +381,15 @@
static gboolean register_dbus_path(const char *path, uint16_t path_id, uint16_t dev_id,
const DBusObjectPathVTable *pvtable, gboolean fallback)
{
- struct hci_dbus_data *data;
+ gboolean ret = FALSE;
+ struct hci_dbus_data *data = NULL;
syslog(LOG_INFO,"Registering DBUS Path: %s", path);
data = malloc(sizeof(struct hci_dbus_data));
if (data == NULL) {
syslog(LOG_ERR,"Failed to alloc memory to DBUS path register data (%s)", path);
- return FALSE;
+ goto out;
}
data->path_id = path_id;
@@ -396,19 +397,23 @@
if (fallback) {
if (!dbus_connection_register_fallback(connection, path, pvtable, data)) {
- syslog(LOG_ERR,"DBUS failed to register %s object", path);
- free(data);
- return FALSE;
+ syslog(LOG_ERR,"DBUS failed to register %s fallback", path);
+ goto out;
}
} else {
if (!dbus_connection_register_object_path(connection, path, pvtable, data)) {
syslog(LOG_ERR,"DBUS failed to register %s object", path);
- free(data);
- return FALSE;
+ goto out;
}
}
- return TRUE;
+ ret = TRUE;
+
+out:
+ if (!ret && data)
+ free(data);
+
+ return ret;
}
static gboolean unregister_dbus_path(const char *path)
@@ -468,8 +473,7 @@
failed:
dbus_message_unref(message);
- hci_send_cmd(dev, OGF_LINK_CTL,
- OCF_PIN_CODE_NEG_REPLY, 6, &ci->bdaddr);
+ hci_send_cmd(dev, OGF_LINK_CTL, OCF_PIN_CODE_NEG_REPLY, 6, &ci->bdaddr);
}
void hcid_dbus_inquiry_start(bdaddr_t *local)
@@ -506,10 +510,7 @@
failed:
dbus_message_unref(message);
-
bt_free(local_addr);
-
- return;
}
void hcid_dbus_inquiry_complete(bdaddr_t *local)
@@ -546,10 +547,7 @@
failed:
dbus_message_unref(message);
-
bt_free(local_addr);
-
- return;
}
void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class, int8_t rssi)
@@ -598,8 +596,6 @@
bt_free(local_addr);
bt_free(peer_addr);
-
- return;
}
void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, char *name)
@@ -645,8 +641,6 @@
bt_free(local_addr);
bt_free(peer_addr);
-
- return;
}
void hcid_dbus_remote_name_failed(bdaddr_t *local, bdaddr_t *peer, uint8_t status)
@@ -692,8 +686,6 @@
bt_free(local_addr);
bt_free(peer_addr);
-
- return;
}
void hcid_dbus_conn_complete(bdaddr_t *local, bdaddr_t *peer)
@@ -910,7 +902,6 @@
unregister_dbus_path(DEVICE_PATH);
unregister_dbus_path(MANAGER_PATH);
-
}
gboolean hcid_dbus_register_device(uint16_t id)
@@ -1046,7 +1037,7 @@
for (; ptr->id != INVALID_PATH_ID; ptr++) {
if (ptr->unreg_func(connection, id) < 0)
- goto failed;
+ syslog(LOG_ERR, "Unregistering profile id %04X failed", ptr->id);
}
up_adapters--;
@@ -1161,8 +1152,6 @@
const struct service_data *handlers = NULL;
DBusMessage *reply = NULL;
struct hci_dbus_data *dbus_data = data;
- int type;
- const char *iface;
const char *method;
const char *signature;
const char *path;
@@ -1170,8 +1159,6 @@
DBusHandlerResult ret = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
path = dbus_message_get_path(msg);
- type = dbus_message_get_type(msg);
- iface = dbus_message_get_interface(msg);
method = dbus_message_get_member(msg);
signature = dbus_message_get_signature(msg);
@@ -1216,11 +1203,9 @@
if (error)
reply = bluez_new_failure_msg(msg, error);
-
if (reply) {
- if (!dbus_connection_send (conn, reply, NULL)) {
+ if (!dbus_connection_send (conn, reply, NULL))
syslog(LOG_ERR, "Can't send reply message!");
- }
dbus_message_unref (reply);
}
@@ -1240,7 +1225,7 @@
path = dbus_message_get_path(msg);
iface = dbus_message_get_interface(msg);
- method = dbus_message_get_member (msg);
+ method = dbus_message_get_member(msg);
signature = dbus_message_get_signature(msg);
syslog (LOG_INFO, "%s - path:%s", __PRETTY_FUNCTION__, path);
@@ -1264,11 +1249,9 @@
if (error)
reply = bluez_new_failure_msg(msg, error);
-
if (reply) {
- if (!dbus_connection_send (conn, reply, NULL)) {
+ if (!dbus_connection_send (conn, reply, NULL))
syslog(LOG_ERR, "Can't send reply message!");
- }
dbus_message_unref (reply);
}
@@ -1505,13 +1488,10 @@
if (hci_switch_role(dd, &bdaddr, role, 10000) < 0) {
syslog(LOG_ERR, "Switch role request failed\n");
reply = bluez_new_failure_msg(msg, BLUEZ_ESYSTEM_OFFSET + errno);
- } else {
- uint8_t result = 0;
- /* return TRUE to indicate that operation was completed */
- reply = dbus_message_new_method_return(msg);
- dbus_message_iter_init_append(reply, &iter);
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_BYTE, &result);
+ goto failed;
}
+
+ reply = dbus_message_new_method_return(msg);
failed:
return reply;
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 7:20 Johan Hedberg
@ 2005-11-03 8:34 ` Marcel Holtmann
2005-11-03 8:54 ` Johan Hedberg
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-03 8:34 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> Here's a cleanup patch for dbus.c which fixes some issues with
> whitespace, coding-style, unecessary variables, etc.
this is great, but I fixed some more issues. After "LOG_ERR," etc. there
should be a whitespace and the syslog() call doesn't need a "\n" at the
end ;)
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 8:34 ` Marcel Holtmann
@ 2005-11-03 8:54 ` Johan Hedberg
2005-11-03 9:08 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-11-03 8:54 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
On Thu, Nov 03, 2005, Marcel Holtmann wrote:
> this is great, but I fixed some more issues. After "LOG_ERR," etc. there
> should be a whitespace and the syslog() call doesn't need a "\n" at the
> end ;)
Yeah, I seem to have missed those. I guess nobody's perfect ;)
Could you comment on my question about the possibility of including the
python test script in the cvs? It would simplify keeping it in sync with
the daemon when the API changes.
Johan
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 8:54 ` Johan Hedberg
@ 2005-11-03 9:08 ` Marcel Holtmann
2005-11-03 9:23 ` Johan Hedberg
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-03 9:08 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> > this is great, but I fixed some more issues. After "LOG_ERR," etc. there
> > should be a whitespace and the syslog() call doesn't need a "\n" at the
> > end ;)
>
> Yeah, I seem to have missed those. I guess nobody's perfect ;)
nobody is, but every cleanup is a step in the right direction. So keep
them coming.
> Could you comment on my question about the possibility of including the
> python test script in the cvs? It would simplify keeping it in sync with
> the daemon when the API changes.
I haven't looked at it, but I have no problem with putting it in the CVS
and also including it in the source package. However this will be then a
script that will never be installed. Is this ok for you?
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 9:08 ` Marcel Holtmann
@ 2005-11-03 9:23 ` Johan Hedberg
2005-11-03 9:41 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-11-03 9:23 UTC (permalink / raw)
To: bluez-devel
On Thu, Nov 03, 2005, Marcel Holtmann wrote:
> I haven't looked at it, but I have no problem with putting it in the CVS
> and also including it in the source package. However this will be then a
> script that will never be installed. Is this ok for you?
Yes, that's ok.
Johan
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 9:23 ` Johan Hedberg
@ 2005-11-03 9:41 ` Marcel Holtmann
2005-11-03 10:13 ` Johan Hedberg
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-03 9:41 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> > I haven't looked at it, but I have no problem with putting it in the CVS
> > and also including it in the source package. However this will be then a
> > script that will never be installed. Is this ok for you?
>
> Yes, that's ok.
please include a list of available commands in the usage and I think we
should rename it to dbus-test.
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 9:41 ` Marcel Holtmann
@ 2005-11-03 10:13 ` Johan Hedberg
2005-11-03 10:33 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-11-03 10:13 UTC (permalink / raw)
To: bluez-devel
On Thu, Nov 03, 2005, Marcel Holtmann wrote:
> please include a list of available commands in the usage and I think we
> should rename it to dbus-test.
done:
http://www.iki.fi/~jhedberg/bluez-python/dbus-test
Johan
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 10:13 ` Johan Hedberg
@ 2005-11-03 10:33 ` Marcel Holtmann
2005-11-03 14:22 ` Johan Hedberg
0 siblings, 1 reply; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-03 10:33 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> > please include a list of available commands in the usage and I think we
> > should rename it to dbus-test.
>
> done:
> http://www.iki.fi/~jhedberg/bluez-python/dbus-test
it is in the CVS now and will also come with next source package, but it
will never be installed.
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 10:33 ` Marcel Holtmann
@ 2005-11-03 14:22 ` Johan Hedberg
2005-11-03 14:36 ` Marcel Holtmann
0 siblings, 1 reply; 27+ messages in thread
From: Johan Hedberg @ 2005-11-03 14:22 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
On Thu, Nov 03, 2005, Marcel Holtmann wrote:
> it is in the CVS now and will also come with next source package, but it
> will never be installed.
Thanks, and here's the first patch for it :-)
Johan
[-- Attachment #2: dbus-test.patch --]
[-- Type: text/plain, Size: 1314 bytes --]
Index: dbus-test
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-test,v
retrieving revision 1.1
diff -u -r1.1 dbus-test
--- dbus-test 3 Nov 2005 10:32:32 -0000 1.1
+++ dbus-test 3 Nov 2005 14:19:00 -0000
@@ -8,8 +8,9 @@
from signal import *
mgr_cmds = [ "DeviceList", "DefaultDevice" ]
-dev_cmds = [ "Inquiry", "CancelInquiry", "PeriodicInquiry", "CancelPeriodic",
- "RemoteName", "Connections", "Authenticate", "RoleSwitch" ]
+dev_cmds = [ "Up", "Down", "Inquiry", "CancelInquiry", "PeriodicInquiry",
+ "CancelPeriodic", "RemoteName", "Connections", "Authenticate",
+ "RoleSwitch" ]
class Tester:
exit_events = []
@@ -100,8 +101,8 @@
self.manager.connect_to_signal('DeviceRemoved', self.device_removed)
def usage(self):
- print 'Usage: %s [-i] [-l] [-h] <cmd> [arg1..]' % self.name
- print ' -i <dev> Specify device (e.g. "hci0" or "/dev/bluez/Device/hci0")'
+ print 'Usage: %s [-i <dev>] [-l] [-h] <cmd> [arg1..]' % self.name
+ print ' -i <dev> Specify device (e.g. "hci0" or "/org/bluez/Device/hci0")'
print ' -l Listen for events (no command required)'
print ' -h Show this help'
print 'Manager commands:'
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [Bluez-devel] [PATCH] dbus.c cleanup
2005-11-03 14:22 ` Johan Hedberg
@ 2005-11-03 14:36 ` Marcel Holtmann
0 siblings, 0 replies; 27+ messages in thread
From: Marcel Holtmann @ 2005-11-03 14:36 UTC (permalink / raw)
To: bluez-devel
Hi Johan,
> > it is in the CVS now and will also come with next source package, but it
> > will never be installed.
>
> Thanks, and here's the first patch for it :-)
patch is in the CVS now.
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2005-11-03 14:36 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-29 17:53 [Bluez-devel] [PATCH] dbus.c cleanup Johan Hedberg
2005-10-29 18:07 ` Marcel Holtmann
2005-10-29 18:48 ` Johan Hedberg
2005-10-29 19:07 ` Marcel Holtmann
2005-10-31 11:59 ` Claudio Takahasi
2005-10-31 12:07 ` Johan Hedberg
2005-10-31 12:14 ` Marcel Holtmann
2005-10-31 12:30 ` Eduardo Rocha
2005-10-31 12:12 ` Marcel Holtmann
2005-10-31 13:47 ` Claudio Takahasi
2005-11-01 13:11 ` Marcel Holtmann
2005-11-01 13:21 ` Claudio Takahasi
2005-11-01 19:08 ` Claudio Takahasi
2005-11-01 19:58 ` Marcel Holtmann
2005-11-01 20:23 ` Johan Hedberg
2005-11-01 20:40 ` Marcel Holtmann
2005-11-01 20:53 ` Claudio Takahasi
-- strict thread matches above, loose matches on Subject: below --
2005-11-03 7:20 Johan Hedberg
2005-11-03 8:34 ` Marcel Holtmann
2005-11-03 8:54 ` Johan Hedberg
2005-11-03 9:08 ` Marcel Holtmann
2005-11-03 9:23 ` Johan Hedberg
2005-11-03 9:41 ` Marcel Holtmann
2005-11-03 10:13 ` Johan Hedberg
2005-11-03 10:33 ` Marcel Holtmann
2005-11-03 14:22 ` Johan Hedberg
2005-11-03 14:36 ` Marcel Holtmann
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).