Here are a couple of refactoring patches that in my opinion improve the readability of the code. They also fix a minor bug in case BlueZ is broken and exposes an Adapter object with no address (I haven't seen such behaviour from BlueZ, so the fix is for a theoretical case). Tanu Kaskinen (2): bluetooth: Add "valid" flag to pa_bluetooth_adapter bluetooth: Refactor device validity management src/modules/bluetooth/bluez5-util.c | 122 +++++++++++++++++++++--------------- src/modules/bluetooth/bluez5-util.h | 6 +- 2 files changed, 75 insertions(+), 53 deletions(-) -- 1.9.3