bluetooth: Use array to store profile states

Refactor the code to use an array of states instead of independent
member fields, avoiding duplicated code and improving readability.
This commit is contained in:
Mikel Astiz 2012-12-06 15:55:29 +01:00 committed by Tanu Kaskinen
parent 689f9413ad
commit 726435045e
3 changed files with 67 additions and 93 deletions

View file

@ -126,17 +126,8 @@ struct pa_bluetooth_device {
/* Audio state */
pa_bt_audio_state_t audio_state;
/* AudioSink state */
pa_bt_audio_state_t audio_sink_state;
/* AudioSource state */
pa_bt_audio_state_t audio_source_state;
/* Headset state */
pa_bt_audio_state_t headset_state;
/* HandsfreeGateway state */
pa_bt_audio_state_t hfgw_state;
/* AudioSink, AudioSource, Headset and HandsfreeGateway states */
pa_bt_audio_state_t profile_state[PA_BLUETOOTH_PROFILE_COUNT];
};
pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core);