Due to cache in batt object, bluetoothd fails to update publish the
battery value after reconnection when the battery value does not change
compared to before reconnection. We should reset the battery percentage
cache on disconnect.
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
static void batt_reset(struct batt *batt)
{
batt->attr = NULL;
+ batt->percentage = -1;
gatt_db_unref(batt->db);
batt->db = NULL;
bt_gatt_client_unref(batt->client);