2008-11-20 13:16:19

by Alan Carvalho de Assis

[permalink] [raw]
Subject: Simple-agent in C

Hi All,

I am looking for a C version of simple-agent application.

I am developing an embedded system project and don't want to make
Python a dependence (and Pygobject as well).

There is some way to use bluez-4.xx without DBUS? I already compiled
it to board, but if bluez can works without it will be "better".

Please, can you point me to some simple-agent implemented in C?

Best Regards,

Alan


2008-11-20 23:45:11

by Alan Carvalho de Assis

[permalink] [raw]
Subject: Re: Simple-agent in C

Sorry my mistake, I replied onf to Johan...

On Thu, Nov 20, 2008 at 3:32 PM, Johan Hedberg <[email protected]> wrote:
>
> Yes, as I said you'll need to fill in the proper agent callbacks (right
> now there's something called "Request" which does not exist in the API)
> as well as make it get the adapter path using e.g. DefaultAdapter().

All right. Thank you again!

When I run this agent it is reporting here is not org.bluez DBUS
service, then I verified bluetoothd is is starting correctly:

# bluetoothd -nd
bluetoothd[1888]: Bluetooth daemon
bluetoothd[1888]: Enabling debug information
bluetoothd[1888]: parsing main.conf
bluetoothd[1888]: offmode=NoScan
bluetoothd[1888]: discovto=0
bluetoothd[1888]: pageto=8192
bluetoothd[1888]: name=%h-%d
bluetoothd[1888]: class=0x000100
bluetoothd[1888]: inqmode=0
bluetoothd[1888]: Unable to get on D-Bus

This is the very same error reported here:
https://lists.ubuntu.com/archives/ubuntu-bluetooth/2008-November/002629.html

I am starting dbus this way:
# dbus-daemon --system

I tried to strace bluetoothd but it doesn't helped much, none suspect
problem. Is this some specific problem of this version (4.18)?

Some idea about how to solve this problem?
I think "Unable to get on D-Bus" means bluetoothd are not listening to
same d-bus socket started by dbus-daemon. Isn't it?

> Johan

Best Regards,

Alan

2008-11-20 15:32:58

by Johan Hedberg

[permalink] [raw]
Subject: Re: Simple-agent in C

On Thu, Nov 20, 2008, Alan Carvalho de Assis wrote:
> I noticed this agent.c doesn't use any Glib function, is it right?

Yes.

> I am comparing agent.c against simple-agent and verified it is very different.

Yes, as I said you'll need to fill in the proper agent callbacks (right
now there's something called "Request" which does not exist in the API)
as well as make it get the adapter path using e.g. DefaultAdapter().

Johan

2008-11-20 15:22:38

by Alan Carvalho de Assis

[permalink] [raw]
Subject: Re: Simple-agent in C

Hi Johan,

On Thu, Nov 20, 2008 at 1:34 PM, Johan Hedberg <[email protected]> wrote:
>
> There's test/agent.c in the source tree. However, now that I took a
> quick look at it it's not up-to-date with the latest 4.x API (it e.g.
> hardcodes "/org/bluez/hci0" and doesn't use the correct Agent method
> names). You'll still be able to use it as a good starting point though.
>

I noticed this agent.c doesn't use any Glib function, is it right?

I am comparing agent.c against simple-agent and verified it is very different.

> Johan

Best Regards,

Alan

2008-11-20 13:34:26

by Johan Hedberg

[permalink] [raw]
Subject: Re: Simple-agent in C

Hi Alan,

On Thu, Nov 20, 2008, Alan Carvalho de Assis wrote:
> Please, can you point me to some simple-agent implemented in C?

There's test/agent.c in the source tree. However, now that I took a
quick look at it it's not up-to-date with the latest 4.x API (it e.g.
hardcodes "/org/bluez/hci0" and doesn't use the correct Agent method
names). You'll still be able to use it as a good starting point though.

Johan