![]() |
Python - Using Bluetooth/Wired Headset Answer Button
There is a new app named Saera being developed to provide a voice controlled experience similar to Siri for the Iphone.
For this app to be fully useful to people who need hands free voice interaction with their device the answer button needs to work outside of answering/ending phone calls with both the wired headset and more importantly the Bluetooth headsets much as it does on phones with voice dialing. Most of the work appears to have been done for wired headsets with these packages: *Headset Button Enabler - enables wired headset to be used outside calls *Headset Control - uses wired headset to control Media Player These apps are designed for pausing and starting the media player but need to be accessable to Python which Saera is written in, and more importantly also need to include the more common bluetooth headsets which does not appaer to be the case. Saera is one of the killer apps car drivers, cyclists, and motorcycle drivers have waited for on Maemo/Meego. the Saera thread is here http://talk.maemo.org/showthread.php?t=84753 |
Re: Python - Using Bluetooth/Wired Headset Answer Button
Checked http://wiki.maemo.org/Phone_control
doesnt seem to currently be any way to get information related to headsets beyond pairing and other standard bluez stuff. |
Re: Python - Using Bluetooth/Wired Headset Answer Button
According to headset-button-enabler description, when it is installed and a headset button is pressed, "ButtonPressed" signal is emitted by HAL... it should be possible to catch that signal in Python somehow... I cannot help with Python, as my Python skills are weak, but have a look at headset-control package sources, especially at two files: headset-controld.c and headset-control-obj.c. If you understand C language, you will notice this isn't rocket science, and it requires only Python glib, dbus and hal bindings (maybe even one of these is not needed, I skimmed through the code now very quickly while I'm on the train), which, afaik, are all available for Python on Maemo. So, in my oppinion, package headset-control could be used as a reference implementation, if someone has more time, (s)he can write a wiki page basing on this code.
|
Re: Python - Using Bluetooth/Wired Headset Answer Button
not quite sure, but maybe os.popen can help?
|
Re: Python - Using Bluetooth/Wired Headset Answer Button
Quote:
|
Re: Python - Using Bluetooth/Wired Headset Answer Button
Quote:
|
Re: Python - Using Bluetooth/Wired Headset Answer Button
Quote:
last night i found struct of input events and library written in python, well...there's not much of ported py libs for harmattan but i am sure python-dev and this scripts can be ported to python easily. however, you can take needed classes from event.py and input.py and put them into your script. |
Re: Python - Using Bluetooth/Wired Headset Answer Button
When wired or bluetooth button is pressed a system dbus signal is emitted. On n900 if I don't remember wrong the wired button is disabled but you may enable it just with an amixer command. You don't need anything else, just to enable the wired button and listen to dbus events.
|
Re: Python - Using Bluetooth/Wired Headset Answer Button
Quote:
edit: This would get more responses if it was posted in "Development" section, not "Design"... Anyway, I'm up for writing a simple example, give me few hours ;) |
Re: Python - Using Bluetooth/Wired Headset Answer Button
Quote:
|
All times are GMT. The time now is 05:56. |
vBulletin® Version 3.8.8