bluez5: remove battery when RFCOMM connection drops

There won't be further battery level updates when RFCOMM connection is
down, so remove the battery then.

Fix minor things with canceling the provider registration.
This commit is contained in:
Pauli Virtanen 2021-04-05 14:58:50 +03:00 committed by Wim Taymans
parent eb396f1ea8
commit 026e3882d2
3 changed files with 22 additions and 7 deletions

View file

@ -174,6 +174,8 @@ static void rfcomm_free(struct rfcomm *rfcomm)
spa_hook_remove(&rfcomm->transport_listener);
spa_bt_transport_free(rfcomm->transport);
}
if (rfcomm->device)
spa_bt_device_report_battery_level(rfcomm->device, SPA_BT_NO_BATTERY);
free(rfcomm);
}