Files
dmc/app/lib/transport/msp/msp_commands.dart
T

38 lines
1.7 KiB
Dart

/// MSP-Befehlsnummern, geprueft gegen den tatsaechlichen iNAV-9.1.0-Quellcode
/// statt aus dem Gedaechtnis uebernommen (Doku Kommunikationsschicht
/// Abschnitt 4):
/// https://github.com/iNavFlight/inav/blob/9.1.0/src/main/msp/msp_protocol.h
/// https://github.com/iNavFlight/inav/blob/9.1.0/src/main/msp/msp_protocol_v2_inav.h
///
/// `MSP_STATUS` und `MSP_ANALOG` sind laut `msp_protocol.h` seit iNAV 9.1
/// als "DEPRECATED ... use MSP2_INAV_STATUS/MSP2_INAV_ANALOG instead. Will
/// be removed in INAV 10.0" markiert - deshalb wird hier bewusst die
/// MSP2_INAV_-Variante verwendet, nicht die MSPv1-Klassiker.
abstract final class MspCommands {
/// Response: u8 fixType, u8 numSat, i32 lat(1e-7 deg), i32 lon(1e-7 deg),
/// u16 alt(m), u16 groundSpeed(cm/s), u16 groundCourse(0.1 deg), u16 hdop.
/// (`fc_msp.c`, `case MSP_RAW_GPS`)
static const int rawGps = 106;
/// Response: i32 estAlt(cm), i16 vario(cm/s), i32 baroAlt(cm).
/// (`fc_msp.c`, `case MSP_ALTITUDE`)
static const int altitude = 109;
/// Response: u8 mode, u8 state, u8 activeWpAction, u8 activeWpNumber,
/// u8 error, u16 headingHoldTarget. (`fc_msp.c`, `case MSP_NAV_STATUS`)
static const int navStatus = 121;
/// Response: u16 cycleTime, u16 i2cErrors, u16 sensorStatus,
/// u16 avgSystemLoad%, u8 (batteryProfile<<4|configProfile),
/// 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`)
static const int inavStatus = 0x2000;
}
/// Bits von `armingFlags` (Doku: `fc/runtime_config.h`, `armingFlags_e`).
/// Nur das fuer die Telemetrie benoetigte ARMED-Bit ist hier abgebildet.
abstract final class MspArmingFlags {
static const int armed = 1 << 2;
}