mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 19:37:35 +08:00
fix(rc): warn and deny invalid Spektrum bind sub-type
Previously, an unrecognized param2 sub-type would silently leave dsm_bind_pulses at 0 and return the generic UNSUPPORTED ACK. Add an explicit else-branch that logs a PX4_WARN and returns DENIED so users get clear feedback in QGC.
This commit is contained in:
@@ -180,6 +180,10 @@ void DsmRc::Run()
|
||||
|
||||
} else if (dsm_bind_mode == vehicle_command_s::RC_SUB_TYPE_SPEKTRUM_DSMX8) {
|
||||
dsm_bind_pulses = DSMX8_BIND_PULSES;
|
||||
|
||||
} else {
|
||||
PX4_WARN("invalid Spektrum bind sub-type: %d", dsm_bind_mode);
|
||||
cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED;
|
||||
}
|
||||
|
||||
if (dsm_bind_pulses > 0 && bind_spektrum(dsm_bind_pulses)) {
|
||||
|
||||
@@ -402,6 +402,10 @@ void RCInput::Run()
|
||||
|
||||
} else if (dsm_bind_mode == vehicle_command_s::RC_SUB_TYPE_SPEKTRUM_DSMX8) {
|
||||
dsm_bind_pulses = DSMX8_BIND_PULSES;
|
||||
|
||||
} else {
|
||||
PX4_WARN("invalid Spektrum bind sub-type: %d", dsm_bind_mode);
|
||||
cmd_ret = vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED;
|
||||
}
|
||||
|
||||
if (dsm_bind_pulses > 0 && bind_spektrum(dsm_bind_pulses)) {
|
||||
|
||||
Reference in New Issue
Block a user