ring_and_wait_for_button patch for headsetd
Hi all,
Further to Brad's suggestion on #, I've had a go at creating a patch for my mods to headsetd.
Please forgive the hackery, and the diff format, as I've never played with C(*) on this level, or with diffs. Hopefully somebody will find it of use.
The purpose of the patch is to add an extra ringing state in the chain, and fork a ringer process. If the headset button is pushed within the timeout (ringout) then the connection state advances to the next level.
The idea being that I can have my headset (clip) in my pocket, and use it for (spoken) alerts from my server. When the server attempts to contact the headset, the headset rings and will only send audio if the button is pushed.
The timeout in ~/.asound needs to suit the maximum ring time + connection delay ... I used 10000 (10 secs).
It does need cleaning up (in general), and has some minor problems (button vs ring timing?), but works well for me at the moment.
I wasn't able to figure out how to (properly) use dbus, so I've used lock files in tmp. It would also be better to use environment vars(?) to set things like ringout, ring_enable, wait_for_button, etc ... but I guess that will have to wait until I have need for it ;)
I'd like to be able to add vibrate support if possible, but I'm not sure if the method I used to send RING is also a good way to send +CVIB (or CVIB=1). Not sure if it's my method or the headset at this stage, so advice appreciated.
Marcus.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel