-
Notifications
You must be signed in to change notification settings - Fork 1.7k
MSP Bind Message, CLI Command #11267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: maintenance-9.x
Are you sure you want to change the base?
MSP Bind Message, CLI Command #11267
Conversation
Merge 9.x to master
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
| int portIndex = fastA2I(cmdline); | ||
|
|
||
| if (portIndex < 0 || portIndex > 7) { | ||
| cliShowArgumentRangeError("port", 0, 7); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Replace fastA2I with strtol to ensure the entire port argument is a valid number, preventing partial parsing of non-numeric input. [possible issue, importance: 6]
| int portIndex = fastA2I(cmdline); | |
| if (portIndex < 0 || portIndex > 7) { | |
| cliShowArgumentRangeError("port", 0, 7); | |
| return; | |
| } | |
| char *endptr; | |
| long portIndex = strtol(cmdline, &endptr, 10); | |
| if (endptr == cmdline || *endptr != '\0') { | |
| cliShowParseError(); | |
| return; | |
| } | |
| if (portIndex < 0 || portIndex > 7) { | |
| cliShowArgumentRangeError("port", 0, 7); | |
| return; | |
| } |
|
Tagging for a possible 9.1 since it just adds a feature without altering existing config or functionality. |
|
since we have here a typical hen-egg situation, I would be eager to merge to mLRS what it needs, so that it is ready for when INAV does it. We are preparing for a next release; otherwise it would dongle around in mLRS dev versions for a good while. To do so, all we would have to know is what the message would be going to look like. The message as designed here is ok and will eventually become part of the standard? |
|
do you have any future upgrades in mind that just don't make sense right now? Considering its "just" a bind trigger? |
|
@xznhj8129 you're deep into MSP. Any thoughts? |
not being MSP savy I would not know :) |
|
That's fair. @sensei-hacker since this is a message that won't be used by anything else then by the FC to sending a command to a MSP Receiver, I think it would not hurt to have a payload option, even if its empty now? |
Sounds reasonable to me. But I'm not deep into MSP like @stronnag and @xznhj8129 are, so I may be missing something. |
ah, not intended to also be potentially send e.g. by a GCS? |
|
@olliw42 the CSG (or in this case potentially just INAV configurator) only commands the FC to send the MSP message to the Rx. Like that CLI command |
|
thx for the clarification |
|
I haven't seen anything about binding, not that i looked, but if there's already a function to send a bind message, it only takes a handle case in fc_msp |
A GCS has no interest in this. It is effectively a private capability between a mLRS management tool, the FC and the radio. All it needs is that the MSP function ID is publicly documented to avoid reuse. The payload is only relevant to the MLRS capability, if / how / when mLRS decides it needs to implement a payload need not concern other MSP users. It might as well be documented as "opaque". |
User description
Two changes:
New message and command chosen as MSP receivers don't use serial_rx used by the existing rx_bind / MSP2_BETAFLIGHT_BIND stuff.
Tested with: olliw42/mLRS#395
PR Type
Enhancement, New Feature
Description
Add MSP2_RX_BIND message for MSP receiver binding support
Implement CLI command to send bind message to MSP receivers
Update documentation with new bind command and MSP message details
Diagram Walkthrough
File Walkthrough
cli.c
Add CLI command for MSP receiver bindingsrc/main/fc/cli.c
cliBindMspRx()function to handle MSP receiver binding viaCLI
bind_msp_rxCLI command with port parameter validationbind message
msp_protocol_v2_common.h
Define MSP2_RX_BIND protocol constantsrc/main/msp/msp_protocol_v2_common.h
Cli.md
Document new bind_msp_rx CLI commanddocs/Cli.md
bind_msp_rxcommand to CLI command reference tableRx.md
Document MSP receiver binding command usagedocs/Rx.md
bind_msp_rxcommand with port parameter syntaxmsp_messages.json
Add MSP2_RX_BIND to message documentationdocs/development/msp/msp_messages.json
msp_ref.md
Add MSP2_RX_BIND reference documentationdocs/development/msp/msp_ref.md