Skip to content

MAVLink Capa Fix - #3632

Merged
mha1 merged 2 commits into
ExpressLRS:masterfrom
jlpoltrack:MAVLink-Capa-Fix
Jun 16, 2026
Merged

mha1 merged 2 commits into
ExpressLRS:masterfrom
jlpoltrack:MAVLink-Capa-Fix

Conversation

@jlpoltrack

Copy link
Copy Markdown
Contributor

Addresses: #3182 and simplifies the mAh clamp.

@pkendall64

Copy link
Copy Markdown
Collaborator

Can you provide information as to why you think the shift is required. Copying the field from a 32bit to a 24bit should just use truncation (like it is currently). By shifting the value down by 8 bits you are dividing the mAh used by 256!

@jlpoltrack

jlpoltrack commented May 3, 2026 •

Copy link
Copy Markdown
Contributor Author

htobe32 is a byte swap, so currently the truncating throws away the most significant byte.

Alternatively, this htobe24 could be available everywhere instead of just SerialHOTT: https://github.com/ExpressLRS/ExpressLRS/blob/master/src/src/rx-serial/SerialHoTT_TLM.cpp#L795

Has been tested on Ethos, previously capacity would be way under reported and with this change now aligns with what ArduPilot reports.

@pkendall64

Copy link
Copy Markdown
Collaborator

It would certainly make more sense to extract htobe24 to common code and reuse that.

@jlpoltrack

Copy link
Copy Markdown
Contributor Author

Sounds good, added htobe24 to crsf_protocol.h, tested that both Tx and Rx code compiles.

@pkendall64
pkendall64 changed the base branch from 4.x-maint to master May 24, 2026 20:08

@mha1 mha1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only tested the HoTT telemetry side. Seems to still work.

@mha1
mha1 merged commit 5271b9f into ExpressLRS:master Jun 16, 2026
@jlpoltrack
jlpoltrack deleted the MAVLink-Capa-Fix branch September 13, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MAVLINK - 'Capa' value shows zero in Tx Telemetry list yet the battery Current_Consumed data is correctly passed to GCS

3 participants