![]() |
2010-04-23
, 13:39
|
|
Posts: 700 |
Thanked: 846 times |
Joined on Nov 2009
|
#2
|
My Sony/Ford car stereo does bluetooth. But it's a pain.
Up until two days ago, it would always connect fine when turned on. And HFP worked just fine for calls - very well actually.
A2DP was a different story. First try worked brilliantly. Worked great for a day. Then would only work occasionally - sometimes if I flicked from phone to stream on the stereo it would work. Mostly the phone would be sending data and it would just be silent, or the stereo would silently drop the link.
Two days ago I got Fraud to update the firmware (why can I not do that? It's MY car you theives.)
Now A2DP works more often - normally after flicking from phone mode and back. But it fails to auto connect - or rather it does try to auto connect, but then drops the link (it does now say "link dropped") so I have to dive through menus on the phone to reconnect... it will often fail once more, then work fine.
So I want to write a script that can be called from a DCE button to initiate a connection (and I'll write a dbus-scripts script to do it on failure too!) but how?
Can I send a dbus-command?
dbus-monitor reveals this chain of stuff happenning when I hit connect:
signal sender=:1.37 -> dest=(null destination) serial=1336 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Device; member=PropertyChanged
string "Connected"
variant boolean true
signal sender=:1.91 -> dest=(null destination) serial=190 path=/org/kernel/class/bluetooth/hci0/hci0_11; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1337 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.AudioSink; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.37 -> dest=(null destination) serial=1338 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Audio; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.91 -> dest=(null destination) serial=191 path=/org/kernel/class/input/input11; interface=org.kernel.kevent; member=add
signal sender=:1.91 -> dest=(null destination) serial=192 path=/org/kernel/class/input/input11/event4; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1342 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=Connected
signal sender=:1.37 -> dest=(null destination) serial=1343 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=PropertyChanged
Can I use any of that?
Just found and checking: http://maemo.org/api_refs/5.0/5.0-fi...ontrol-api.txt - may help me...
EDIT
Seems like the command I need is:
This page is really helpful: http://wiki.bluez.org/wiki/HOWTO/AudioDevices...Code:dbus-send --system --print-reply --type=method_call --dest=org.bluez /org/bluez/1069/hci0/dev_00_1E_A4_FF_D8_BE.Connect
A more full script could be written using:
(Change the AudoSink to whatever service you want, and the devmac to the mac of your bluetooth headset,stereo,computer,teddybear...)Code:devmac=00:1E:A4:FF:D8:BE adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g') device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac}|sed -ne "s/^.*object path //p"|sed -e 's/"//g') dbus-send --system --print-reply --type=method_call --dest=org.bluez ${device} org.bluez.AudioSink.Connect
![]() |
2010-07-09
, 22:17
|
Posts: 5 |
Thanked: 2 times |
Joined on Dec 2009
|
#3
|
![]() |
2010-07-09
, 22:32
|
Posts: 46 |
Thanked: 31 times |
Joined on Jun 2010
@ Lebanon
|
#4
|
![]() |
2010-07-09
, 22:44
|
Posts: 5 |
Thanked: 2 times |
Joined on Dec 2009
|
#5
|
![]() |
2010-07-29
, 12:12
|
Posts: 45 |
Thanked: 25 times |
Joined on Aug 2008
@ Germany
|
#6
|
The Following User Says Thank You to christoph For This Useful Post: | ||
![]() |
2013-11-08
, 00:49
|
Posts: 14 |
Thanked: 0 times |
Joined on Apr 2012
@ Mysore, India
|
#7
|
![]() |
2013-11-08
, 01:29
|
Posts: 752 |
Thanked: 2,808 times |
Joined on Jan 2011
@ Czech Republic
|
#8
|
Hello Phedders
Please let me know how can i achieve this with Desktop Execution Command Widget
Thanks & Regards
Rajesh
![]() |
2013-11-08
, 02:54
|
Posts: 14 |
Thanked: 0 times |
Joined on Apr 2012
@ Mysore, India
|
#9
|
![]() |
2013-11-08
, 16:07
|
Posts: 752 |
Thanked: 2,808 times |
Joined on Jan 2011
@ Czech Republic
|
#10
|
devmac=FF:11:EE:22:DD:33 adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g') device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac}|sed -ne "s/^.*object path //p"|sed -e 's/"//g') dbus-send --system --print-reply --type=method_call --dest=org.bluez ${device} org.bluez.AudioSink.Connect
devmac=FF:11:EE:22:DD:33 && adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g') && device=$(dbus-send --print-reply --system --dest=org.bluez ${adapter} org.bluez.Adapter.FindDevice string:${devmac}|sed -ne "s/^.*object path //p"|sed -e 's/"//g') && dbus-send --system --print-reply --type=method_call --dest=org.bluez ${device} org.bluez.AudioSink.Connect
Up until two days ago, it would always connect fine when turned on. And HFP worked just fine for calls - very well actually.
A2DP was a different story. First try worked brilliantly. Worked great for a day. Then would only work occasionally - sometimes if I flicked from phone to stream on the stereo it would work. Mostly the phone would be sending data and it would just be silent, or the stereo would silently drop the link.
Two days ago I got Fraud to update the firmware (why can I not do that? It's MY car you theives.)
Now A2DP works more often - normally after flicking from phone mode and back. But it fails to auto connect - or rather it does try to auto connect, but then drops the link (it does now say "link dropped") so I have to dive through menus on the phone to reconnect... it will often fail once more, then work fine.
So I want to write a script that can be called from a DCE button to initiate a connection (and I'll write a dbus-scripts script to do it on failure too!) but how?
Can I send a dbus-command?
dbus-monitor reveals this chain of stuff happenning when I hit connect:
signal sender=:1.37 -> dest=(null destination) serial=1336 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Device; member=PropertyChanged
string "Connected"
variant boolean true
signal sender=:1.91 -> dest=(null destination) serial=190 path=/org/kernel/class/bluetooth/hci0/hci0_11; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1337 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.AudioSink; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.37 -> dest=(null destination) serial=1338 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Audio; member=PropertyChanged
string "State"
variant string "connecting"
signal sender=:1.91 -> dest=(null destination) serial=191 path=/org/kernel/class/input/input11; interface=org.kernel.kevent; member=add
signal sender=:1.91 -> dest=(null destination) serial=192 path=/org/kernel/class/input/input11/event4; interface=org.kernel.kevent; member=add
signal sender=:1.37 -> dest=(null destination) serial=1342 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=Connected
signal sender=:1.37 -> dest=(null destination) serial=1343 path=/org/bluez/1052/hci0/dev_00_1E_A4_FF_D8_BE; interface=org.bluez.Control; member=PropertyChanged
Can I use any of that?
Just found and checking: http://maemo.org/api_refs/5.0/5.0-fi...ontrol-api.txt - may help me...
EDIT
Seems like the command I need is:
A more full script could be written using:
Last edited by phedders; 2010-04-15 at 08:56.