2005-10-29 17:53:38

by Johan Hedberg

[permalink] [raw]
Subject: [Bluez-devel] [PATCH] dbus.c cleanup

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


Attachments:
(No filename) (252.00 B)
dbus-cleanup.patch (4.98 kB)
Download all attachments

2005-10-31 13:47:53

by Claudio Takahasi

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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 <[email protected]> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-31 12:30:10

by Eduardo Rocha

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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 <[email protected]> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-31 12:14:22

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-31 12:12:06

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-31 12:07:53

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-31 11:59:17

by Claudio Takahasi

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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 <[email protected]> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-29 19:07:27

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-29 18:48:20

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-10-29 18:07:58

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 14:36:30

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 14:22:01

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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


Attachments:
(No filename) (201.00 B)
dbus-test.patch (1.28 kB)
Download all attachments

2005-11-03 10:33:42

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 10:13:43

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 09:41:57

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 09:23:50

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 09:08:06

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 08:54:36

by Johan Hedberg

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-03 08:34:38

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-11-01 13:11:14

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] dbus.c cleanup

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel