Always send LinkStats to handset #3367
Merged
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.
Changes behavior of the TX module to now send LinkStats type packets to the handset always, instead of only when the RX is connected. The handset is also notified immediately when the TX module goes to disconnected status instead of simply ghosting the handset eventually. Disconnected status will now be indicated by RQly == 0, which EdgeTX has supported back since the OpenTX days.
The Main "Why?"
I'd like the handset to have knowledge of the current packet mode and transmit power regardless of if an RX is connected. If there's no LinkStats, there's no facility to carry this information, so step 1 is to start sending linkstats all the time. Major blocker after this is on the EdgeTX side, where all telemetry is tied together and if the RX is disconnected, then there's effectively no TX telemetry either. Fixing that is step 2.
Other benefits
Unrelated
LastTLMpacketRecvMillistoLastTLMpacketRecv_Ms, our more standard naming scheme. Removed "volatile" keyword and made static; there's no way the compiler is going to be caching this value inUpdateConnectDisconnectStatus()even if it gets inlined into loop