bluetooth: Support port availability flag
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 31 Aug 2012 10:51:02 +0000 (12:51 +0200)
committerJaska Uimonen <jaska.uimonen@intel.com>
Mon, 10 Dec 2012 20:43:58 +0000 (22:43 +0200)
commit1509500c302fba817d0fe8844b8d73bea7a438df
treecff466899e2f837acdbe5392830b2f700b14a165
parent629c591f20c55d10a4693c75566b18fed83ebf40
bluetooth: Support port availability flag

Use the port availability flag to expose whether a certain profile is
connected and whether it's doing actual audio streaming.

The proposed mapping is the following:
- Profile disconnected: port is unavailable
- Profile is connected (but not streaming/playing): availability unknown
- Profile is streaming/playing: port is available

The availability-unknown is specially interesting: it involves that if
the sink/source exists (corresponding card profile set), it is currently
in suspended state.

For example, for SCO cases (HFGW or HSP), this means the SCO is down. A
policy module would typically not change this, unless someone is really
trying to use the sink/source. This situation would be nicely handled by
module-suspend-on-idle, which would automatically connect SCO.

On the other hand, if the user wants to control the status of the SCO,
it will still be possible by resuming the sink or source (suspend=0).
This works out-of-the-box since most UIs would show to the user ports
whose availability is unknown.
src/modules/bluetooth/module-bluetooth-device.c