MSP-Referenz dokumentiert: Sensor-Status/Arming-/Box-Mode-Flags im Code, ungenutzte iNAV-Befehle in der Architektur-Doku
Auf Nutzeranfrage die Bedeutung mehrerer MSP2_INAV_*-Codes gegen den tatsaechlichen iNAV-9.1.0-Quellcode geprueft (fc_msp.c, fc_msp_box.c, runtime_config.h, settings.yaml): - msp_commands.dart: Doc-Kommentar zu MSP2_INAV_STATUS (0x2000, bereits genutzt) um das vollstaendige Bit-Layout von sensorStatus, armingFlags und boxModeFlags ergaenzt. boxModeFlags ist kein festes Bit-pro-Modus- Mapping, sondern muss ueber MSP_BOXIDS (ID 119) korreliert werden - Fixed-Wing-relevante permanentIds mit aufgefuehrt. MspArmingFlags um die komplette armingFlag_e-Referenz (alle ARMING_DISABLED_*-Gruende) erweitert, als Dokumentation - nicht als neue Konstanten, da bisher nur das ARMED-Bit tatsaechlich gebraucht wird. - DMC_Architektur_und_Design.md (Abschnitt 6): fuenf bisher ungenutzte MSP2_INAV_*-Befehle als offene Punkte aufgenommen (GEOZONE/SAFEHOME/ BATTERY_CONFIG/AIR_SPEED/TEMPERATURES) mit Payload-Details und Einschaetzung zur Relevanz - GEOZONE (Geofencing) am interessantesten fuer die bestehende Flugpfad-Machbarkeitspruefung. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
8d5b06d0b4
commit
08791cac0c
@@ -43,6 +43,34 @@ abstract final class MspCommands {
|
||||
/// u32 armingFlags, 8 byte boxModeFlags, u8 mixerProfile.
|
||||
/// (`fc_msp.c`, `case MSP2_INAV_STATUS`; ID aus
|
||||
/// `msp_protocol_v2_inav.h`: `#define MSP2_INAV_STATUS 0x2000`)
|
||||
///
|
||||
/// Bit-Layout `sensorStatus` (`packSensorStatus()` in `fc_msp_box.c`):
|
||||
/// Bit 0 ACC, 1 BARO, 2 MAG, 3 GPS, 4 RANGEFINDER, 5 OPFLOW, 6 PITOT,
|
||||
/// 7 TEMP (je 1 = Sensor vorhanden/aktiviert); Bits 8-14 unbenutzt;
|
||||
/// Bit 15 = Hardware-Defekt (`!isHardwareHealthy()`).
|
||||
///
|
||||
/// Bit-Layout `armingFlags` (`armingFlag_e` in `fc/runtime_config.h`) -
|
||||
/// siehe [MspArmingFlags].
|
||||
///
|
||||
/// `boxModeFlags` (8 Byte = 64 Bit) ist KEIN fest verdrahtetes Bit-pro-
|
||||
/// Modus-Mapping (`packBoxModeFlags()` in `fc_msp_box.c`): Bit `i` sagt
|
||||
/// nur "ist der i-te Eintrag der aktuell aktiven Box-Liste gerade aktiv"
|
||||
/// - welcher Modus das ist, hängt vom konkreten Firmware-Build/-Setup ab
|
||||
/// (nur kompilierte/aktivierte Boxen landen in der Liste,
|
||||
/// `initActiveBoxIds()`). Um ein Bit einem Modus zuzuordnen, muss der
|
||||
/// Client `MSP_BOXIDS` (ID 119, `case MSP_BOXIDS: serializeBoxReply()`)
|
||||
/// EINMAL beim Verbindungsaufbau abfragen: die Antwort ist ein
|
||||
/// Array von `u8 permanentId` in exakt der gleichen Reihenfolge wie die
|
||||
/// Bits in `boxModeFlags` - erst über diese `permanentId` lässt sich der
|
||||
/// Modusname aus der festen `boxes[]`-Tabelle in `fc_msp_box.c` ablesen
|
||||
/// (`permanentId` ist stabil über Firmware-Versionen, die Bit-Position
|
||||
/// nicht). Für Fixed-Wing/iNAV-Missionsbetrieb relevante `permanentId`s:
|
||||
/// 0 ARM, 1 ANGLE, 2 HORIZON, 10 NAV RTH, 11 NAV POSHOLD, 12 MANUAL,
|
||||
/// 27 FAILSAFE, 28 NAV WP, 30 HOME RESET, 34 FLAPERON, 35 TURN ASSIST,
|
||||
/// 36 NAV LAUNCH, 37 SERVO AUTOTRIM, 45 NAV COURSE HOLD, 51 PREARM,
|
||||
/// 53 NAV CRUISE, 55 WP PLANNER, 56 SOARING, 59 MISSION CHANGE, 64
|
||||
/// ANGLE HOLD (vollständige Tabelle: `boxes[]` in `fc_msp_box.c`, iNAV
|
||||
/// 9.1.0 - noch nicht in `MspCommands` aufgenommen, da bisher ungenutzt).
|
||||
static const int inavStatus = 0x2000;
|
||||
|
||||
/// Response (24 Byte): u8 flags, u16 batteryVoltage(0.01V),
|
||||
@@ -62,8 +90,23 @@ abstract final class MspCommands {
|
||||
static const int inavLinkStats = 0x2103;
|
||||
}
|
||||
|
||||
/// Bits von `armingFlags` (Doku: `fc/runtime_config.h`, `armingFlags_e`).
|
||||
/// Nur das fuer die Telemetrie benoetigte ARMED-Bit ist hier abgebildet.
|
||||
/// Bits von `armingFlags` (`armingFlag_e` in `fc/runtime_config.h`, iNAV
|
||||
/// 9.1.0). Nur das fuer die Telemetrie benoetigte ARMED-Bit ist hier als
|
||||
/// Konstante abgebildet - der Rest der Aufzaehlung ist unten als Referenz
|
||||
/// dokumentiert, falls spaeter z.B. eine "warum laesst sich nicht armen"-
|
||||
/// Anzeige gebraucht wird (aktuell ungenutzt, deshalb keine eigenen
|
||||
/// Konstanten dafuer):
|
||||
///
|
||||
/// Bit 2 `ARMED`, Bit 3 `WAS_EVER_ARMED`, Bit 4/5 Simulator-Modus
|
||||
/// (HITL/SITL), danach ausschliesslich Arm-Sperrgruende
|
||||
/// (`ARMING_DISABLED_*`, jeweils "warum kann/darf gerade nicht armiert
|
||||
/// werden"): Bit 6 GEOZONE, 7 FAILSAFE_SYSTEM, 8 NOT_LEVEL, 9
|
||||
/// SENSORS_CALIBRATING, 10 SYSTEM_OVERLOADED, 11 NAVIGATION_UNSAFE, 12
|
||||
/// COMPASS_NOT_CALIBRATED, 13 ACCELEROMETER_NOT_CALIBRATED, 14 ARM_SWITCH,
|
||||
/// 15 HARDWARE_FAILURE, 16 BOXFAILSAFE, 18 RC_LINK, 19 THROTTLE, 20 CLI,
|
||||
/// 21 CMS_MENU, 22 OSD_MENU, 23 ROLLPITCH_NOT_CENTERED, 24 SERVO_AUTOTRIM,
|
||||
/// 25 OOM, 26 INVALID_SETTING, 27 PWM_OUTPUT_ERROR, 28 NO_PREARM, 29
|
||||
/// DSHOT_BEEPER, 30 LANDING_DETECTED (Bit 17 unbenutzt).
|
||||
abstract final class MspArmingFlags {
|
||||
static const int armed = 1 << 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user