Add optional charging flag to companion battery response#1710
Open
Specter242 wants to merge 2 commits intomeshcore-dev:mainfrom
Open
Add optional charging flag to companion battery response#1710Specter242 wants to merge 2 commits intomeshcore-dev:mainfrom
Specter242 wants to merge 2 commits intomeshcore-dev:mainfrom
Conversation
Append an optional is_charging byte to RESP_CODE_BATT_AND_STORAGE using board external power state so clients can render a charging indicator without breaking older parsers. Co-authored-by: Cursor <cursoragent@cursor.com>
Use T1000-E specific EXT_PWR_DETECT and EXT_CHRG_DETECT lines in isExternalPowered() so the companion battery charging byte reflects actual hardware charging/power state on this board. Co-authored-by: Cursor <cursoragent@cursor.com>
weebl2000
reviewed
Feb 16, 2026
|
|
||
| bool T1000eBoard::isExternalPowered() { | ||
| // T1000-E exposes dedicated detect lines for external power and charge state. | ||
| // Use these first, then fall back to NRF52 USB VBUS detection. |
Contributor
There was a problem hiding this comment.
Does NRF52 fallback provide us with anything? Wouldn't it always be false currently? :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_chargingbyte toRESP_CODE_BATT_AND_STORAGE (0x0C)in companion firmware payloadsMainBoard::isExternalPowered()), so no command code changes are requiredisExternalPowered()that readsEXT_PWR_DETECTandEXT_CHRG_DETECTfor accurate charging/power detection on this hardwarePACKET_BATTERY) to document the new optional field and backward-compatible parsingCompatibility
is_chargingonly when frame length is>= 12Test Plan
pio run -e t1000e_companion_radio_bleis_charging == 1(app charging icon visible)is_charging == 0Made with Cursor