The Following User Says Thank You to thhart For This Useful Post: | ||
|
2011-08-24
, 20:08
|
|
Posts: 623 |
Thanked: 289 times |
Joined on Jan 2010
@ UK
|
#2
|
dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:false
dbus-monitor --help
dbus-monitor --monitor --system type='signal',interface='org.freedesktop.Hal.Device',path='/org/freedesktop/Hal/devices/platform_slide',member='Condition'|while read LINE do echo "$LINE"|grep -o "cover" done
|
2011-08-24
, 22:07
|
Posts: 11 |
Thanked: 3 times |
Joined on Dec 2009
|
#3
|
The only problem is will the bluetooth connect to your headset in time before the caller hangs up.
|
2011-08-25
, 08:03
|
Posts: 151 |
Thanked: 93 times |
Joined on Sep 2009
@ sofia, bulgaria
|
#4
|
asN900:~# cat /etc/dbus-scripts.d/bluetooth-during-call /home/user/bin/bton.sh * * com.nokia.policy.telephony call_request /home/user/bin/btoff.sh * * com.nokia.policy.telephony call_ended
The Following User Says Thank You to lidow For This Useful Post: | ||
|
2011-08-25
, 14:09
|
Posts: 151 |
Thanked: 93 times |
Joined on Sep 2009
@ sofia, bulgaria
|
#5
|
/home/user/bin/bton.sh * * com.nokia.policy.telephony call_request /home/user/bin/btoff.sh * * com.nokia.policy.telephony call_ended
#!/bin/sh adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g') if ( dbus-send --system --print-reply --type=method_call --dest=org.bluez ${adapter} org.bluez.Adapter.GetProperties | sed -n '/string "Powered"/,/variant/ p' | grep -q false ) then dbus-send --system --type=method_call --dest=org.bluez $adapter org.bluez.Adapter.SetProperty string:Powered variant:boolean:true touch /tmp/bt.autopowered fi devmac=00:1C:EF:75:D4:B5 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.Audio.Connect
#!/bin/sh if [[ -f /tmp/bt.autopowered ]] then dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.ListAdapters | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:false rm /tmp/bt.autopowered fi
|
2011-08-25
, 18:59
|
|
Posts: 1,503 |
Thanked: 2,688 times |
Joined on Oct 2010
@ Denmark
|
#6
|
I think this should help.
change in file /etc/bluetooth/audio.conf
from:
HFP=true
to:
HFP=false
restart the phone
Hmmm, just notice that this is for hfp/hsp. While you want it for a2dp.
Try, but most likely will not help. Anyway it is not so hard to disconect BT during call.
|
2011-08-25
, 19:05
|
Posts: 151 |
Thanked: 93 times |
Joined on Sep 2009
@ sofia, bulgaria
|
#7
|
|
2011-08-25
, 19:12
|
Posts: 48 |
Thanked: 22 times |
Joined on Jan 2008
|
#8
|
|
2011-08-25
, 19:14
|
Posts: 151 |
Thanked: 93 times |
Joined on Sep 2009
@ sofia, bulgaria
|
#9
|
/home/user/bin/a2dpoff.sh * * com.nokia.policy.telephony call_request /home/user/bin/a2dpon.sh * * com.nokia.policy.telephony call_ended
#!/bin/sh adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g') devmac=00:1C:EF:75:D4:B5 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.Audio.Disconnect
#!/bin/sh adapter=$(dbus-send --print-reply --system --dest=org.bluez / org.bluez.Manager.DefaultAdapter| sed -ne "s/^.*object path //p"|sed -e 's/"//g') devmac=00:1C:EF:75:D4:B5 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.Audio.Connect
The Following User Says Thank You to lidow For This Useful Post: | ||
|
2011-08-25
, 19:17
|
Posts: 151 |
Thanked: 93 times |
Joined on Sep 2009
@ sofia, bulgaria
|
#10
|
@dr_frost_dk
I am not sure the answer to your issue, but I can provide one datapoint. When my n900 is connected to the Sony bluetooth headunit in my car it switches automatically between playing audio with A2DP/AVRCP to HSP/HFP at the start and end of a call. I have not modified n900 stock settings in this regard, so perhaps keeping a BT headset around may be a crude solution.
How can I do this? Is there an event triggered in the system, so I can write a simple activation script?
I am quite new to this device hacking, so sorry for a probably dummy question. A simple pointer would be helpful as well of course. ;-)
Have a nice day
Thomas