bluetooth: refactor BlueZ 4 transport state setting

Add transport_set_state() that encapsulates changing the variable,
logging and firing the change hook.

I also made a cosmetic change to the corresponding BlueZ 5 log
message so that both messages have the format that I like.
This commit is contained in:
Tanu Kaskinen 2016-08-07 18:45:54 +03:00
parent 15e3d828dd
commit 83ac6c5ae5
2 changed files with 17 additions and 16 deletions

View file

@ -267,7 +267,7 @@ void pa_bluetooth_transport_set_state(pa_bluetooth_transport *t, pa_bluetooth_tr
old_any_connected = pa_bluetooth_device_any_transport_connected(t->device);
pa_log_debug("Transport %s state changed from %s to %s",
pa_log_debug("Transport %s state: %s -> %s",
t->path, transport_state_to_string(t->state), transport_state_to_string(state));
t->state = state;