This commit is contained in:
2026-06-04 14:52:37 +02:00
parent e74437a846
commit 78f0bce5dd
6 changed files with 40 additions and 17 deletions

View File

@@ -9,9 +9,10 @@ CONFIG_INIT_STACKS=y
CONFIG_THREAD_STACK_INFO=y
### Lib logging levels
CONFIG_BATT_MGMT_LOG_LEVEL_DBG=y
# CONFIG_BATT_MGMT_LOG_LEVEL_DBG=y
# CONFIG_BATT_MGMT_BLINK_INTERVAL_LOGGING=y
CONFIG_USB_MGMT_LOG_LEVEL_DBG=y
# CONFIG_USB_MGMT_LOG_LEVEL_DBG=y
CONFIG_BUZZ_PROTO_LOG_LEVEL_DBG=y
### Bluetooth
CONFIG_BLE_MGMT=y

View File

@@ -327,6 +327,8 @@ static void handle_batt_info_request(struct buzz_frame_msg *msg)
{
msg->reply_cb(msg->data_ptr, sizeof(struct buzz_proto_header) + sizeof(struct buzz_resp_batt_info));
}
LOG_DBG("Battery Info sent: state=%u, level=%u, percent=%u, voltage=%u mV",
batt_info.state, batt_info.level, batt_info.percent, batt_info.voltage_mv);
}
static void handle_ls_request(struct buzz_frame_msg *msg)

View File

@@ -93,20 +93,6 @@ int main(void)
} else {
LOG_WRN("Battery info read failed: %d", batt_rc);
}
for (;;) {
k_sleep(K_SECONDS(5));
batt_rc = batt_mgmt_get_info(&batt_info);
if (batt_rc == 0) {
LOG_INF("Battery: %d mV, %u%%, level=%u, state=%s (%d)",
batt_info.voltage_mv,
batt_info.percent,
batt_info.level,
battery_state_to_str(batt_info.state),
batt_info.state);
} else {
LOG_WRN("Battery info read failed: %d", batt_rc);
}
}
#endif // CONFIG_BATT_MGMT
#endif // CONFIG_LOG