bluetooth: Use transport state to update port availability

Use transport state to calculate the corresponding port availability,
and while doing so use bluetooth-util to receive profile state updates
instead of directly parsing D-Bus PropertyChanged signals.
This commit is contained in:
Mikel Astiz 2012-12-14 15:14:33 +01:00 committed by Tanu Kaskinen
parent 8ae8b51937
commit 0c126bdf5b
2 changed files with 53 additions and 94 deletions

View file

@ -539,8 +539,12 @@ static int parse_audio_property(pa_bluetooth_device *d, const char *interface, D
old_state = transport->state;
transport->state = audio_state_to_transport_state(state);
if (transport->state != old_state)
if (transport->state != old_state) {
pa_log_debug("profile=%s, transport=%s, new_state=%d", pa_bt_profile_to_string(transport->profile),
transport->path, transport->state);
pa_hook_fire(&d->discovery->hooks[PA_BLUETOOTH_HOOK_TRANSPORT_STATE_CHANGED], transport);
}
}
break;