* [Bluez-devel] DBUS service support - Initial library
@ 2005-04-28 20:00 Claudio Takahasi
2005-04-29 9:47 ` Marcel Holtmann
0 siblings, 1 reply; 35+ messages in thread
From: Claudio Takahasi @ 2005-04-28 20:00 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
I wrote the skeleton of the library. Please verify if I=20
am following the BlueZ principles.=20
At the moment, the code is not fully integrated=20
with BlueZ daemons and applications. Some functions=20
shall be changed due function outputs: the result=20
should be returned instead of displayed on the=20
screen.
It is only a initial draft. The idea is provide a=20
library to user mode application controls bluetooth=20
connections. Please validate my suggestions before=20
I start coding and verify if this library can be=20
useful for BlueZ community. I know that some features
of this library are provided by "pand", but I need
control connections from a user mode application=20
or DBUS application.
The code is available in the link below:
http://www.cin.ufpe.br/~ckt/panz_lib.tar.gz
The following changes were done:
1. Makefile.am
added libpanz in the SUBDIR
2. configure.in
added libpanz/Makefile in the AC_OUTPUT
3. Added libpanz directory
the files are in libpanz.tar.gz file
4. Common hcitool functions
hcitool functions used by the library were moved
to hci_common.c
5. Dynamic Link Local Layer addresses
The automatic IP assignment will be based on the=20
following IETF draft=20
http://files.zeroconf.org/draft-ietf-zeroconf-ipv4-linklocal.txt
There are a lot of chalenges until I reach=20
my objective: integrate with a DBUS application.
Best regards,
Claudio.
-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 35+ messages in thread* Re: [Bluez-devel] DBUS service support - Initial library 2005-04-28 20:00 [Bluez-devel] DBUS service support - Initial library Claudio Takahasi @ 2005-04-29 9:47 ` Marcel Holtmann 2005-04-29 12:26 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-04-29 9:47 UTC (permalink / raw) To: bluez-devel Hi Claudio, > I wrote the skeleton of the library. Please verify if I > am following the BlueZ principles. > At the moment, the code is not fully integrated > with BlueZ daemons and applications. Some functions > shall be changed due function outputs: the result > should be returned instead of displayed on the > screen. > > It is only a initial draft. The idea is provide a > library to user mode application controls bluetooth > connections. Please validate my suggestions before > I start coding and verify if this library can be > useful for BlueZ community. I know that some features > of this library are provided by "pand", but I need > control connections from a user mode application > or DBUS application. don't move anything around the utils directories. It is easier to do that later on when it is clear what to do. If you need some stuff that is not in the Bluetooth library duplicate the code for now. Since this is all about pand. Extend it with your functionality and put everything in the pand directory. I don't see any need for another library especially when you start talking about D-Bus integration. Regards Marcel ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-04-29 9:47 ` Marcel Holtmann @ 2005-04-29 12:26 ` Claudio Takahasi 2005-04-29 12:43 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-04-29 12:26 UTC (permalink / raw) To: bluez-devel Hi Marcel, Let me try justify why I need a new library. 1. A DBUS app should not contain specific bluetooth/Wi-Fi/GPRS connection c= ode. In my opinion, it is better abstract the connection details. 2. Features required by DBUS app: signal strength, connection establishment= ,=20 disconnection, new device notification(search for service frequently), automatic IP assigment(with IP conflict resolution and IP announment), device information, active connections, security info, connection lost, ... All these features should be provided by a BlueZ library. At the moment, pand and hcitool provide part of these. However, they are command line application and a DBUS app should use a workaround approach: "execv" function 3. Consider an embedded device, control connections using a DBUS app=20 is the better way to this task. Execute a command line app is not appropriated to handle this context. An embedded app using wireless connection should abstract connection establishment/control details. This is the scenario that I am working on, if I can't contribute developing this library, I will try move all these required features to DBUS app level without add functions/library to BlueZ. What is your opinion about this? Best regards, Claudio. On 4/29/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > I wrote the skeleton of the library. Please verify if I > > am following the BlueZ principles. > > At the moment, the code is not fully integrated > > with BlueZ daemons and applications. Some functions > > shall be changed due function outputs: the result > > should be returned instead of displayed on the > > screen. > > > > It is only a initial draft. The idea is provide a > > library to user mode application controls bluetooth > > connections. Please validate my suggestions before > > I start coding and verify if this library can be > > useful for BlueZ community. I know that some features > > of this library are provided by "pand", but I need > > control connections from a user mode application > > or DBUS application. >=20 > don't move anything around the utils directories. It is easier to do > that later on when it is clear what to do. If you need some stuff that > is not in the Bluetooth library duplicate the code for now. >=20 > Since this is all about pand. Extend it with your functionality and put > everything in the pand directory. I don't see any need for another > library especially when you start talking about D-Bus integration. >=20 > Regards >=20 > Marcel >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=3D105hix > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-04-29 12:26 ` Claudio Takahasi @ 2005-04-29 12:43 ` Marcel Holtmann 2005-04-29 22:20 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-04-29 12:43 UTC (permalink / raw) To: bluez-devel Hi Claudio, > Let me try justify why I need a new library. > 1. A DBUS app should not contain specific bluetooth/Wi-Fi/GPRS connection code. > In my opinion, it is better abstract the connection details. > 2. Features required by DBUS app: signal strength, connection establishment, > disconnection, new device notification(search for service > frequently), automatic > IP assigment(with IP conflict resolution and IP announment), > device information, > active connections, security info, connection lost, ... > All these features should be provided by a BlueZ library. At the > moment, pand > and hcitool provide part of these. However, they are command line > application > and a DBUS app should use a workaround approach: "execv" function > 3. Consider an embedded device, control connections using a DBUS app > is the better way to this task. Execute a command line app is not > appropriated > to handle this context. An embedded app using wireless connection > should abstract connection establishment/control details. > > This is the scenario that I am working on, if I can't contribute > developing this library, > I will try move all these required features to DBUS app level without > add functions/library > to BlueZ. think about adding all you need to pand and then start it for example with a --dbus option to activate that service via D-Bus. When writing code use the BlueZ coding style. This means, use tabs. For the patches, create them with "cvs diff -u" from the BlueZ CVS and make sure that you executed "make maintainer-clean" first. Regards Marcel ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-04-29 12:43 ` Marcel Holtmann @ 2005-04-29 22:20 ` Claudio Takahasi 2005-04-30 0:04 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-04-29 22:20 UTC (permalink / raw) To: bluez-devel Hi Marcel, My application will provide a DBUS service and APIs to alows user mode applications interact with diferent types of Wireless/Wired connections. This is the reason to create a BlueZ library based on pand and hcitool functions. My application should the able to retrieve bluetooth device information, including establish connection, disconnect, link status, new devices/services, ... The DBUS service will not be provided at BlueZ level. The current DBUS message in the hcid is used to handle security/authentication issues. This message has a different proposal. Therefore, use the same macro "--enable-dbus" to enable/disable is not a good ideia. Another important information is: the user mode application doesn't need root privileges to create a bluetooth connection, because it will request using APIs and DBUS service. Can I create a library in the pand directory and reuse the common codes? I suggest a directive like "--enable-panz" because this library aims provide functions to hide connection details. Do you agree? Regards, Claudio. On 4/29/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > Let me try justify why I need a new library. > > 1. A DBUS app should not contain specific bluetooth/Wi-Fi/GPRS connecti= on code. > > In my opinion, it is better abstract the connection details. > > 2. Features required by DBUS app: signal strength, connection establish= ment, > > disconnection, new device notification(search for service > > frequently), automatic > > IP assigment(with IP conflict resolution and IP announment), > > device information, > > active connections, security info, connection lost, ... > > All these features should be provided by a BlueZ library. At the > > moment, pand > > and hcitool provide part of these. However, they are command line > > application > > and a DBUS app should use a workaround approach: "execv" function > > 3. Consider an embedded device, control connections using a DBUS app > > is the better way to this task. Execute a command line app is not > > appropriated > > to handle this context. An embedded app using wireless connection > > should abstract connection establishment/control details. > > > > This is the scenario that I am working on, if I can't contribute > > developing this library, > > I will try move all these required features to DBUS app level without > > add functions/library > > to BlueZ. >=20 > think about adding all you need to pand and then start it for example > with a --dbus option to activate that service via D-Bus. >=20 > When writing code use the BlueZ coding style. This means, use tabs. For > the patches, create them with "cvs diff -u" from the BlueZ CVS and make > sure that you executed "make maintainer-clean" first. >=20 > Regards >=20 > Marcel >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=3D105hix > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel >=20 --=20 _______________________________________ Claudio Takahasi INdT - Nokia Technology Institute Phone: +55 81 21223034 Recife - Pernambuco - Brazil ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-04-29 22:20 ` Claudio Takahasi @ 2005-04-30 0:04 ` Marcel Holtmann 2005-05-01 21:16 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-04-30 0:04 UTC (permalink / raw) To: bluez-devel Hi Claudio, > My application will provide a DBUS service and > APIs to alows user mode applications interact > with diferent types of Wireless/Wired connections. > This is the reason to create a BlueZ library based > on pand and hcitool functions. My application should > the able to retrieve bluetooth device information, > including establish connection, disconnect, link > status, new devices/services, ... > The DBUS service will not be provided at BlueZ level. > > The current DBUS message in the hcid is used to handle > security/authentication issues. This message has a > different proposal. Therefore, use the same macro > "--enable-dbus" to enable/disable is not a good ideia. > > Another important information is: the user mode > application doesn't need root privileges to create > a bluetooth connection, because it will request using > APIs and DBUS service. > > Can I create a library in the pand directory and > reuse the common codes? > I suggest a directive like "--enable-panz" because > this library aims provide functions to hide connection > details. I think you get the whole idea of D-Bus wrong and this is not about the current D-Bus support of hcid for the PIN helper. As I said if you wanna control something from your application via D-Bus then make sure there is a D-Bus enabled pand service is running. If you wanna do it at another level, then I don't see any benefit from it. Why should we create another library only to help your special D-Bus daemon if it is not Bluetooth only. In that case you should simply duplicate the code and integrate it into your daemon directly. There is no need to make things more complicate. For me the only thing that makes sense if you enhance the pand with D-Bus support and then you use that D-Bus interface in your application. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-04-30 0:04 ` Marcel Holtmann @ 2005-05-01 21:16 ` Claudio Takahasi 2005-05-01 23:18 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-01 21:16 UTC (permalink / raw) To: bluez-devel Hi Marcel, I suggested provide a DBUS message service in another level because I will try contribute with NetworkManager project: http://people.redhat.com/dcbw/NetworkManager/index.html I will analyze these two approachs and define the most interesting solution for my project. Thanks for your time, Claudio. On 4/29/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > My application will provide a DBUS service and > > APIs to alows user mode applications interact > > with diferent types of Wireless/Wired connections. > > This is the reason to create a BlueZ library based > > on pand and hcitool functions. My application should > > the able to retrieve bluetooth device information, > > including establish connection, disconnect, link > > status, new devices/services, ... > > The DBUS service will not be provided at BlueZ level. > > > > The current DBUS message in the hcid is used to handle > > security/authentication issues. This message has a > > different proposal. Therefore, use the same macro > > "--enable-dbus" to enable/disable is not a good ideia. > > > > Another important information is: the user mode > > application doesn't need root privileges to create > > a bluetooth connection, because it will request using > > APIs and DBUS service. > > > > Can I create a library in the pand directory and > > reuse the common codes? > > I suggest a directive like "--enable-panz" because > > this library aims provide functions to hide connection > > details. >=20 > I think you get the whole idea of D-Bus wrong and this is not about the > current D-Bus support of hcid for the PIN helper. >=20 > As I said if you wanna control something from your application via D-Bus > then make sure there is a D-Bus enabled pand service is running. If you > wanna do it at another level, then I don't see any benefit from it. Why > should we create another library only to help your special D-Bus daemon > if it is not Bluetooth only. In that case you should simply duplicate > the code and integrate it into your daemon directly. There is no need to > make things more complicate. >=20 > For me the only thing that makes sense if you enhance the pand with > D-Bus support and then you use that D-Bus interface in your application. >=20 > Regards >=20 > Marcel >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events, = 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=3D20 > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-01 21:16 ` Claudio Takahasi @ 2005-05-01 23:18 ` Marcel Holtmann 2005-05-02 15:32 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-01 23:18 UTC (permalink / raw) To: bluez-devel Hi Claudio, > I suggested provide a DBUS message service in another > level because I will try contribute with NetworkManager > project: > http://people.redhat.com/dcbw/NetworkManager/index.html then this is not about D-Bus integration. What you need is to make the NetworkManager daemon capable of dealing with Bluetooth PAN connections. > I will analyze these two approachs and define the most > interesting solution for my project. Both parts are fine with me, but the NetworkManager thing should be done outside of the BlueZ utilities. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-01 23:18 ` Marcel Holtmann @ 2005-05-02 15:32 ` Claudio Takahasi 2005-05-02 16:24 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-02 15:32 UTC (permalink / raw) To: bluez-devel Hi Marcel, After analyze both approachs and consider the future enhancements for BlueZ, implement DBUS service at BlueZ level can be better because it open a new perspective, local services can provided: - dial-up networking - business card exchange - fax - file transfer - headset - audio gateway - ... This is very interesting for embedded environment because only the assigned application will handle the request/notifications. Regarding the service name, I suggest: "org.bluez.pand" Is it fine for you? Do you want a macro to enable this feature at build time? Regards, Claudio. On 5/1/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > I suggested provide a DBUS message service in another > > level because I will try contribute with NetworkManager > > project: > > http://people.redhat.com/dcbw/NetworkManager/index.html >=20 > then this is not about D-Bus integration. What you need is to make the > NetworkManager daemon capable of dealing with Bluetooth PAN connections. >=20 > > I will analyze these two approachs and define the most > > interesting solution for my project. >=20 > Both parts are fine with me, but the NetworkManager thing should be done > outside of the BlueZ utilities. >=20 > Regards >=20 > Marcel >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events, = 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=3D20 > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel >=20 --=20 _______________________________________ Claudio Takahasi INdT - Nokia Technology Institute Phone: +55 81 21223034 Recife - Pernambuco - Brazil ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-02 15:32 ` Claudio Takahasi @ 2005-05-02 16:24 ` Marcel Holtmann 2005-05-09 21:31 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-02 16:24 UTC (permalink / raw) To: bluez-devel Hi Claudio, > After analyze both approachs and consider the future enhancements > for BlueZ, implement DBUS service at BlueZ level can be better > because it open a new perspective, local services can provided: > - dial-up networking > - business card exchange > - fax > - file transfer > - headset > - audio gateway > - ... > > This is very interesting for embedded environment because > only the assigned application will handle the request/notifications. > > Regarding the service name, I suggest: > "org.bluez.pand" > Is it fine for you? the name is fine with me. > Do you want a macro to enable this feature at > build time? Follow the hcid example. The configure script already detects if D-Bus is available or not. Make sure that the current tasks (--connect and --listen) of pand are working the same and use --dbus for starting a pand with a D-Bus interface. Keep all the D-Bus specific things in a separate files. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-02 16:24 ` Marcel Holtmann @ 2005-05-09 21:31 ` Claudio Takahasi 2005-05-11 18:27 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-09 21:31 UTC (permalink / raw) To: bluez-devel Hi Marcel, According with our last discussion. I will to add DBUS service support in the pand. All code related to DBUS will be added=20 in a new file. The dbus service will be enabled using the argument "--dbus". However if this argument is provide with other arguments like "--connect", "--role" or "--listen" a sharing problem will happen. What is the behaviour that you want? 1. if "--dbus" was informed no other arguments will be accepted 2. support a shared mode, accepting other arguments. In this last case, I have to solve a small problem: shared=20 variables, add functions to check the device status, and common codes like this: create_connection() static uint16_t role =3D BNEP_SVC_PANU;=09/* Local role (ie service) */ static uint16_t service =3D BNEP_SVC_NAP;=09/* Remote service */ static int encrypt; static int secure; static int master; static char netdev[16] =3D "bnep%d"; static bdaddr_t src_addr =3D *BDADDR_ANY; static int src_dev =3D -1; Regards, Claudio. On 5/2/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > After analyze both approachs and consider the future enhancements > > for BlueZ, implement DBUS service at BlueZ level can be better > > because it open a new perspective, local services can provided: > > - dial-up networking > > - business card exchange > > - fax > > - file transfer > > - headset > > - audio gateway > > - ... > > > > This is very interesting for embedded environment because > > only the assigned application will handle the request/notifications. > > > > Regarding the service name, I suggest: > > "org.bluez.pand" > > Is it fine for you? >=20 > the name is fine with me. >=20 > > Do you want a macro to enable this feature at > > build time? >=20 > Follow the hcid example. The configure script already detects if D-Bus > is available or not. >=20 > Make sure that the current tasks (--connect and --listen) of pand are > working the same and use --dbus for starting a pand with a D-Bus > interface. >=20 > Keep all the D-Bus specific things in a separate files. >=20 > Regards >=20 > Marcel >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events, = 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=3D20 > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel >=20 --=20 _______________________________________ Claudio Takahasi INdT - Nokia Technology Institute Phone: +55 81 21223034 Recife - Pernambuco - Brazil ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-09 21:31 ` Claudio Takahasi @ 2005-05-11 18:27 ` Marcel Holtmann 2005-05-12 9:00 ` Peter Wippich 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-11 18:27 UTC (permalink / raw) To: bluez-devel Hi Claudio, > According with our last discussion. I will to add DBUS service > support in the pand. All code related to DBUS will be added > in a new file. > > The dbus service will be enabled using the argument "--dbus". > However if this argument is provide with other arguments like > "--connect", "--role" or "--listen" a sharing problem will happen. > > What is the behaviour that you want? > 1. if "--dbus" was informed no other arguments will be accepted > 2. support a shared mode, accepting other arguments. you should do 1). The rest makes no sense, because if you start it with --dbus you want to control everything via a D-Bus application and pand acts like a proxy. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-11 18:27 ` Marcel Holtmann @ 2005-05-12 9:00 ` Peter Wippich 2005-05-12 12:41 ` Marcel Holtmann 2005-05-12 12:45 ` [Bluez-devel] DBUS service support - Initial library Claudio Takahasi 0 siblings, 2 replies; 35+ messages in thread From: Peter Wippich @ 2005-05-12 9:00 UTC (permalink / raw) To: bluez-devel Hi all, sorry for asking a possible dump question, but: can anybody point me to a source what this D-BUS stuff is ??? Think I missed something. Thanks a lot, Peter | Peter Wippich Voice: +49 30 46776411 | | G&W Instruments GmbH fax: +49 30 46776419 | | Gustav-Meyer-Allee 25, Geb. 12 Email: pewi@gw-instruments.de | | D-13355 Berlin / Germany | ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-12 9:00 ` Peter Wippich @ 2005-05-12 12:41 ` Marcel Holtmann 2005-05-12 16:21 ` Peter Wippich 2005-05-12 12:45 ` [Bluez-devel] DBUS service support - Initial library Claudio Takahasi 1 sibling, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-12 12:41 UTC (permalink / raw) To: bluez-devel Hi Peter, > sorry for asking a possible dump question, but: > can anybody point me to a source what this D-BUS stuff is ??? look at http://www.freedesktop.org/Software/dbus Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-12 12:41 ` Marcel Holtmann @ 2005-05-12 16:21 ` Peter Wippich 2005-05-20 21:04 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Peter Wippich @ 2005-05-12 16:21 UTC (permalink / raw) To: bluez-devel Thank you Marcel ! Ciao, Peter On Thu, 12 May 2005, Marcel Holtmann wrote: > Hi Peter, > > > sorry for asking a possible dump question, but: > > can anybody point me to a source what this D-BUS stuff is ??? > > look at http://www.freedesktop.org/Software/dbus > > Regards > > Marcel > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > | Peter Wippich Voice: +49 30 46776411 | | G&W Instruments GmbH fax: +49 30 46776419 | | Gustav-Meyer-Allee 25, Geb. 12 Email: pewi@gw-instruments.de | | D-13355 Berlin / Germany | ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-12 16:21 ` Peter Wippich @ 2005-05-20 21:04 ` Claudio Takahasi 2005-05-23 10:27 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-20 21:04 UTC (permalink / raw) To: bluez-devel [-- Attachment #1: Type: text/plain, Size: 3074 bytes --] Hi Marcel, I am sending a initial skeleton of pand DBUS support. I was not able to access BlueZ CVS due firewall permissions. The path is based on bluez-utils-2.17. The Makefile.am file was changed. Run aclocal, automake and autoconf tools. The BLUEZ DBUS PAN service uses the system bus. Check the following items before run the sample client: 1. checking dbus-daemon type: $ps -ef | grep dbus "dbus-daemon --system" should be displayed If not, install dbus-1 package 2. check dbus service configuration file The file bluez.conf must be located at: /etc/dbus-1/system.d/ See Appendix 1 of DBUS.TXT file located in pand directory After copy bluez.conf file I suggest restart dbus-daemon 3. running the bluez pan daemon (requires root permission) type $pand --dbus or pand -b --nodetach check if the pand process is running: $ps -ef | grep pand if not, read the system log: $tail /var/log/syslog 4. extract the client (doesn't require root permission) The client calls basic functions. This is a usage sample for gamming, UPnP, ... A library can be developed to hide D-Bus functions. Suggestions and comments are welcome! Regarding dbus-0.33 support, I decided implement using a compatible version(0.23). When a stable version become available we can think on move to the new version. Claudio. On 5/12/05, Peter Wippich <pewi@gw-instruments.de> wrote: > > Thank you Marcel ! > > Ciao, > > Peter > > On Thu, 12 May 2005, Marcel Holtmann wrote: > > > Hi Peter, > > > > > sorry for asking a possible dump question, but: > > > can anybody point me to a source what this D-BUS stuff is ??? > > > > look at http://www.freedesktop.org/Software/dbus > > > > Regards > > > > Marcel > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by Oracle Space Sweepstakes > > Want to be the first software developer in space? > > Enter now for the Oracle Space Sweepstakes! > > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > > _______________________________________________ > > Bluez-devel mailing list > > Bluez-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > > | Peter Wippich Voice: +49 30 46776411 | > | G&W Instruments GmbH fax: +49 30 46776419 | > | Gustav-Meyer-Allee 25, Geb. 12 Email: pewi@gw-instruments.de | > | D-13355 Berlin / Germany | > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > [-- Attachment #2: pand_dbus_client.tar.gz --] [-- Type: application/x-gzip, Size: 79879 bytes --] [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: bluez-2.17-dbus.diff --] [-- Type: text/x-patch; name="bluez-2.17-dbus.diff", Size: 52865 bytes --] diff -urNaw bluez-utils-2.17.orig/pand/dbus_services.h bluez-utils-2.17-dbus/pand/dbus_services.h --- bluez-utils-2.17.orig/pand/dbus_services.h 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/dbus_services.h 2005-05-20 16:39:06.407796864 -0300 @@ -0,0 +1,206 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2005 Claudio Takahasi <claudio.takahasi@indt.org> + * Copyright (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id: pand_dbus_services.h,v 1.12 2005/05/22 13:00:00 holtmann Exp $ + */ +#ifndef __H_PAND_DBUS_SERVICES_H__ +#define __H_PAND_DBUS_SERVICES_H__ + +#include <stdlib.h> +#include <stdint.h> + +#define ORG_BLUEZ_DBUS_NAME "org.bluez" + +#define ORG_BLUEZ_PAND_DBUS_IFACE "org.bluez.pandIface" +#define ORG_BLUEZ_HCI_DBUS_IFACE "org.bluez.hciIface" + +#define ORG_BLUEZ_PAND_OBJ "/org/bluez/pand" +#define ORG_BLUEZ_HCI_OBJ "/org/bluez/hci" + + +// See pand_dbus_conn_req_t, used by actions attribute +#define PAND_CREATE_BRIDGE_MASK 0x01 +#define PAND_LLA_MASK 0x02 + + +// status of request operations +#define PAND_RESULT_SUCCESS 0x00 +#define PAND_RESULT_FAILED 0x01 + +// see pand_dev_info_t +#define PAND_DEV_STATE_READY 0x01 +#define PAND_DEV_STATE_CONNECTED 0x02 + + +typedef enum __attribute__((packed)) +{ + PAND_DBUS_INVALID_TYPE, + PAND_DBUS_CHANGE_ROLE_REQ_TYPE, + PAND_DBUS_CHANGE_ROLE_REQ_CNF_TYPE, + PAND_DBUS_CONN_REQ_TYPE, + PAND_DBUS_CONN_REQ_CNF_TYPE, + PAND_DBUS_DISCONN_REQ_TYPE, + PAND_DBUS_DISCONN_REQ_CNF_TYPE, + PAND_DBUS_DISCONN_ALL_REQ_TYPE, + PAND_DBUS_DISCONN_ALL_REQ_CNF_TYPE, + PAND_DBUS_GET_ACTIVE_CONN_REQ_TYPE, + PAND_DBUS_GET_ACTIVE_CONN_REQ_CNF_TYPE, + PAND_DBUS_SEARCH_REQ_TYPE, /* request search for a PAN service */ + PAND_DBUS_SEARCH_REQ_CNF_TYPE, + PAND_DBUS_GET_DEV_INFO_REQ_TYPE, /* request local bluetooth devices */ + PAND_DBUS_GET_DEV_INFO_CNF_TYPE, + PAND_DBUS_LISTEN_REQ_TYPE, + PAND_DBUS_LISTEN_REQ_CNF_TYPE, + PAND_DBUS_LISTEN_STOP_REQ_TYPE, + PAND_DBUS_LISTEN_STOP_REQ_CNF_TYPE +}PAND_MESSAGE_TYPE; + + +typedef enum __attribute__((packed)) +{ + DISABLE_BRIDGE, + ENABLE_BRIDGE +}BRIDGE_MODE; + +typedef enum __attribute__((packed)) +{ + PAND_STATUS_BUSY, + PAND_STATUS_CONNECTED, + PAND_STATUS_LISTENNING, + PAND_STATUS_IDLE +}PAND_DBUS_STATUS; + + +typedef struct __attribute__((packed)) +{ + PAND_MESSAGE_TYPE type; + void *data; +}pand_dbus_message_format_t; + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; /* for address more than one device */ + uint16_t role; + uint16_t service; + char actions; + char bdaddr[18]; +}pand_dbus_conn_req_t; + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; /* for address more than one device */ + char bdaddr[18]; +}pand_dbus_disconn_req_t; + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; /* for address more than one device */ +}pand_dbus_disconn_all_req_t,pand_dbus_get_active_conn_req_t; + +/* Generic confirmation result */ +typedef struct __attribute__((packed)) +{ + PAND_MESSAGE_TYPE type; + char result; + char data[0]; +}pand_dbus_req_cnf_t; + + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; /* for address more than one device */ + uint16_t role; + BRIDGE_MODE bridge_mode; + char master; + char secure; + char encrypt; + char ipv4[16]; + char ipv4subnet[16]; +}pand_dbus_listen_req_t; + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; /* for address more than one device */ +}pand_dbus_listen_stop_req_t; + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; /* for address more than one device */ + uint16_t role; /* new role*/ + char bdaddr[18]; +}pand_dbus_change_role_req_t; + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; /* for address more than one device */ + uint16_t service; +}pand_dbus_search_req_t; + +typedef struct __attribute__((packed)) +{ + char status; /* 0-success 1-failed */ + char *ip; /* ip address if lla was requested */ +}pand_dbus_conn_req_cnf_t; + +typedef struct __attribute__((packed)) +{ + char status; + /* device list ???*/ +}pand_dbus_search_cnf_t; + +typedef struct __attribute__((packed)) +{ + uint16_t dev_id; + char name[8]; + char bdaddr[18]; + uint16_t state; /* see PAND_DEV_STATE_XXXX TODO */ +}pand_dev_info_t; + +/* Addressing more than one bluetooth device */ +typedef struct __attribute__((packed)) +{ + //TODO add support for more than one device + char num_dev; + pand_dev_info_t devices[0]; +}pand_dbus_get_dev_cnf_t; + +typedef struct __attribute__((packed)) +{ + char bdaddr[18]; + char link_type; + char handle; + char state; + char master; +}pand_active_conn_t; +typedef struct __attribute__((packed)) +{ + //TODO add support for more than one device + char num_conn; + pand_active_conn_t conn[0]; +}pand_dbus_get_active_conn_cnf_t; + + +#endif /* __H_PAND_DBUS_SERVICES_H__*/ diff -urNaw bluez-utils-2.17.orig/pand/DBUS.TXT bluez-utils-2.17-dbus/pand/DBUS.TXT --- bluez-utils-2.17.orig/pand/DBUS.TXT 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/DBUS.TXT 2005-05-20 11:48:59.000000000 -0300 @@ -0,0 +1,65 @@ + +HOWTO setup DBUS environment + +The BLUEZ DBUS PAN service uses the system bus. In order +to run the + +1. checking dbus-daemon + type: $ps -ef | grep dbus + "dbus-daemon --system" should be displayed + +2. check dbus service configuration file + The file bluez.conf must be located at: /etc/dbus-1/system.d/ + See Appendix 1. + + +3. running the bluez pan daemon (requires root permission) + type $pand --dbus or pand -b + check if the pand process is running: $ps -ef | grep pand + if not, read the system log: $tail /var/log/syslog + +4. calling bluez dbus service(user mode app) + See call examples in the file:xxxx + Now, any user mode app(games, UPnP, ...) is able to control + Bluetooth connections. + +****** Appendix 1: + + +<!-- This configuration file specifies the required security policies + for bluez-pand to work. --> + +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + + <!-- ../system.conf have denied everything, so we just punch some holes --> + + <policy context="default"> + <allow own="org.bluez"/> + + <allow send_destination="org.bluez.pand"/> + <allow receive_sender="org.bluez.pand"/> + + <allow send_path="/org/bluez/pand"/> + </policy> + +</busconfig> + +****** Appendix 2: + +Advantages: + + * user mode app are able to control BT connections + * security: the configuration file can be used to specify permissions + +Disadvantages: + * D-BUS is not stable + * programming using D-BUS is not trivial + +****** TODO + -add search service + -add bridge control + - Notify D-BUS connected client regarding incomming conn + -add bt device functions: see hcitoool + -add local link address support: zeroconf diff -urNaw bluez-utils-2.17.orig/pand/main.c bluez-utils-2.17-dbus/pand/main.c --- bluez-utils-2.17.orig/pand/main.c 2005-05-09 15:33:24.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/main.c 2005-05-18 19:08:33.000000000 -0300 @@ -54,6 +54,10 @@ #include "pand.h" +#ifdef ENABLE_DBUS +#include "pand_dbus.h" +#endif + static uint16_t role = BNEP_SVC_PANU; /* Local role (ie service) */ static uint16_t service = BNEP_SVC_NAP; /* Remote service */ @@ -88,7 +92,10 @@ SHOW, LISTEN, CONNECT, - KILL + KILL, +#ifdef ENABLE_DBUS + DBUS, +#endif } modes; static void run_devup(char *dev, char *dst, int sk, int nsk) @@ -417,6 +424,9 @@ void sig_term(int sig) { terminate = 1; +#ifdef ENABLE_DBUS + pand_dbus_stop(); +#endif } int write_pidfile(void) @@ -488,6 +498,9 @@ { "help", 0, 0, 'h' }, { "listen", 0, 0, 's' }, { "connect", 1, 0, 'c' }, +#ifdef ENABLE_DBUS + { "dbus", 0, 0, 'b' }, +#endif { "search", 2, 0, 'Q' }, { "kill", 1, 0, 'k' }, { "killall", 0, 0, 'K' }, @@ -510,7 +523,7 @@ { 0, 0, 0, 0 } }; -static char main_sopts[] = "hsc:k:Kr:e:i:lnp::DQ::AESMC::P:z"; +static char main_sopts[] = "hsc:bk:Kr:e:i:lnp::DQ::AESMC::P:z"; static char main_help[] = "Bluetooth PAN daemon version " VERSION " \n" @@ -520,6 +533,9 @@ "\t--show --list -l Show active PAN connections\n" "\t--listen -s Listen for PAN connections\n" "\t--connect -c <bdaddr> Create PAN connection\n" +#ifdef ENABLE_DBUS + "\t--dbus -b Enable dbus service\n" +#endif "\t--autozap -z Disconnect automatically on exit\n" "\t--search -Q[duration] Search and connect\n" "\t--kill -k <bdaddr> Kill PAN connection\n" @@ -560,7 +576,11 @@ mode = CONNECT; dst = strdup(optarg); break; - +#ifdef ENABLE_DBUS + case 'b': + mode = DBUS; + break; +#endif case 'Q': mode = CONNECT; if (optarg) @@ -729,8 +749,12 @@ case LISTEN: do_listen(); break; +#ifdef ENABLE_DBUS + case DBUS: + pand_dbus_start(); + break; +#endif } - if (pidfile) unlink(pidfile); diff -urNaw bluez-utils-2.17.orig/pand/Makefile.am bluez-utils-2.17-dbus/pand/Makefile.am --- bluez-utils-2.17.orig/pand/Makefile.am 2005-05-09 15:33:24.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/Makefile.am 2005-05-18 19:00:45.000000000 -0300 @@ -2,12 +2,31 @@ # $Id: Makefile.am,v 1.5 2005/04/21 21:34:10 holtmann Exp $ # +if DBUS + pand_dbus_inc_hdr = dbus_services.h + pand_dbus_sources = pand_dbus.c pand_dbus_util.c pand_dbus_commands.c + pand_dbus_libs = @DBUS_LIBS@ -ldbus-glib-1 -lbridge -lpthread + pand_dbus_cflags = -DENABLE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE + pand_dbus_inc = -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include +else + pand_dbus_inc_hdr = + pand_dbus_sources = + pand_dbus_libs = + pand_dbus_cflags = + pand_dbus_inc = +endif + + + bin_PROGRAMS = pand -pand_SOURCES = main.c pand.h bnep.c sdp.c -pand_LDADD = @BLUEZ_LIBS@ +pand_SOURCES = main.c pand.h bnep.c sdp.c $(pand_dbus_sources) +pand_LDADD = @BLUEZ_LIBS@ $(pand_dbus_libs) +INCLUDES = $(pand_dbus_inc) +includedir = @includedir@/bluetooth +include_HEADERS = $(pand_dbus_inc_hdr) -AM_CFLAGS = @BLUEZ_CFLAGS@ +AM_CFLAGS = @BLUEZ_CFLAGS@ $(pand_dbus_cflags) man_MANS = pand.1 diff -urNaw bluez-utils-2.17.orig/pand/pand_dbus.c bluez-utils-2.17-dbus/pand/pand_dbus.c --- bluez-utils-2.17.orig/pand/pand_dbus.c 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/pand_dbus.c 2005-05-20 16:43:53.590138512 -0300 @@ -0,0 +1,721 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2005 Claudio Takahasi <claudio.takahasi@indt.org> + * Copyright (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id: pand_dbus.c,v 1.12 2005/05/22 13:00:00 holtmann Exp $ + */ + + +#include <string.h> +#include <stdio.h> +#include <pthread.h> +#include <signal.h> +#include <errno.h> +#include <unistd.h> + + +#include <dbus/dbus.h> +#include <dbus/dbus-glib-lowlevel.h> +#include <dbus/dbus-protocol.h> +#include <glib.h> + +#include <sys/syslog.h> +#include <sys/socket.h> +#include <sys/poll.h> +#include <sys/types.h> +#include <sys/stat.h> + +#include <bluetooth/bluetooth.h> +#include <bluetooth/hci.h> +#include <bluetooth/hci_lib.h> +#include <bluetooth/l2cap.h> +#include <bluetooth/bnep.h> + + + +#include "pand_dbus.h" +#include "dbus_services.h" +#include "pand_dbus_util.h" +#include "pand_dbus_commands.h" + + + +static void pand_dbus_unregistered_func (DBusConnection *dbus_conn, + gpointer user_data); + +static DBusHandlerResult pand_dbus_msg_func (DBusConnection *dbus_conn, + DBusMessage *msg, gpointer user_data); + +static DBusObjectPathVTable pand_vtable = { + pand_dbus_unregistered_func, + pand_dbus_msg_func, + NULL, + NULL, + NULL, + NULL +}; + + +typedef DBusHandlerResult (*pand_services_handler)(DBusConnection *, DBusMessage *, void *); + + +static DBusHandlerResult handle_change_role_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); +static DBusHandlerResult handle_connect_req(DBusConnection *dbus_conn, DBusMessage *msg, void* data); +static DBusHandlerResult handle_disconnect_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); +static DBusHandlerResult handle_disconnect_all_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); +static DBusHandlerResult handle_get_active_conn_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); +static DBusHandlerResult handle_get_devices_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); +static DBusHandlerResult handle_listen_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); +static DBusHandlerResult handle_listen_stop_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); +static DBusHandlerResult handle_search_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data); + + +typedef struct +{ + char *name; + pand_services_handler handle_func; +}pand_services_data_t; + + +static pand_services_data_t pand_services[] = { + {"ChangeRoleReq", handle_change_role_req }, + {"ConnectReq", handle_connect_req }, + {"DisconnectReq", handle_disconnect_req}, + {"DisconnectAllReq", handle_disconnect_all_req}, + {"GetActiveConnectionsReq", handle_get_active_conn_req}, + {"GetDevicesReq", handle_get_devices_req}, + {"ListenReq", handle_listen_req}, + {"ListenStopReq", handle_listen_stop_req}, + {"SearchReq", handle_search_req}, + {NULL, NULL} +}; + +static DBusConnection *dbus_conn; +static GMainLoop *main_loop = NULL ; + +/** + * Initialize D-BUS connection + * @param + * @return + */ +int +pand_dbus_start() +{ + + DBusError dbus_error; + //TODO pthread_t thread_id; + int result = 0; + + /* TODO check for other pand instance running + * Only one instance is allowed! + */ + + + dbus_error_init(&dbus_error); + dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error); + + if (!dbus_conn) { + syslog(LOG_ERR, "Failed to open connection to system message bus: %s\n", + dbus_error.message); + dbus_error_free(&dbus_error); + return -1; + } +#ifdef DBUS_033 + if(!dbus_bus_request_name(dbus_conn, ORG_BLUEZ_DBUS_NAME, 0, &dbus_error)) { +#else + if(!dbus_bus_acquire_service(dbus_conn, ORG_BLUEZ_DBUS_NAME, 0, &dbus_error)) { +#endif + syslog(LOG_ERR,"DBUS acquire service error: %s\n", dbus_error.message); + dbus_error_free (&dbus_error); + result = -1; + goto skip_label; + } + + if (!dbus_connection_register_object_path (dbus_conn, ORG_BLUEZ_PAND_OBJ, + &pand_vtable, NULL)) { + syslog(LOG_ERR,"DBUS failed to register org/bluez/pand object\n"); + result = -1; + goto skip_label; + } + + main_loop = g_main_loop_new (NULL, FALSE); + + dbus_connection_setup_with_g_main (dbus_conn, NULL) ; + + g_main_loop_run (main_loop) ; + + +skip_label: + return result; +} + +/** + * Close D-BUS connection and the main loop + * @param + * @return + */ +int +pand_dbus_stop() +{ + if(main_loop){ + g_main_loop_quit(main_loop); + } + if (dbus_conn) { + dbus_connection_disconnect(dbus_conn); + dbus_conn = NULL; + } + return 0; +} + + +/** + * TODO method not implemented + * @param + * @return + */ +static DBusHandlerResult +handle_change_role_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + pand_dbus_change_role_req_t req; + pand_dbus_req_cnf_t cnf_result; + int ret_val = 0, size; + + syslog(LOG_INFO, "%s line:%d - method not implemented", __PRETTY_FUNCTION__, __LINE__); + + memset(&req, 0, sizeof(pand_dbus_change_role_req_t)); + + cnf_result.type = PAND_DBUS_CHANGE_ROLE_REQ_CNF_TYPE; + + if(!pand_util_get_req_attr(msg, PAND_DBUS_CHANGE_ROLE_REQ_TYPE, sizeof(pand_dbus_change_role_req_t),&req)){ + + //TODO check current daemon status + //ret_val = cmd_change_role(&req); + cnf_result.result = (!ret_val?PAND_RESULT_SUCCESS:PAND_RESULT_FAILED); + } else { + cnf_result.result = PAND_RESULT_FAILED; + } + + + size = sizeof(pand_dbus_req_cnf_t); + ptr = (const unsigned char*)&cnf_result; + + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, size); + + + //TODO check iter results + + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __PRETTY_FUNCTION__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } + +skip_label: + return result; +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_connect_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + int ret_val, size; + pand_dbus_conn_req_t req; + pand_dbus_req_cnf_t cnf_result; + + memset(&req, 0, sizeof(pand_dbus_conn_req_t)); + + cnf_result.type = PAND_DBUS_CONN_REQ_CNF_TYPE; + + if(!pand_util_get_req_attr(msg, PAND_DBUS_CONN_REQ_TYPE, sizeof(pand_dbus_conn_req_t), &req)){ + + //TODO check the current daemon status + //check role, if is connected. scatternet are not allowed + ret_val = cmd_connect(req.bdaddr, req.role, req.service); + cnf_result.result = (!ret_val?PAND_RESULT_SUCCESS:PAND_RESULT_FAILED); + } else { + cnf_result.result = PAND_RESULT_FAILED; + + } + + size = sizeof(pand_dbus_req_cnf_t); + ptr = (const unsigned char*)&cnf_result; + + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, size); + + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __PRETTY_FUNCTION__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } + +skip_label: + if (reply) { + dbus_message_unref (reply) ; + reply = NULL ; + } + + return result; +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_disconnect_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + pand_dbus_disconn_req_t req; + pand_dbus_req_cnf_t cnf_result; + int ret_val, size; + + memset(&req, 0, sizeof(pand_dbus_disconn_req_t)); + + cnf_result.type = PAND_DBUS_DISCONN_REQ_CNF_TYPE; + + if(!pand_util_get_req_attr(msg, PAND_DBUS_DISCONN_REQ_TYPE, sizeof(pand_dbus_disconn_req_t),&req)){ + + //TODO check current daemon status + ret_val = cmd_disconnect(&req); + cnf_result.result = (!ret_val?PAND_RESULT_SUCCESS:PAND_RESULT_FAILED); + + } else { + cnf_result.result = PAND_RESULT_FAILED; + } + + size = sizeof(pand_dbus_req_cnf_t); + ptr = (const unsigned char*)&cnf_result; + + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, size); + + + //TODO check iter results + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __PRETTY_FUNCTION__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } + +skip_label: + if (reply) { + dbus_message_unref (reply) ; + reply = NULL ; + } + + return result; +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_disconnect_all_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + pand_dbus_disconn_all_req_t req; + pand_dbus_req_cnf_t cnf_result; + int ret_val, size; + + memset(&req, 0, sizeof(pand_dbus_disconn_all_req_t)); + + //HOW address when the dbus client app send data? + // suggestion: pass the wanted size:P + + cnf_result.type = PAND_DBUS_DISCONN_ALL_REQ_CNF_TYPE; + + if(!pand_util_get_req_attr(msg, PAND_DBUS_DISCONN_ALL_REQ_TYPE, sizeof(pand_dbus_disconn_all_req_t),&req)){ + + //TODO check current daemon status + ret_val = cmd_disconnect(NULL); + cnf_result.result = (!ret_val?PAND_RESULT_SUCCESS:PAND_RESULT_FAILED); + } else { + cnf_result.result = PAND_RESULT_FAILED; + } + + size = sizeof(pand_dbus_req_cnf_t); + ptr = (const unsigned char*)&cnf_result; + + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, size); + + //TODO check iter results + + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __PRETTY_FUNCTION__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } + +skip_label: + if (reply) { + dbus_message_unref (reply) ; + reply = NULL ; + } + + return result; +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_get_active_conn_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + pand_dbus_get_active_conn_req_t req; + pand_dbus_get_active_conn_cnf_t *cnf_data = NULL; + pand_dbus_req_cnf_t *cnf_result = NULL; + int ret_val = -1; + int cnf_res_size = 0; + int data_size = 0; + + + + if(!pand_util_get_req_attr(msg, PAND_DBUS_GET_ACTIVE_CONN_REQ_TYPE, sizeof(pand_dbus_get_active_conn_req_t),&req)){ + + //TODO check current daemon status + ret_val = cmd_get_active_conn(&req, &cnf_data); + } + + cnf_res_size = sizeof(pand_dbus_req_cnf_t); + + if(!ret_val) { + + data_size = (cnf_data->num_conn )* sizeof(pand_active_conn_t) + sizeof(pand_dbus_get_active_conn_cnf_t); + cnf_result = (pand_dbus_req_cnf_t*)malloc(cnf_res_size + data_size); + cnf_result -> type = PAND_DBUS_GET_ACTIVE_CONN_REQ_CNF_TYPE; + cnf_result -> result = PAND_RESULT_SUCCESS; + memcpy(cnf_result->data, cnf_data,data_size); + cnf_res_size += data_size; + } else { + cnf_result = (pand_dbus_req_cnf_t*)malloc(cnf_res_size); + cnf_result -> type = PAND_DBUS_GET_ACTIVE_CONN_REQ_CNF_TYPE; + cnf_result -> result = PAND_RESULT_FAILED; + } + + ptr = (const unsigned char*)cnf_result; + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, cnf_res_size); + + //TODO check iter results + + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __PRETTY_FUNCTION__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } + +skip_label: + if (reply) { + dbus_message_unref (reply) ; + reply = NULL ; + } + + if(cnf_result) { + free(cnf_result); + } + + if(cnf_data) { + free(cnf_data); + } + + return result; +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_get_devices_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + char req; + pand_dbus_req_cnf_t *cnf_result = NULL; + pand_dbus_get_dev_cnf_t *cnf_data = NULL; + int ret_val = -1; + int cnf_res_size, data_size; + + + if(!pand_util_get_req_attr(msg, PAND_DBUS_GET_DEV_INFO_REQ_TYPE, 0, &req)){ + + ret_val = cmd_get_devices(&cnf_data); + + } + + cnf_res_size = sizeof(pand_dbus_req_cnf_t); + + if(!ret_val) { + data_size = (cnf_data->num_dev )* sizeof(pand_dev_info_t) + sizeof(pand_dbus_get_dev_cnf_t); + cnf_result = (pand_dbus_req_cnf_t*)malloc(cnf_res_size + data_size); + cnf_result->type = PAND_DBUS_GET_DEV_INFO_CNF_TYPE; + cnf_result->result = PAND_RESULT_SUCCESS; + memcpy(cnf_result->data, cnf_data,data_size); + cnf_res_size += data_size; + } else { + cnf_result = (pand_dbus_req_cnf_t*)malloc(cnf_res_size); + cnf_result->type = PAND_DBUS_GET_DEV_INFO_CNF_TYPE; + cnf_result->result = PAND_RESULT_FAILED; + } + + ptr = (const unsigned char*)cnf_result; + + reply = dbus_message_new_method_return(msg); + + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, cnf_res_size); + + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __PRETTY_FUNCTION__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } + +skip_label: + if (reply) { + dbus_message_unref (reply) ; + reply = NULL ; + } + if(cnf_result) { + free(cnf_result); + } + + if(cnf_data) { + free(cnf_data); + } + + return result; +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_listen_req(DBusConnection *dbus_conn, DBusMessage *msg, void* data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + pand_dbus_listen_req_t req; + pand_dbus_req_cnf_t cnf_result; + int ret_val, size; + + + memset(&req, 0, sizeof(pand_dbus_listen_req_t)); + + cnf_result.type = PAND_DBUS_LISTEN_REQ_CNF_TYPE; + + + if(!pand_util_get_req_attr(msg, PAND_DBUS_LISTEN_REQ_TYPE, sizeof(pand_dbus_listen_req_t),&req)){ + ret_val = cmd_listen(&req); + cnf_result.result = (!ret_val?PAND_RESULT_SUCCESS:PAND_RESULT_FAILED); + }else{ + cnf_result.result = PAND_RESULT_FAILED; + } + + size = sizeof(pand_dbus_req_cnf_t); + ptr = (const unsigned char*)&cnf_result; + + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, size); + + + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __FILE__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } + +skip_label: + if (reply) { + dbus_message_unref (reply) ; + reply = NULL ; + } + return result; +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_listen_stop_req(DBusConnection *dbus_conn, DBusMessage *msg, void* data) +{ + DBusMessage *reply = NULL; + DBusMessageIter iter; + const unsigned char *ptr; + DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; + pand_dbus_listen_stop_req_t req; + pand_dbus_req_cnf_t cnf_result; + int ret_val, size; + + memset(&req, 0, sizeof(pand_dbus_listen_stop_req_t)); + + cnf_result.type = PAND_DBUS_LISTEN_STOP_REQ_CNF_TYPE; + + if(!pand_util_get_req_attr(msg, PAND_DBUS_LISTEN_STOP_REQ_TYPE, sizeof(pand_dbus_listen_stop_req_t),&req)){ + ret_val = cmd_listen_stop(&req); + cnf_result.result = (!ret_val?PAND_RESULT_SUCCESS:PAND_RESULT_FAILED); + }else{ + cnf_result.result = PAND_RESULT_FAILED; + } + + size = sizeof(pand_dbus_req_cnf_t); + ptr = (const unsigned char*)&cnf_result; + + reply = dbus_message_new_method_return(msg); + dbus_message_iter_init(reply, &iter); + dbus_message_append_iter_init(reply, &iter); + dbus_message_iter_append_byte_array(&iter, ptr, size); + + if (!dbus_connection_send (dbus_conn, reply, NULL)) { + syslog(LOG_ERR, "fatal error at %s:%d\n", + __FILE__, __LINE__) ; + result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + goto skip_label; + } +skip_label: + if (reply) { + dbus_message_unref (reply) ; + reply = NULL ; + } + return result; +} +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +handle_search_req(DBusConnection *dbus_conn, DBusMessage *msg, void *data) +{ + DBusHandlerResult result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + syslog(LOG_INFO, "%s - line: %d\n", __PRETTY_FUNCTION__, __LINE__); + + return result; +} + +/** + * TODO + * @param + * @return + */ +static void +pand_dbus_unregistered_func (DBusConnection *dbus_conn, + gpointer user_data) +{ + return; + +} + +/** + * TODO + * @param + * @return + */ +static DBusHandlerResult +pand_dbus_msg_func (DBusConnection *dbus_conn, DBusMessage *msg, gpointer user_data) +{ + pand_services_data_t *ptr_handlers = pand_services; + DBusHandlerResult result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + const char *method; + const char *path; + + method = dbus_message_get_member (msg); + path = dbus_message_get_path (msg); + + for (;ptr_handlers->name; ptr_handlers++) { + if(dbus_message_is_method_call(msg , ORG_BLUEZ_PAND_DBUS_IFACE, ptr_handlers->name)) + { + result = (ptr_handlers->handle_func)(dbus_conn, msg, user_data); + + if(result == DBUS_HANDLER_RESULT_HANDLED) { + dbus_message_unref (msg) ; + msg = NULL ; + } + break; + } + } + return result; + +} diff -urNaw bluez-utils-2.17.orig/pand/pand_dbus_commands.c bluez-utils-2.17-dbus/pand/pand_dbus_commands.c --- bluez-utils-2.17.orig/pand/pand_dbus_commands.c 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/pand_dbus_commands.c 2005-05-20 16:38:43.628259880 -0300 @@ -0,0 +1,514 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2005 Claudio Takahasi <claudio.takahasi@indt.org> + * Copyright (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id: pand_dbus_commands.c,v 1.12 2005/05/22 13:00:00 holtmann Exp $ + */ + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <pthread.h> +#include <signal.h> +#include <errno.h> +#include <unistd.h> + +#include <sys/syslog.h> +#include <sys/socket.h> +#include <sys/poll.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/ioctl.h> + + +#include <bluetooth/bluetooth.h> +#include <bluetooth/hci.h> +#include <bluetooth/hci_lib.h> +#include <bluetooth/l2cap.h> +#include <bluetooth/bnep.h> + +#include <libbridge.h> + +#include "pand_dbus_commands.h" +#include "pand.h" + + +//TODO +static char netdev[16] = "bnep%d"; +extern int terminate; +static pthread_t threadid = 0; + +typedef struct { + int role; + int sk; + struct sockaddr_l2 *l2a; +}listen_args_t; + + +/** + * Get list of connected devices + * @param + * @return + */ +static int get_conn_list(int s, int dev_id, pand_dbus_get_active_conn_cnf_t **preq_cnf) +{ + struct hci_conn_list_req *cl; + struct hci_conn_info *ci; + pand_active_conn_t conn; + int i; + int ret_val = -1; + + if (dev_id < 0) + return -1; + + if (!(cl = malloc(10 * sizeof(*ci) + sizeof(*cl)))) { + syslog(LOG_ERR,"Can't allocate memory"); + return -1; + } + cl->dev_id = dev_id; + cl->conn_num = 10; + ci = cl->conn_info; + + if (ioctl(s, HCIGETCONNLIST, (void *) cl)) { + syslog(LOG_ERR,"Can't get connection list"); + goto cleanup; + } + + *preq_cnf = (pand_dbus_get_active_conn_cnf_t*) malloc(sizeof(pand_dbus_get_active_conn_cnf_t)); + (*preq_cnf)->num_conn = 0; + + + for (i = 0; i < cl->conn_num; i++, ci++) { + char addr[18]; + ba2str(&ci->bdaddr, addr); + memset(&conn, 0, sizeof(pand_active_conn_t)); + strcpy(conn.bdaddr, addr); + conn.link_type = ci->type; + conn.handle = ci->handle; + conn.state = ci->state; + conn.master = ci->link_mode; + + *preq_cnf = (pand_dbus_get_active_conn_cnf_t*)realloc \ + (*preq_cnf, ((*preq_cnf)->num_conn + 1) * \ + sizeof(pand_active_conn_t) + \ + sizeof(pand_dbus_get_active_conn_cnf_t)); + + memcpy((*preq_cnf)->conn + (*preq_cnf)->num_conn, &conn, sizeof(pand_active_conn_t)); + + (*preq_cnf)->num_conn++; + } + ret_val = 0; +cleanup: + return ret_val; +} + +/** + * Dealocate thread parameters + * @param + * @return + */ +static +void deallocate_thread_param(void* param) +{ + listen_args_t *p = (listen_args_t*)param; + + close(p->sk); + free (p->l2a); + free (p); +} + +/** + * Listen thread function + * @param + * @return + */ +void *listen_thread (void *param) +{ + listen_args_t *p = (listen_args_t*)param; + + + pthread_cleanup_push (deallocate_thread_param, p); + while (!terminate) { + int alen = sizeof(struct sockaddr_l2); + int nsk; + + nsk = accept(p->sk, (struct sockaddr *) p->l2a, &alen); + + if (nsk < 0) { + syslog(LOG_ERR, "Accept failed. %s(%d)\n", strerror(errno), errno); + continue; + } + + switch (fork()) { + case 0: + break; + case -1: + syslog(LOG_ERR, "Fork failed. %s(%d)\n", strerror(errno), errno); + default: + close(nsk); + continue; + } + + if (!bnep_accept_connection(nsk, p->role, netdev)) { + char str[40]; + ba2str(&(p->l2a->l2_bdaddr), str); + + syslog(LOG_INFO, "New connection from %s %s\n", str, netdev); + /* TODO for GN and NAP add the new device to the bridge */ + /* TODO notify all dbus connected clients */ + } else { + syslog(LOG_ERR, "Connection failed. %s(%d)\n", + strerror(errno), errno); + } + + close(nsk); + syslog(LOG_INFO,"%s line:%d", __PRETTY_FUNCTION__, __LINE__); + exit(0); + } + close(p->sk); + pthread_cleanup_pop(1); + bnep_sdp_unregister(); + + return NULL; +} + + + +/** + * Connect and initiate BNEP session + * @param + * @return + * -1 - critical error (exit persist mode) + * 1 - non critical error + * 0 - success + */ +int cmd_connect(char *dst, uint16_t role, uint16_t service) +{ + struct l2cap_options l2o; + struct sockaddr_l2 l2a; + bdaddr_t src_addr = *BDADDR_ANY; + int sk, olen, ret_val = 0; + + syslog(LOG_INFO, "Connecting to %s\n", dst); + + sk = socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); + if (sk < 0) { + syslog(LOG_ERR, "Cannot create L2CAP socket. %s(%d)", + strerror(errno), errno); + return -1; + } + + /* Setup L2CAP options according to BNEP spec */ + memset(&l2o, 0, sizeof(l2o)); + olen = sizeof(l2o); + getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen); + l2o.imtu = l2o.omtu = BNEP_MTU; + setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, sizeof(l2o)); + + memset(&l2a, 0, sizeof(l2a)); + l2a.l2_family = AF_BLUETOOTH; + bacpy(&l2a.l2_bdaddr, &src_addr); + + if (bind(sk, (struct sockaddr *) &l2a, sizeof(l2a))) + syslog(LOG_ERR, "Bind failed. %s(%d)", + strerror(errno), errno); + + memset(&l2a, 0, sizeof(l2a)); + l2a.l2_family = AF_BLUETOOTH; + //bacpy(&l2a.l2_bdaddr, bdaddr); + str2ba(dst, &l2a.l2_bdaddr); + l2a.l2_psm = htobs(BNEP_PSM); + + if (!connect(sk, (struct sockaddr *) &l2a, sizeof(l2a)) && + !bnep_create_connection(sk, role, service, netdev)) { + + syslog(LOG_INFO, "%s connected", netdev); + //run_devup(netdev, dst, sk, -1); + ret_val = 0; + } else { + syslog(LOG_ERR, "Connect to %s failed. %s(%d)", + dst, strerror(errno), errno); + ret_val = 1; + } + + close(sk); + return ret_val; +} + +/** + * Disconnect from one or all connected devices + * @param + * @return + */ +int cmd_disconnect (pand_dbus_disconn_req_t *pdc) +{ + int ret_val = -1; + bdaddr_t *dst; + + + if(pdc) { + if(pdc->bdaddr[0] != 0) { + dst = strtoba(pdc->bdaddr); + ret_val = bnep_kill_connection((uint8_t*)dst); + } + + }else + { + ret_val = bnep_kill_all_connections(); + } + return ret_val; +} + +/** + * Returns active connections + * @param + * @return + */ +int cmd_get_active_conn(pand_dbus_get_active_conn_req_t *preq, pand_dbus_get_active_conn_cnf_t **preq_cnf) +{ + int ret_val = -1; + + struct hci_dev_list_req *dl = NULL; + struct hci_dev_req *dr = NULL; + int i, sk; + + if(!preq || !preq_cnf) { + return -1; + } + + memset(preq_cnf,0,sizeof(pand_dbus_get_active_conn_cnf_t)); + + sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (sk < 0) + return -1; + + if(preq->dev_id != 0) { + get_conn_list(sk, preq->dev_id, preq_cnf); + }else { + dl = malloc(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl)); + if (!dl) { + goto cleanup; + } + + dl->dev_num = HCI_MAX_DEV; + dr = dl->dev_req; + + if (ioctl(sk, HCIGETDEVLIST, (void *) dl)) + goto cleanup; + + for (i = 0; i < dl->dev_num; i++, dr++) { + if (hci_test_bit(HCI_UP, &dr->dev_opt)) + ret_val = get_conn_list(sk, dr->dev_id, preq_cnf); + } + } + +cleanup: + close(sk); + if(dl) { + free(dl); + } + + return ret_val; +} + +/** + * Gets local Bluetooth devices + * @param + * @return + */ +int cmd_get_devices(pand_dbus_get_dev_cnf_t **preq_cnf) +{ + struct hci_dev_list_req *dl = NULL; + struct hci_dev_req *dr = NULL; + pand_dev_info_t *pdev = NULL; + struct hci_dev_info di; + int i, sk, size; + char addr[18]; + int ret_val = 0; + + if(!preq_cnf) { + return -1; + } + + sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (sk < 0) + return -1; + + dl = malloc(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl)); + + if (!dl) { + ret_val = -1; + goto cleanup; + } + + dl->dev_num = HCI_MAX_DEV; + dr = dl->dev_req; + + if (ioctl(sk, HCIGETDEVLIST, (void *) dl)) { + ret_val = -1; + goto cleanup; + } + + size = sizeof(pand_dbus_get_dev_cnf_t); + *preq_cnf = (pand_dbus_get_dev_cnf_t*)realloc(*preq_cnf, size); + (*preq_cnf)->num_dev = 0; + + for (i = 0; i < dl->dev_num; i++, dr++) { + if (hci_test_bit(HCI_UP, &dr->dev_opt)) { + memset(&di, 0 , sizeof(struct hci_dev_info)); + di.dev_id = dr->dev_id; + if (!ioctl(sk, HCIGETDEVINFO, (void *) &di)) { + size = ((*preq_cnf)->num_dev +1)* sizeof(pand_dev_info_t)+ sizeof(pand_dbus_get_dev_cnf_t); + *preq_cnf = (pand_dbus_get_dev_cnf_t*)realloc(*preq_cnf, size); + pdev = ((pand_dev_info_t*)(*preq_cnf)->devices); + pdev = pdev + (*preq_cnf)->num_dev; + pdev->dev_id = di.dev_id; + strcpy(pdev->name, di.name); + ba2str(&di.bdaddr, addr); + strcpy(pdev->bdaddr, addr); + (*preq_cnf)->num_dev++; + } + } + } + +cleanup: + close(sk); + if(dl) { + free(dl); + } + + return ret_val; +} + +/** + * Listen for incomming connections + * @param + * @return + */ +int +cmd_listen(pand_dbus_listen_req_t *preq) { + + struct l2cap_options l2o; + struct sockaddr_l2 *pl2a = NULL; + listen_args_t *listen_arguments; + bdaddr_t src_addr = *BDADDR_ANY; + //pthread_t threadid; + int sk, olen, lm; + + /* TODO Check if the thread is running */ + + /* TODO Create the bridge */ + if(preq->role != BNEP_SVC_PANU) { + if(preq->bridge_mode == ENABLE_BRIDGE) { + + } + } + + //TODO validate parameters + if(bnep_sdp_register(preq->role)) + { + syslog(LOG_ERR, "BNEP register failed. %s(%d)", + strerror(errno), errno); + return -1; + } + + /* Create L2CAP socket and bind it to PSM BNEP */ + sk = socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); + if (sk < 0) { + syslog(LOG_ERR, "Cannot create L2CAP socket. %s(%d)", + strerror(errno), errno); + return -1; + } + + pl2a = (struct sockaddr_l2*)malloc(sizeof(struct sockaddr_l2)); + memset(pl2a, 0, sizeof(struct sockaddr_l2)); + pl2a->l2_family = AF_BLUETOOTH; + bacpy(&(pl2a->l2_bdaddr), &src_addr); + pl2a->l2_psm = htobs(BNEP_PSM); + + if (bind(sk, (struct sockaddr *) pl2a, sizeof(struct sockaddr_l2))) { + syslog(LOG_ERR, "Bind failed. %s(%d)", strerror(errno), errno); + return -1; + } + + /* Setup L2CAP options according to BNEP spec */ + memset(&l2o, 0, sizeof(l2o)); + olen = sizeof(l2o); + if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &olen) < 0) { + syslog(LOG_ERR, "Failed to get L2CAP options. %s(%d)", + strerror(errno), errno); + return -1; + } + + l2o.imtu = l2o.omtu = BNEP_MTU; + if (setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, sizeof(l2o)) < 0) { + syslog(LOG_ERR, "Failed to set L2CAP options. %s(%d)", + strerror(errno), errno); + return -1; + } + + /* Set link mode */ + lm = 0; + if (preq->master) + lm |= L2CAP_LM_MASTER; + if (preq->encrypt) + lm |= L2CAP_LM_ENCRYPT; + if (preq->secure) + lm |= L2CAP_LM_SECURE; + + if (lm && setsockopt(sk, SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) < 0) { + syslog(LOG_ERR, "Failed to set link mode. %s(%d)", strerror(errno), errno); + return -1; + } + listen(sk, 10); + + listen_arguments = (listen_args_t*)malloc(sizeof(listen_args_t)); + listen_arguments->role = preq->role; + listen_arguments->sk = sk; + listen_arguments->l2a = pl2a; + + terminate = 0; + + return pthread_create (&threadid, NULL, &listen_thread, listen_arguments); +} +/** + * Cancel listen thread + * @param + * @return + */ +int +cmd_listen_stop(pand_dbus_listen_stop_req_t *preq) +{ + int ret_val = -1; + terminate = 1; + if(threadid) { + pthread_cancel(threadid); + threadid = 0; + ret_val = 0; + } + return ret_val; + +} + diff -urNaw bluez-utils-2.17.orig/pand/pand_dbus_commands.h bluez-utils-2.17-dbus/pand/pand_dbus_commands.h --- bluez-utils-2.17.orig/pand/pand_dbus_commands.h 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/pand_dbus_commands.h 2005-05-20 16:38:43.667253952 -0300 @@ -0,0 +1,45 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2005 Claudio Takahasi <claudio.takahasi@indt.org> + * Copyright (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id: pand_dbus_commands.h,v 1.12 2005/05/22 13:00:00 holtmann Exp $ + */ + +#ifndef __H_PAND_DBUS_COMMANDS_H__ +#define __H_PAND_DBUS_COMMANDS_H__ + +#include "dbus_services.h" + +#define PAND_SIGNAL_STOP 0x01 + +int cmd_connect(char *dst, uint16_t role, uint16_t service); +int cmd_disconnect (pand_dbus_disconn_req_t *pdc); +int cmd_listen(pand_dbus_listen_req_t *preq); +int cmd_listen_stop(pand_dbus_listen_stop_req_t *preq); +int cmd_get_active_conn(pand_dbus_get_active_conn_req_t *preq, pand_dbus_get_active_conn_cnf_t**preq_cnf); +int cmd_get_devices(pand_dbus_get_dev_cnf_t **preq_cnf); + + +#endif diff -urNaw bluez-utils-2.17.orig/pand/pand_dbus.h bluez-utils-2.17-dbus/pand/pand_dbus.h --- bluez-utils-2.17.orig/pand/pand_dbus.h 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/pand_dbus.h 2005-05-20 17:12:06.456783664 -0300 @@ -0,0 +1,41 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2005 Claudio Takahasi <claudio.takahasi@indt.org> + * Copyright (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id: pand_dbus.h,v 1.12 2005/05/22 13:00:00 holtmann Exp $ + */ +#ifndef __H_PAND_DBUS_H__ +#define __H_PAND_DBUS_H__ + +#include <stdlib.h> + + + + + +int pand_dbus_start(); +int pand_dbus_stop(); + +#endif /* __H_PAND_DBUS_H__*/ diff -urNaw bluez-utils-2.17.orig/pand/pand_dbus_util.c bluez-utils-2.17-dbus/pand/pand_dbus_util.c --- bluez-utils-2.17.orig/pand/pand_dbus_util.c 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/pand_dbus_util.c 2005-05-20 16:32:46.420563704 -0300 @@ -0,0 +1,102 @@ + +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2005 Claudio Takahasi <claudio.takahasi@indt.org> + * Copyright (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id: pand_dbus_util.c,v 1.12 2005/05/22 13:00:00 holtmann Exp $ + */ + +#include <string.h> +#include <sys/syslog.h> +#include <dbus/dbus.h> +#include <dbus/dbus-glib-lowlevel.h> +#include <dbus/dbus-protocol.h> + +#include "pand_dbus_util.h" +#include "dbus_services.h" + +/** + * Get message type + * @param + * @return + */ +PAND_MESSAGE_TYPE +pand_util_get_msg_type(DBusMessage * msg) +{ + PAND_MESSAGE_TYPE ret_type = PAND_DBUS_INVALID_TYPE; + DBusError error; + uint8_t type; + + dbus_error_init(&error); + + if(dbus_message_get_args (msg,&error,DBUS_TYPE_BYTE, &type, DBUS_TYPE_INVALID)) { + ret_type = type; + } + + dbus_error_free(&error); + + return ret_type; +} + +/** + * Get message attributes + * @param + * @return + */ +int pand_util_get_req_attr(DBusMessage *msg, PAND_MESSAGE_TYPE type, int size, void *preq_attr) +{ + const unsigned char *ptr; + DBusMessageIter iter; + int n, ret_val = -1; + PAND_MESSAGE_TYPE msg_type; + + if(msg) { + dbus_message_iter_init(msg, &iter); + //Get the fisrt byte in order to check the code + msg_type = dbus_message_iter_get_byte(&iter); + + if(msg_type == type) { + /* check wanted size to avoid memory access violation */ + if(size > 0) { + if(dbus_message_iter_next(&iter)) { + //TODO check return result + dbus_message_iter_get_byte_array(&iter,(void*) &ptr, &n); + if(n == size) { + memcpy(preq_attr, ptr, n); + ret_val = 0; + } + }else { + preq_attr = NULL; + } + }else if(size == 0) { + /* if the request doesn't have data, just return true */ + ret_val = 0; + } + } + } + return ret_val; +} + + diff -urNaw bluez-utils-2.17.orig/pand/pand_dbus_util.h bluez-utils-2.17-dbus/pand/pand_dbus_util.h --- bluez-utils-2.17.orig/pand/pand_dbus_util.h 1969-12-31 21:00:00.000000000 -0300 +++ bluez-utils-2.17-dbus/pand/pand_dbus_util.h 2005-05-18 18:56:26.000000000 -0300 @@ -0,0 +1,55 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2005 Claudio Takahasi <claudio.takahasi@indt.org> + * Copyright (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id: pand_dbus_util.h,v 1.12 2005/05/22 13:00:00 holtmann Exp $ + */ +#ifndef __H_PAND_DBUS_UTIL_H__ +#define __H_PAND_DBUS_UTIL_H__ + +#include "dbus_services.h" + + +/** + * + * + * + */ +PAND_MESSAGE_TYPE pand_util_get_msg_type(DBusMessage *); +/** + * + * + * size: wanted body size + */ +int pand_util_get_req_attr(DBusMessage *msg, PAND_MESSAGE_TYPE type, int size, void *preq_attr); +/** + * + * + * + */ +int pand_util_get_conn_req_attr(DBusMessage *, pand_dbus_conn_req_t*); + + +#endif /* __H_PAND_DBUS_UTIL_H__ */ ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-20 21:04 ` Claudio Takahasi @ 2005-05-23 10:27 ` Marcel Holtmann 2005-05-23 15:02 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-23 10:27 UTC (permalink / raw) To: bluez-devel Hi Claudio, > I am sending a initial skeleton of pand DBUS support. I was not able to > access BlueZ CVS due firewall permissions. > > The path is based on bluez-utils-2.17. no problem the 2.17 is quite up-to-date. > Suggestions and comments are welcome! please use only the file dbus.c and put needed function prototypes into pand.h. The dbus_services.h is not needed. Put the declarations into dbus.c. Don't provide and "hcid" service within pand. If you wanna provide HCI task then hide them inside the pand D-Bus. Use org.bluez.pand as base name for all stuff. Never use dev_id. You can use the source Bluetooth address instead and then convert it to dev_id internally. Don't use bdaddr_t at all. Simply use the string representation of the Bluetooth device address. Don't use char to represent an one byte value. Use uint8_t. Once if we agree on the changes to Makefile.am, pand.h and main.c, then I can commit a simple framework with an empty dbus.c and you only need to send me changes to dbus.c from then on. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-23 10:27 ` Marcel Holtmann @ 2005-05-23 15:02 ` Claudio Takahasi 2005-05-24 9:07 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-23 15:02 UTC (permalink / raw) To: bluez-devel Hi Marcel, I will fix your suggestions. Regarding our suggestion about the service name. I consider the following basic features essential to establish and control connections: * Search for a service (provided by sdptool) * Display local devices (provided by hcitool) * Switch master/slave role (provided by hcitool) * Listen for PAN connections (provided by pand) * Connect (provided by pand) * Disconnect (provided by pand) * Display active connections (provided by pand) According to D-BUS specification when messages are received over a D-BUS connection, they are sent to a specific object, not to the application as a whole. Each object supports one or more interfaces. =20 We have two options: 1. define one object with only one interface eg: =20 object:org.bluez.pand interface:org.bluez.pand 2. define one object with multiple interfaces eg: =20 object:org.bluez.pand interface: org.bluez.pand interface: org.bluez.sdp interface: org.bluez.hci For the both cases, pand will be the daemon responsible for provide this interfaces/services. What approach do you preffer? The last alternative is better because it is possible define more detailed rules in the dbus configuration file.=20 Another point is the header for dbus services, the client application must know the message format, therefore the header file(dbus_services.h) will be required. In the future, develop a library hidding D-BUS message details is a better option. Regards, Claudio. On 5/23/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > I am sending a initial skeleton of pand DBUS support. I was not able to > > access BlueZ CVS due firewall permissions. > > > > The path is based on bluez-utils-2.17. >=20 > no problem the 2.17 is quite up-to-date. >=20 > > Suggestions and comments are welcome! >=20 > please use only the file dbus.c and put needed function prototypes into > pand.h. The dbus_services.h is not needed. Put the declarations into > dbus.c. >=20 > Don't provide and "hcid" service within pand. If you wanna provide HCI > task then hide them inside the pand D-Bus. Use org.bluez.pand as base > name for all stuff. >=20 > Never use dev_id. You can use the source Bluetooth address instead and > then convert it to dev_id internally. Don't use bdaddr_t at all. Simply > use the string representation of the Bluetooth device address. >=20 > Don't use char to represent an one byte value. Use uint8_t. >=20 > Once if we agree on the changes to Makefile.am, pand.h and main.c, then > I can commit a simple framework with an empty dbus.c and you only need > to send me changes to dbus.c from then on. >=20 > Regards >=20 > Marcel >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=3D7412&alloc_id=3D16344&op=3Dclick > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-23 15:02 ` Claudio Takahasi @ 2005-05-24 9:07 ` Marcel Holtmann 2005-05-25 22:20 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-24 9:07 UTC (permalink / raw) To: bluez-devel Hi Claudio, > Regarding our suggestion about the service name. I consider the > following basic features essential to establish and control connections: > * Search for a service (provided by sdptool) > * Display local devices (provided by hcitool) > * Switch master/slave role (provided by hcitool) > * Listen for PAN connections (provided by pand) > * Connect (provided by pand) > * Disconnect (provided by pand) > * Display active connections (provided by pand) > > According to D-BUS specification when messages are received over a > D-BUS connection, > they are sent to a specific object, not to the application as a whole. > Each object supports > one or more interfaces. > > We have two options: > 1. define one object with only one interface > eg: > object:org.bluez.pand > interface:org.bluez.pand > 2. define one object with multiple interfaces > eg: > object:org.bluez.pand > interface: org.bluez.pand > interface: org.bluez.sdp > interface: org.bluez.hci > > For the both cases, pand will be the daemon responsible for > provide this interfaces/services. > What approach do you preffer? > The last alternative is better because it is possible define more > detailed rules in the dbus configuration file. this might be, but until we don't fully understand what functionality we need to provide over D-Bus I like to go with 1). In general the first version of an API sucks and I don't wanna spread it over different interfaces and have to deprecate them. > Another point is the header for dbus services, the client application > must know the message format, therefore the header file(dbus_services.h) > will be required. In the future, develop a library hidding D-BUS message > details is a better option. Then make it dbus.h for the service definitions and move the rest into dbus.c and the function declaration into pand.h. For now copy the dbus.h to the client application and we will sort out the details of it later. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-24 9:07 ` Marcel Holtmann @ 2005-05-25 22:20 ` Claudio Takahasi 2005-05-26 9:08 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-25 22:20 UTC (permalink / raw) To: bluez-devel Hi Marcel, A new patch is available in the link below: http://www.indt.org.br/maemo/bluez/ The DBUS.TXT file contains information to run the sample and how configure the service. Suggestions and comments are welcome! Regards, Claudio. On 5/24/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > Regarding our suggestion about the service name. I consider the > > following basic features essential to establish and control connections= : > > * Search for a service (provided by sdptool) > > * Display local devices (provided by hcitool) > > * Switch master/slave role (provided by hcitool) > > * Listen for PAN connections (provided by pand) > > * Connect (provided by pand) > > * Disconnect (provided by pand) > > * Display active connections (provided by pand) > > > > According to D-BUS specification when messages are received over a > > D-BUS connection, > > they are sent to a specific object, not to the application as a whole. > > Each object supports > > one or more interfaces. > > > > We have two options: > > 1. define one object with only one interface > > eg: > > object:org.bluez.pand > > interface:org.bluez.pand > > 2. define one object with multiple interfaces > > eg: > > object:org.bluez.pand > > interface: org.bluez.pand > > interface: org.bluez.sdp > > interface: org.bluez.hci > > > > For the both cases, pand will be the daemon responsible for > > provide this interfaces/services. > > What approach do you preffer? > > The last alternative is better because it is possible define more > > detailed rules in the dbus configuration file. >=20 > this might be, but until we don't fully understand what functionality we > need to provide over D-Bus I like to go with 1). In general the first > version of an API sucks and I don't wanna spread it over different > interfaces and have to deprecate them. >=20 > > Another point is the header for dbus services, the client application > > must know the message format, therefore the header file(dbus_services.h= ) > > will be required. In the future, develop a library hidding D-BUS messag= e > > details is a better option. >=20 > Then make it dbus.h for the service definitions and move the rest into > dbus.c and the function declaration into pand.h. For now copy the dbus.h > to the client application and we will sort out the details of it later. >=20 > Regards >=20 > Marcel >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=3D7412&alloc_id=3D16344&op=3Dclick > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate online with coworkers and clients while avoiding the high cost of travel and communications. There is no equipment to buy and you can meet as often as you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-25 22:20 ` Claudio Takahasi @ 2005-05-26 9:08 ` Marcel Holtmann 2005-05-26 21:22 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-26 9:08 UTC (permalink / raw) To: bluez-devel Hi Claudio, > A new patch is available in the link below: > http://www.indt.org.br/maemo/bluez/ lets welcome the Nokia 770 development ;) > The DBUS.TXT file contains information to run the sample and > how configure the service. We must make sure that we install a default service file, but we can sort this out later. > Suggestions and comments are welcome! We must really talk about the coding style at some point, but this is not important at the moment. We follow the kernel coding style and I wanna keep it that way. While looking through the whole source I realized that you used Glib and Pthread. This introduces a dependency chain that I don't wanna take. We must be really careful about this, because not all embedded systems can deal with it. We had a hard time to remove the Glib dependency from hcid and I am not going to introduce it again. For Pthread you might convince me, but there must be really good arguments. What is libbridge? I don't found it on any of my systems. Regards Marcel ------------------------------------------------------- SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate online with coworkers and clients while avoiding the high cost of travel and communications. There is no equipment to buy and you can meet as often as you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-26 9:08 ` Marcel Holtmann @ 2005-05-26 21:22 ` Claudio Takahasi 2005-05-26 21:40 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-26 21:22 UTC (permalink / raw) To: bluez-devel Hi Marcel, 1. Glib I will fix it. I found another approach using dbus main loop function. 2. libbridge It should be removed. It is not being used at the momment. I will fix the Makefile.am But in the the future, I would suggest provide automatic bridge creation. Using libbridge it's possible create bridge and add bnep interfaces. 3. Coding style sorry, I try do my best. I am not familiar with linux kernel coding style. 4. PThread=20 I will remove Posix Thread code. Thanks for our comments! I will send another patch until next monday. Regards, Claudio. On 5/26/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > A new patch is available in the link below: > > http://www.indt.org.br/maemo/bluez/ >=20 > lets welcome the Nokia 770 development ;) >=20 > > The DBUS.TXT file contains information to run the sample and > > how configure the service. >=20 > We must make sure that we install a default service file, but we can > sort this out later. >=20 > > Suggestions and comments are welcome! >=20 > We must really talk about the coding style at some point, but this is > not important at the moment. We follow the kernel coding style and I > wanna keep it that way. >=20 > While looking through the whole source I realized that you used Glib and > Pthread. This introduces a dependency chain that I don't wanna take. We > must be really careful about this, because not all embedded systems can > deal with it. We had a hard time to remove the Glib dependency from hcid > and I am not going to introduce it again. For Pthread you might convince > me, but there must be really good arguments. >=20 > What is libbridge? I don't found it on any of my systems. >=20 > Regards >=20 > Marcel >=20 >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborat= e > online with coworkers and clients while avoiding the high cost of travel = and > communications. There is no equipment to buy and you can meet as often as > you want. Try it free.http://ads.osdn.com/?ad_id=3D7402&alloc_id=3D16135&= op=3Dclick > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-26 21:22 ` Claudio Takahasi @ 2005-05-26 21:40 ` Marcel Holtmann 2005-05-30 22:42 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-26 21:40 UTC (permalink / raw) To: bluez-devel Hi Claudio, > 1. Glib > I will fix it. I found another approach using dbus main loop function. perfect. > 2. libbridge > It should be removed. It is not being used at the momment. I will fix > the Makefile.am > But in the the future, I would suggest provide automatic bridge creation. > Using libbridge it's possible create bridge and add bnep interfaces. I am not against it, but I think we need to make it optional. Does it make sense to put that into pand or leave it in the client? > 3. Coding style > sorry, I try do my best. I am not familiar with linux kernel coding style. Maybe you wanna read the paper from Greg KH on the BlueZ page. We will sort that out later. > 4. PThread > I will remove Posix Thread code. We don't really need threads. > I will send another patch until next monday. Keep up the good work. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-26 21:40 ` Marcel Holtmann @ 2005-05-30 22:42 ` Claudio Takahasi 2005-05-30 23:05 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-30 22:42 UTC (permalink / raw) To: bluez-devel Hi Marcel, I am sending a new patch to be evaluated. Regarding glib dependency we need discuss this subject again. If you see the hcid code, there is a file (glib-ectomy.c) that implements the event processing, this code is a partial copy of glib. What do you prefer? Repeat the glib-ectomy.c code or use glib? For Maemo, glib is not problem. It is included in the SDK. Regarding pthread I put two versions to be evaluated: 1. using pthread In my opinion because it save memory. http://www.indt.org.br/maemo/bluez/bluez-dbus-thread.diff =20 2. using fork In my opinion this is not a feasible approach because when listening is active two process=20 will be running(a listening and another processing D-Bus messages). http://www.indt.org.br/maemo/bluez/bluez-dbus-fork.diff Regards, Claudio. On 5/26/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > 1. Glib > > I will fix it. I found another approach using dbus main loop function. >=20 > perfect. >=20 > > 2. libbridge > > It should be removed. It is not being used at the momment. I will fix > > the Makefile.am > > But in the the future, I would suggest provide automatic bridge creatio= n. > > Using libbridge it's possible create bridge and add bnep interfaces. >=20 > I am not against it, but I think we need to make it optional. Does it > make sense to put that into pand or leave it in the client? >=20 > > 3. Coding style > > sorry, I try do my best. I am not familiar with linux kernel coding sty= le. >=20 > Maybe you wanna read the paper from Greg KH on the BlueZ page. We will > sort that out later. >=20 > > 4. PThread > > I will remove Posix Thread code. >=20 > We don't really need threads. >=20 > > I will send another patch until next monday. >=20 > Keep up the good work. >=20 > Regards >=20 > Marcel >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22= 005 > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-30 22:42 ` Claudio Takahasi @ 2005-05-30 23:05 ` Marcel Holtmann 2005-06-03 20:34 ` [Bluez-devel] DBUS service support - poll patch Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-05-30 23:05 UTC (permalink / raw) To: bluez-devel Hi Claudio, > I am sending a new patch to be evaluated. > Regarding glib dependency we need discuss this > subject again. If you see the hcid code, there is a > file (glib-ectomy.c) that implements the event > processing, this code is a partial copy of glib. > > What do you prefer? Repeat the glib-ectomy.c code > or use glib? the glib-ectomy is only still there, because I was too lazy to replace it with a clean main loop using poll() implementation. > For Maemo, glib is not problem. It is included in > the SDK. This is not a valid argument. Creating a massive dependency chain is always bad. Using Glib inside bluez-utils is no option. > Regarding pthread I put two versions to be evaluated: > 1. using pthread > In my opinion because it save memory. > http://www.indt.org.br/maemo/bluez/bluez-dbus-thread.diff > > 2. using fork > In my opinion this is not a feasible approach > because when listening is active two process > will be running(a listening and another processing > D-Bus messages). > http://www.indt.org.br/maemo/bluez/bluez-dbus-fork.diff Even without looking at the patches, I don't like any of it. I like to see a nice main loop and then using poll(). We don't need threads or forking out processes. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-05-30 23:05 ` Marcel Holtmann @ 2005-06-03 20:34 ` Claudio Takahasi 2005-06-03 20:38 ` Marcel Holtmann 2005-06-03 22:10 ` Marcel Holtmann 0 siblings, 2 replies; 35+ messages in thread From: Claudio Takahasi @ 2005-06-03 20:34 UTC (permalink / raw) To: bluez-devel Hi Marcel, A new patch is available using a main loop and poll to wait for some event= =20 on a file descriptor list (D-Bus and Bluetooth). All Glib and pthread dependencies were remove. http://www.indt.org.br/maemo/bluez/bluez-dbus-poll.diff Regards, Claudio. On 5/30/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > I am sending a new patch to be evaluated. > > Regarding glib dependency we need discuss this > > subject again. If you see the hcid code, there is a > > file (glib-ectomy.c) that implements the event > > processing, this code is a partial copy of glib. > > > > What do you prefer? Repeat the glib-ectomy.c code > > or use glib? >=20 > the glib-ectomy is only still there, because I was too lazy to replace > it with a clean main loop using poll() implementation. >=20 > > For Maemo, glib is not problem. It is included in > > the SDK. >=20 > This is not a valid argument. Creating a massive dependency chain is > always bad. Using Glib inside bluez-utils is no option. >=20 > > Regarding pthread I put two versions to be evaluated: > > 1. using pthread > > In my opinion because it save memory. > > http://www.indt.org.br/maemo/bluez/bluez-dbus-thread.diff > > > > 2. using fork > > In my opinion this is not a feasible approach > > because when listening is active two process > > will be running(a listening and another processing > > D-Bus messages). > > http://www.indt.org.br/maemo/bluez/bluez-dbus-fork.diff >=20 > Even without looking at the patches, I don't like any of it. I like to > see a nice main loop and then using poll(). We don't need threads or > forking out processes. >=20 > Regards >=20 > Marcel >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22= 005 > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-06-03 20:34 ` [Bluez-devel] DBUS service support - poll patch Claudio Takahasi @ 2005-06-03 20:38 ` Marcel Holtmann 2005-06-03 21:31 ` Claudio Takahasi 2005-06-03 22:10 ` Marcel Holtmann 1 sibling, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-06-03 20:38 UTC (permalink / raw) To: bluez-devel Hi Claudio, > http://www.indt.org.br/maemo/bluez/bluez-dbus-poll.diff this gives me a 404 error. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-06-03 20:38 ` Marcel Holtmann @ 2005-06-03 21:31 ` Claudio Takahasi 0 siblings, 0 replies; 35+ messages in thread From: Claudio Takahasi @ 2005-06-03 21:31 UTC (permalink / raw) To: bluez-devel Sorry, Now, It is available. Regards, Claudio. On 6/3/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > http://www.indt.org.br/maemo/bluez/bluez-dbus-poll.diff >=20 > this gives me a 404 error. >=20 > Regards >=20 > Marcel >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you sho= tput > a projector? How fast can you ride your desk chair down the office luge t= rack? > If you want to score the big prize, get to know the little guy. > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=3D20 > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-06-03 20:34 ` [Bluez-devel] DBUS service support - poll patch Claudio Takahasi 2005-06-03 20:38 ` Marcel Holtmann @ 2005-06-03 22:10 ` Marcel Holtmann 2005-06-06 13:18 ` Claudio Takahasi 1 sibling, 1 reply; 35+ messages in thread From: Marcel Holtmann @ 2005-06-03 22:10 UTC (permalink / raw) To: bluez-devel Hi Claudio, > A new patch is available using a main loop and poll to wait for some event > on a file descriptor list (D-Bus and Bluetooth). > > All Glib and pthread dependencies were remove. I just had some some time for a quick review. It is not fully what I had in mind, but it is something from what we can work onwards. I think it is a good idea to include it into release 2.18 and then start on improving it. Since I am away the next week you might wanna address the coding style issues in that time. Read the paper from Greg KH from the OLS 2002. I think it gives a very good understanding on it. Regards Marcel ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-06-03 22:10 ` Marcel Holtmann @ 2005-06-06 13:18 ` Claudio Takahasi 2005-06-14 11:37 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-06-06 13:18 UTC (permalink / raw) To: bluez-devel Hi Marcel, Probably you are not satisfied with D-Bus watches. I tryed remove=20 it, but it is not possible.=20 According with D-Bus documentation is not allowed read/write directly in the file descriptor. DBusWatch must be used for main loop integration. Another important approach is develop a library for D-Bus function hidding. The sample client is just a usage sample and a better idea is use a common library for all applications: gamming, UPnP, messenger, ... Regarding the coding style I will review it. Regards, Claudio. On 6/3/05, Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Claudio, >=20 > > A new patch is available using a main loop and poll to wait for some ev= ent > > on a file descriptor list (D-Bus and Bluetooth). > > > > All Glib and pthread dependencies were remove. >=20 > I just had some some time for a quick review. It is not fully what I had > in mind, but it is something from what we can work onwards. I think it > is a good idea to include it into release 2.18 and then start on > improving it. >=20 > Since I am away the next week you might wanna address the coding style > issues in that time. Read the paper from Greg KH from the OLS 2002. I > think it gives a very good understanding on it. >=20 > Regards >=20 > Marcel >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you sho= tput > a projector? How fast can you ride your desk chair down the office luge t= rack? > If you want to score the big prize, get to know the little guy. > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=3D20 > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-06-06 13:18 ` Claudio Takahasi @ 2005-06-14 11:37 ` Claudio Takahasi 2005-06-17 21:59 ` Claudio Takahasi 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-06-14 11:37 UTC (permalink / raw) To: bluez-devel Hi Marcel, There is a new patch available. http://www.indt.org.br/maemo/bluez/bluez-dbus-poll-v00.02.diff I read the Greg K.H. paper, I tryed adjust the code following his suggestion. Probably there are points that remain incorrect. Send me suggestions and comments that I will fix it. I am working on library for hidding D-BUS details. I don' t=20 know how provide it to the developers. Basically, this library will hide the code inside the pand_dbus_client.tar.gz Another subject that I want introduce is bridge creation. I think we discuss this subject before. Two approachs can be applied: 1. put in the pand daemon under optional feature advantages: can be shared between dbus and no-dbus=20 disadvantages: libbridge dependency=20 2. put it in a library(commented previously) advantages: This feature can be added with another=20 features/functions, like D-Bus message=20 functions, Zeroconf integration (UDHCP) or HOWL. UDHCP and HOWL D-BUS services are being developed. disadvantages: no-dbus pand daemon will not be able to=20 control bridges Regards, Claudio. On 6/6/05, Claudio Takahasi <cktakahasi@gmail.com> wrote: > Hi Marcel, >=20 > Probably you are not satisfied with D-Bus watches. I tryed remove > it, but it is not possible. > According with D-Bus documentation is not allowed read/write directly > in the file descriptor. DBusWatch must be used for main loop integration. >=20 > Another important approach is develop a library for D-Bus function > hidding. The sample client is just a usage sample and a better idea > is use a common library for all applications: gamming, UPnP, messenger, .= .. >=20 > Regarding the coding style I will review it. >=20 > Regards, > Claudio. >=20 > On 6/3/05, Marcel Holtmann <marcel@holtmann.org> wrote: > > Hi Claudio, > > > > > A new patch is available using a main loop and poll to wait for some = event > > > on a file descriptor list (D-Bus and Bluetooth). > > > > > > All Glib and pthread dependencies were remove. > > > > I just had some some time for a quick review. It is not fully what I ha= d > > in mind, but it is something from what we can work onwards. I think it > > is a good idea to include it into release 2.18 and then start on > > improving it. > > > > Since I am away the next week you might wanna address the coding style > > issues in that time. Read the paper from Greg KH from the OLS 2002. I > > think it gives a very good understanding on it. > > > > Regards > > > > Marcel > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you s= hotput > > a projector? How fast can you ride your desk chair down the office luge= track? > > If you want to score the big prize, get to know the little guy. > > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=3D20 > > _______________________________________________ > > Bluez-devel mailing list > > Bluez-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-06-14 11:37 ` Claudio Takahasi @ 2005-06-17 21:59 ` Claudio Takahasi 2005-06-18 23:28 ` Marcel Holtmann 0 siblings, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-06-17 21:59 UTC (permalink / raw) To: bluez-devel Hi Marcel, There is a new patch available. http://www.indt.org.br/maemo/zeroconf/bluez/bluez-dbus-poll-v00.03.diff Changes from last release: - comments fixed - message handle optimized - created a library for clients development Now, the test client is based on a library. http://www.indt.org.br/maemo/zeroconf/bluez/libbluezdbus-0.1.tar.gz The sample directory contains the test application: "client" can be used to request services "sig_listener" is used to listen to signals: new connections,=20 disconnection, role changed, .. Currently, the listener is not integrated with the requester because Glib main loop integration is required. I will develop a better client for demonstration purpose as son as possible. Bugs: - start service is not working TODO: -organize the interfaces names/services better.=20 sdptool, pand, dund features should be provided using D-Bus. Align with Maemo gwconnect??? -Develop a new version supporting the new D-Bus version QUESTIONS: -Where put library creation? 1. put in the pand daemon under optional feature advantages: can be shared between dbus and no-dbus. The control is easier. disadvantages: libbridge dependency 2. put it in a library(commented previously) advantages: This feature can be added with another features/functions, like D-Bus message functions, Zeroconf integration (UDHCP) or HOWL. UDHCP and HOWL D-BUS services are being developed. disadvantages: no-dbus pand daemon will not be able to control bridges and all clients will be allowed to control bridges. The library is not complete. I am sending to see the community feedback. Regards, Claudio. On 6/14/05, Claudio Takahasi <cktakahasi@gmail.com> wrote: > Hi Marcel, >=20 > There is a new patch available. >=20 > http://www.indt.org.br/maemo/bluez/bluez-dbus-poll-v00.02.diff >=20 > I read the Greg K.H. paper, I tryed adjust the code following his > suggestion. Probably there are points that remain incorrect. > Send me suggestions and comments that I will fix it. >=20 > I am working on library for hidding D-BUS details. I don' t > know how provide it to the developers. Basically, this library > will hide the code inside the pand_dbus_client.tar.gz >=20 > Another subject that I want introduce is bridge creation. I think > we discuss this subject before. Two approachs can be applied: > 1. put in the pand daemon under optional feature > advantages: can be shared between dbus and no-dbus > disadvantages: libbridge dependency > 2. put it in a library(commented previously) > advantages: This feature can be added with another > features/functions, like D-Bus message > functions, Zeroconf integration (UDHCP) or HOWL. > UDHCP and HOWL D-BUS services are being developed. > disadvantages: no-dbus pand daemon will not be able to > control bridges >=20 >=20 >=20 > Regards, > Claudio. >=20 >=20 > On 6/6/05, Claudio Takahasi <cktakahasi@gmail.com> wrote: > > Hi Marcel, > > > > Probably you are not satisfied with D-Bus watches. I tryed remove > > it, but it is not possible. > > According with D-Bus documentation is not allowed read/write directly > > in the file descriptor. DBusWatch must be used for main loop integratio= n. > > > > Another important approach is develop a library for D-Bus function > > hidding. The sample client is just a usage sample and a better idea > > is use a common library for all applications: gamming, UPnP, messenger,= ... > > > > Regarding the coding style I will review it. > > > > Regards, > > Claudio. > > > > On 6/3/05, Marcel Holtmann <marcel@holtmann.org> wrote: > > > Hi Claudio, > > > > > > > A new patch is available using a main loop and poll to wait for som= e event > > > > on a file descriptor list (D-Bus and Bluetooth). > > > > > > > > All Glib and pthread dependencies were remove. > > > > > > I just had some some time for a quick review. It is not fully what I = had > > > in mind, but it is something from what we can work onwards. I think i= t > > > is a good idea to include it into release 2.18 and then start on > > > improving it. > > > > > > Since I am away the next week you might wanna address the coding styl= e > > > issues in that time. Read the paper from Greg KH from the OLS 2002. I > > > think it gives a very good understanding on it. > > > > > > Regards > > > > > > Marcel > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you= shotput > > > a projector? How fast can you ride your desk chair down the office lu= ge track? > > > If you want to score the big prize, get to know the little guy. > > > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=3D2= 0 > > > _______________________________________________ > > > Bluez-devel mailing list > > > Bluez-devel@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > > > > ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - poll patch 2005-06-17 21:59 ` Claudio Takahasi @ 2005-06-18 23:28 ` Marcel Holtmann 0 siblings, 0 replies; 35+ messages in thread From: Marcel Holtmann @ 2005-06-18 23:28 UTC (permalink / raw) To: bluez-devel Hi Claudio, > There is a new patch available. > > http://www.indt.org.br/maemo/zeroconf/bluez/bluez-dbus-poll-v00.03.diff > > Changes from last release: > - comments fixed > - message handle optimized > - created a library for clients development thanks for the new patch. I didn't had time to review it, but I think we really get near what we need. Maybe I have to do another release before I can include your patch. Regards Marcel ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-12 9:00 ` Peter Wippich 2005-05-12 12:41 ` Marcel Holtmann @ 2005-05-12 12:45 ` Claudio Takahasi 2005-05-12 16:23 ` Peter Wippich 1 sibling, 1 reply; 35+ messages in thread From: Claudio Takahasi @ 2005-05-12 12:45 UTC (permalink / raw) To: bluez-devel Hi Peter, You can find more information on the references below: http://www.freedesktop.org/Software/dbus http://www-106.ibm.com/developerworks/linux/library/l-dbus.html Basically, DBUS is system for interprocess communication. Where/Why PAND DBUS service can be usefull: - pand required root permission - user applications are not allowed to establish connection or control the BT device/connections - For embedded devices(cell phones, PDAs,..), applications like gamming, UPnP, etc. want to control BT connections, search services, ... and there isn't API for address this. Obviously, there is a hard work to do. Bridge creation/control, IP assignme= nt,=20 service name resolution have to be improved too in order to provide seamles= s=20 connections. Regards, Claudio. On 5/12/05, Peter Wippich <pewi@gw-instruments.de> wrote: >=20 > Hi all, >=20 > sorry for asking a possible dump question, but: > can anybody point me to a source what this D-BUS stuff is ??? > Think I missed something. >=20 > Thanks a lot, >=20 > Peter >=20 >=20 > | Peter Wippich Voice: +49 30 46776411 | > | G&W Instruments GmbH fax: +49 30 46776419 | > | Gustav-Meyer-Allee 25, Geb. 12 Email: pewi@gw-instruments.de | > | D-13355 Berlin / Germany | >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=3D7393&alloc_id=3D16281&op=3Dclick > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Bluez-devel] DBUS service support - Initial library 2005-05-12 12:45 ` [Bluez-devel] DBUS service support - Initial library Claudio Takahasi @ 2005-05-12 16:23 ` Peter Wippich 0 siblings, 0 replies; 35+ messages in thread From: Peter Wippich @ 2005-05-12 16:23 UTC (permalink / raw) To: bluez-devel Thank you Claudio ! May be this will be interesting for a project we are currently working on. I'll have a look at it. Ciao, Peter On Thu, 12 May 2005, Claudio Takahasi wrote: > Hi Peter, > > You can find more information on the references below: > > http://www.freedesktop.org/Software/dbus > http://www-106.ibm.com/developerworks/linux/library/l-dbus.html > > > Basically, DBUS is system for interprocess communication. > > Where/Why PAND DBUS service can be usefull: > - pand required root permission > - user applications are not allowed to establish connection or control > the BT device/connections > - For embedded devices(cell phones, PDAs,..), applications like > gamming, UPnP, etc. > want to control BT connections, search services, ... and there isn't > API for address this. > > Obviously, there is a hard work to do. Bridge creation/control, IP assi= gnment, > service name resolution have to be improved too in order to provide sea= mless > connections. > > Regards, > Claudio. > > > > On 5/12/05, Peter Wippich <pewi@gw-instruments.de> wrote: > > > > Hi all, > > > > sorry for asking a possible dump question, but: > > can anybody point me to a source what this D-BUS stuff is ??? > > Think I missed something. > > > > Thanks a lot, > > > > Peter > > > > > > | Peter Wippich Voice: +49 30 46776411 = | > > | G&W Instruments GmbH fax: +49 30 46776419 = | > > | Gustav-Meyer-Allee 25, Geb. 12 Email: pewi@gw-instruments.de= | > > | D-13355 Berlin / Germany = | > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by Oracle Space Sweepstakes > > Want to be the first software developer in space? > > Enter now for the Oracle Space Sweepstakes! > > http://ads.osdn.com/?ad_id=3D7393&alloc_id=3D16281&op=3Dclick > > _______________________________________________ > > Bluez-devel mailing list > > Bluez-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_ids93&alloc_id=16281&op=CCk > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > | Peter Wippich Voice: +49 30 46776411 | | G&W Instruments GmbH fax: +49 30 46776419 | | Gustav-Meyer-Allee 25, Geb. 12 Email: pewi@gw-instruments.de | | D-13355 Berlin / Germany | ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2005-06-18 23:28 UTC | newest] Thread overview: 35+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-04-28 20:00 [Bluez-devel] DBUS service support - Initial library Claudio Takahasi 2005-04-29 9:47 ` Marcel Holtmann 2005-04-29 12:26 ` Claudio Takahasi 2005-04-29 12:43 ` Marcel Holtmann 2005-04-29 22:20 ` Claudio Takahasi 2005-04-30 0:04 ` Marcel Holtmann 2005-05-01 21:16 ` Claudio Takahasi 2005-05-01 23:18 ` Marcel Holtmann 2005-05-02 15:32 ` Claudio Takahasi 2005-05-02 16:24 ` Marcel Holtmann 2005-05-09 21:31 ` Claudio Takahasi 2005-05-11 18:27 ` Marcel Holtmann 2005-05-12 9:00 ` Peter Wippich 2005-05-12 12:41 ` Marcel Holtmann 2005-05-12 16:21 ` Peter Wippich 2005-05-20 21:04 ` Claudio Takahasi 2005-05-23 10:27 ` Marcel Holtmann 2005-05-23 15:02 ` Claudio Takahasi 2005-05-24 9:07 ` Marcel Holtmann 2005-05-25 22:20 ` Claudio Takahasi 2005-05-26 9:08 ` Marcel Holtmann 2005-05-26 21:22 ` Claudio Takahasi 2005-05-26 21:40 ` Marcel Holtmann 2005-05-30 22:42 ` Claudio Takahasi 2005-05-30 23:05 ` Marcel Holtmann 2005-06-03 20:34 ` [Bluez-devel] DBUS service support - poll patch Claudio Takahasi 2005-06-03 20:38 ` Marcel Holtmann 2005-06-03 21:31 ` Claudio Takahasi 2005-06-03 22:10 ` Marcel Holtmann 2005-06-06 13:18 ` Claudio Takahasi 2005-06-14 11:37 ` Claudio Takahasi 2005-06-17 21:59 ` Claudio Takahasi 2005-06-18 23:28 ` Marcel Holtmann 2005-05-12 12:45 ` [Bluez-devel] DBUS service support - Initial library Claudio Takahasi 2005-05-12 16:23 ` Peter Wippich
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.