Active Topics

 


Reply
Thread Tools
Posts: 13 | Thanked: 5 times | Joined on Oct 2009
#1
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

Last edited by skomialek; 2009-11-22 at 23:20.
 

The Following User Says Thank You to skomialek For This Useful Post:
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#2
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
 

The Following 6 Users Say Thank You to danielwilms For This Useful Post:
hopbeat's Avatar
Posts: 516 | Thanked: 643 times | Joined on Oct 2009 @ Denmark/Poland
#3
Confirm, it's working on N900.
__________________
Hi! I'm a Maemo Greeter!
Witaj na talk.maemo.org!

Useful links for newcomers:
Użyteczne linki:
Nowi użyktownicy mówią cześć | New members say hello , Tu zaczynają nowi użytkownicy | New users start here, Podforum społeczności | Community subforum, Wiki dla początkujących | Beginners' wiki page, Maemo5 101, Często zadawane pytania | Frequently Asked Questions (FAQ), Google

Jeżeli mogę w czymś pomóc, pytaj!
If I can help with anything else, just ask!

Bored? Follow me
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#4
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
 

The Following 7 Users Say Thank You to lma For This Useful Post:
Posts: 13 | Thanked: 5 times | Joined on Oct 2009
#5
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
 
Posts: 1 | Thanked: 0 times | Joined on Jan 2010
#6
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.
 
Posts: 462 | Thanked: 550 times | Joined on Sep 2008 @ Moscow
#7
Originally Posted by phoolishsan View Post
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).
 

The Following User Says Thank You to 412b For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 22:46.