Skip to content

Commit 995d583

Browse files
committed
Fixed "plugged in" state report being incorrect when no battery is attached
Signed-off-by: Jared Baumann <[email protected]>
1 parent 4e9ac84 commit 995d583

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

samples/tmo_shell/src/tmo_ble_demo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static ssize_t battery_power_source_get(struct bt_conn *conn,
222222
uint8_t charging, vbus, battery_attached, fault;
223223

224224
get_battery_charging_status(&charging, &vbus, &battery_attached, &fault);
225-
if (vbus) {
225+
if (vbus || !battery_attached) {
226226
power_source = ON_CHARGER_POWER;
227227
} else {
228228
power_source = ON_BATTERY_POWER;

0 commit comments

Comments
 (0)