maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Bluez + dbus-send problem (https://talk.maemo.org/showthread.php?t=34918)

skomialek 2009-11-22 21:48

Bluez + dbus-send problem (Error org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Adapter" doesn't exist)
 
Hi,

I'm completely new to linux/maemo systems and I need some help.
I try to use the Bluez API in my app but first I wanted to check how this works in terminal.

I'm try' to call the simplest GetProperties method so I type in:

Code:

dbus-send --system --type=method_call --print-reply --dest=org.bluez
/org/bluez/hci0 org.bluez.Adapter.GetProperties

and what I get is instead list of properties is:

Code:

process 3926: arguments to dbus_message_new_method_call() were incorrect, assertion "_dbus_check_is_valid_path (path)" failed in file dbus-message.c line 1078.
This is normally a bug in some application using the D-Bus library.
process 3926: arguments to dbus_message_set_auto_start() were incorrect, assertion "message != NULL" failed in file dbus-message.c line 2492.
This is normally a bug in some application using the D-Bus library.
Couldn't allocate D-Bus message

Any ideas what I do wrong ? maybe some examples of using bluez in terminal?

OK... I've found one stupid mistake in path ... I forgot "/" in front ... the current status is:

Code:

dbus-send --system --dest=org.bluez --print-reply --type=method_call /org/bluez/hci0 org.bluez.Adapter.GetProperties
Error org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Adapter" doesn't exist

and I'm still fighting with this ...

I appreciate every advice.
Br,
Skomialek

danielwilms 2009-11-23 08:23

Re: Bluez + dbus-send problem
 
Hi,

the object path seems to be wrong, as it has to contain the pid of the bluetoothd. Do the following steps:

1. Figure out, which pid bluetoothd has:
Code:

ps | grep bluetooth
2. Then try:
Code:

dbus-send --system --dest=org.bluez --print-reply --type=method_call /org/bluez/{pid}/hci0 org.bluez.Adapter.GetProperties
This should give you the results.

Cheers Daniel

hopbeat 2009-11-23 08:47

Re: Bluez + dbus-send problem
 
Confirm, it's working on N900.

lma 2009-11-23 09:29

Re: Bluez + dbus-send problem
 
org.bluez.Manager.DefaultAdapter could (should?) also be used to discover the right object path, eg:

Code:

adapter=`dbus-send --print-reply --system --dest=org.bluez / \
    org.bluez.Manager.DefaultAdapter | awk -F\" '/bluez/ { print $2 }'`
dbus-send --system --dest=org.bluez --print-reply --type=method_call \
    $adapter org.bluez.Adapter.GetProperties


skomialek 2009-11-23 11:41

Re: Bluez + dbus-send problem
 
thanks a lot guys :)

thank you for focus' my attention on Manager as a tool to get path to the adapter device. now the only thing I need to do is to translate thi to C... so you can expect mor posts from me in here :)

br,
Skomialek

phoolishsan 2010-01-25 18:47

Re: Bluez + dbus-send problem
 
Hello All,

I am trying to turn on bluetooth via command line. The bluez wiki says to use SetMode, but maemo doesn't seem to like that command at all.

Code:

adapter=`dbus-send --print-reply --system --dest=org.bluez
org.bluez.Manager.DefaultAdapter | awk -F\" '/bluez/ { print $2 }'` dbus-send --system --dest=org.bluez --print-reply --type=method_call
$adapter org.bluez.Adapter.GetMode

or

Code:

adapter=`dbus-send --print-reply --system --dest=org.bluez
org.bluez.Manager.DefaultAdapter | awk -F\" '/bluez/ { print $2 }'` dbus-send --system --dest=org.bluez --print-reply --type=method_call
$adapter org.bluez.Adapter.SetMode string:connectable

Both return an Unknown method error. Can anyone give me some guidance?

Thanks in advance.

412b 2010-01-25 23:38

Re: Bluez + dbus-send problem
 
Quote:

Originally Posted by phoolishsan (Post 494099)
Hello All,

I am trying to turn on bluetooth via command line. The bluez wiki says to use SetMode, but maemo doesn't seem to like that command at all.

Both return an Unknown method error. Can anyone give me some guidance?

Thanks in advance.

You're using BlueZ 3 D-Bus API guide, look at the BlueZ 4's one (on official site or in maemo's docs).


All times are GMT. The time now is 04:17.

vBulletin® Version 3.8.8