UNPKG

dji-log-parser-js

Version:

Javascript bindings for dji-log-parser rust library

1,205 lines (1,131 loc) 35 kB
/* tslint:disable */ /* eslint-disable */ export interface KeychainFeaturePoint { featurePoint: FeaturePoint; aesKey: string; aesIv: string; } export interface EncodedKeychainFeaturePoint { featurePoint: FeaturePoint; aesCiphertext: string; } export type VirtualStickFlightCoordinateSystem = "Ground" | "Body" | { Unknown: number }; export type VirtualStickYawControlMode = "Angle" | "Velocity" | { Unknown: number }; export type VirtualStickRollPitchControlMode = "Angle" | "Velocity" | { Unknown: number }; export type VirtualStickVerticalControlMode = "Velocity" | "Position" | { Unknown: number }; export interface VirtualStick { verticalControlMode: VirtualStickVerticalControlMode; rollPitchControlMode: VirtualStickRollPitchControlMode; yawControlMode: VirtualStickYawControlMode; coordinateSystem: VirtualStickFlightCoordinateSystem; /** * Aircraft Roll. left and right panning [-30, 30] degrees */ roll: number; /** * Aircraft Pitch. forward or reverse [-30, 30] degrees. */ pitch: number; /** * Aircraft Yaw. left and right rotation [-180, 180] degrees */ yaw: number; /** * Aircraft throttle. Up or down [-5, 5]m/s */ throttle: number; } export type FlightModeSwitch = "One" | "Two" | "Three" | { Unknown: number }; export interface RC { /** * right stick - horizontal */ aileron: number; /** * right stick - vertical */ elevator: number; /** * left stick - vertical */ throttle: number; /** * left stick - horizontal */ rudder: number; gimbal: number; wheelBtnDown: boolean; wheelOffset: number; wheelPolarity: number; wheelChange: number; transformBtnReserve: number; returnBtn: boolean; flightModeSwitch: FlightModeSwitch; transformSwitch: number; customFunctionBtn4Down: boolean; customFunctionBtn3Down: boolean; customFunctionBtn2Down: boolean; customFunctionBtn1Down: boolean; playbackBtnDown: boolean; shutterBtnDown: boolean; recordBtnDown: boolean; bandwidth: number; gimbalControlEnable: number; } export interface OFDM { signalPercent: number; isUp: boolean; } export interface AppWarn { message: string; } export type FeaturePoint = "BaseFeature" | "VisionFeature" | "WaypointFeature" | "AgricultureFeature" | "AirLinkFeature" | "AfterSalesFeature" | "DJIFlyCustomFeature" | "PlaintextFeature" | "FlightHubFeature" | "GimbalFeature" | "RCFeature" | "CameraFeature" | "BatteryFeature" | "FlySafeFeature" | "SecurityFeature"; export type ImuInitFailReason = "MonitorError" | "CollectingData" | "AcceDead" | "CompassDead" | "BarometerDead" | "BarometerNegative" | "CompassModTooLarge" | "GyroBiasTooLarge" | "AcceBiasTooLarge" | "CompassNoiseTooLarge" | "BarometerNoiseTooLarge" | "WaitingMcStationary" | "AcceMoveTooLarge" | "McHeaderMoved" | "McVibrated" | { Unknown: number }; export type NonGPSCause = "Already" | "Forbid" | "GpsNumNonEnough" | "GpsHdopLarge" | "GpsPositionNonMatch" | "SpeedErrorLarge" | "YawErrorLarge" | "CompassErrorLarge" | { Unknown: number }; export type MotorStartFailedCause = "None" | "CompassError" | "AssistantProtected" | "DeviceLocked" | "DistanceLimit" | "IMUNeedCalibration" | "IMUSNError" | "IMUWarning" | "CompassCalibrating" | "AttiError" | "NoviceProtected" | "BatteryCellError" | "BatteryCommuniteError" | "SeriousLowVoltage" | "SeriousLowPower" | "LowVoltage" | "TempureVolLow" | "SmartLowToLand" | "BatteryNotReady" | "SimulatorMode" | "PackMode" | "AttitudeAbnormal" | "UnActive" | "FlyForbiddenError" | "BiasError" | "EscError" | "ImuInitError" | "SystemUpgrade" | "SimulatorStarted" | "ImuingError" | "AttiAngleOver" | "GyroscopeError" | "AcceleratorError" | "CompassFailed" | "BarometerError" | "BarometerNegative" | "CompassBig" | "GyroscopeBiasBig" | "AcceleratorBiasBig" | "CompassNoiseBig" | "BarometerNoiseBig" | "InvalidSn" | "FlashOperating" | "GPSdisconnect" | "SDCardException" | "IMUNoconnection" | "RCCalibration" | "RCCalibrationException" | "RCCalibrationUnfinished" | "RCCalibrationException2" | "RCCalibrationException3" | "AircraftTypeMismatch" | "FoundUnfinishedModule" | "CyroAbnormal" | "BaroAbnormal" | "CompassAbnormal" | "GPSAbnormal" | "NSAbnormal" | "TopologyAbnormal" | "RCNeedCali" | "InvalidFloat" | "M600BatTooLittle" | "M600BatAuthErr" | "M600BatCommErr" | "M600BatDifVoltLarge1" | "M600BatDifVoltLarge2" | "InvalidVersion" | "GimbalGyroAbnormal" | "GimbalESCPitchNonData" | "GimbalESCRollNonData" | "GimbalESCYawNonData" | "GimbalFirmwIsUpdating" | "GimbalDisorder" | "GimbalPitchShock" | "GimbalRollShock" | "GimbalYawShock" | "IMUcCalibrationFinished" | "BattVersionError" | "RTKBadSignal" | "RTKDeviationError" | "ESCCalibrating" | "GPSSignInvalid" | "GimbalIsCalibrating" | "LockByApp" | "StartFlyHeightError" | "ESCVersionNotMatch" | "IMUOriNotMatch" | "StopByApp" | "CompassIMUOriNotMatch" | "BatteryOverTemperature" | "BatteryInstallError" | "BeImpact" | { Unknown: number }; export type FlightAction = "None" | "WarningPowerGoHome" | "WarningPowerLanding" | "SmartPowerGoHome" | "SmartPowerLanding" | "LowVoltageLanding" | "LowVoltageGoHome" | "SeriousLowVoltageLanding" | "RCOnekeyGoHome" | "RCAssistantTakeoff" | "RCAutoTakeoff" | "RCAutoLanding" | "AppAutoGoHome" | "AppAutoLanding" | "AppAutoTakeoff" | "OutOfControlGoHome" | "ApiAutoTakeoff" | "ApiAutoLanding" | "ApiAutoGoHome" | "AvoidGroundLanding" | "AirportAvoidLanding" | "TooCloseGoHomeLanding" | "TooFarGoHomeLanding" | "AppWPMission" | "WPAutoTakeoff" | "GoHomeAvoid" | "PGoHomeFinish" | "VertLowLimitLanding" | "BatteryForceLanding" | "MCProtectGoHome" | "MotorblockLanding" | "AppRequestForceLanding" | "FakeBatteryLanding" | "RTHComingObstacleLanding" | "IMUErrorRTH" | { Unknown: number }; export type BatteryType = "NonSmart" | "Smart" | { Unknown: number }; export type GoHomeStatus = "Standby" | "Preascending" | "Align" | "Ascending" | "Cruise" | "Braking" | "Bypassing" | { Unknown: number }; export type GroundOrSky = "Ground" | "Sky" | { Unknown: number }; export type AppCommand = "AutoFly" | "AutoLanding" | "HomePointNow" | "HomePointHot" | "HomePointLock" | "GoHome" | "StartMotor" | "StopMotor" | "Calibration" | "DeformProtecClose" | "DeformProtecOpen" | "DropGoHome" | "DropTakeOff" | "DropLanding" | "DynamicHomePointOpen" | "DynamicHomePointClose" | "FollowFunctionOpen" | "FollowFunctionClose" | "IOCOpen" | "IOCClose" | "DropCalibration" | "PackMode" | "UnPackMode" | "EnterManualMode" | "StopDeform" | "DownDeform" | "UpDeform" | "ForceLanding" | "ForceLanding2" | { Unknown: number }; export type FlightMode = "Manual" | "Atti" | "AttiCourseLock" | "AttiHover" | "Hover" | "GPSBlake" | "GPSAtti" | "GPSCourseLock" | "GPSHomeLock" | "GPSHotPoint" | "AssistedTakeoff" | "AutoTakeoff" | "AutoLanding" | "AttiLanding" | "GPSWaypoint" | "GoHome" | "ClickGo" | "Joystick" | "GPSAttiWristband" | "Cinematic" | "AttiLimited" | "Draw" | "GPSFollowMe" | "ActiveTrack" | "TapFly" | "Pano" | "Farming" | "FPV" | "GPSSport" | "GPSNovice" | "ConfirmLanding" | "TerrainTracking" | "NaviAdvGoHome" | "NaviAdvLanding" | "Tripod" | "TrackHeadlock" | "EngineStart" | "GPSGentle" | { Unknown: number }; export type DroneType = "None" | "Inspire1" | "Phantom3Advanced" | "Phantom3Pro" | "Phantom3Standard" | "OpenFrame" | "AceOne" | "WKM" | "Naza" | "A2" | "A3" | "Phantom4" | "Matrice600" | "Phantom34K" | "MavicPro" | "Inspire2" | "Phantom4Pro" | "N3" | "Spark" | "Matrice600Pro" | "MavicAir" | "Matrice200" | "Phantom4Advanced" | "Matrice210" | "Phantom3SE" | "Matrice210RTK" | "Phantom4ProV2" | "Mavic2" | "Mavic2Enterprise" | "MavicAir2" | "Matrice300RTK" | "Mini2" | "Mavic3Enterprise" | "Mavic3Pro" | "Matrice350RTK" | "Mini4Pro" | "Avata2" | { Unknown: number }; export interface OSD { /** * degrees */ longitude: number; /** * degrees */ latitude: number; /** * meters */ altitude: number; /** * meters / sec */ speedX: number; /** * meters / sec */ speedY: number; /** * meters / sec */ speedZ: number; /** * degrees */ pitch: number; /** * degrees */ roll: number; /** * degrees */ yaw: number; flightMode: FlightMode; rcOutcontrol: boolean; appCommand: AppCommand; canIocWork: boolean; groundOrSky: GroundOrSky; isMotorUp: boolean; isSwaveWork: boolean; goHomeStatus: GoHomeStatus; isVisionUsed: boolean; voltageWarning: number; isImuPreheated: boolean; modeChannel: number; isGpsValid: boolean; isCompassError: boolean; waveError: boolean; gpsLevel: number; batteryType: BatteryType; isOutOfLimit: boolean; isGoHomeHeightModified: boolean; isPropellerCatapult: boolean; isMotorBlocked: boolean; isNotEnoughForce: boolean; isBarometerDeadInAir: boolean; isVibrating: boolean; isAcceletorOverRange: boolean; gpsNum: number; flightAction: FlightAction; motorStartFailedCause: MotorStartFailedCause; nonGpsCause: NonGPSCause; waypointLimitMode: boolean; battery: number; /** * meters */ sWaveHeight: number; /** * second */ flyTime: number; motorRevolution: number; versionC: number; droneType: DroneType; imuInitFailReason: ImuInitFailReason; } export interface KeyStorage { featurePoint: FeaturePoint; data: number[]; } export interface GoBusinessData { version: number[]; } export interface FrameGimbal { /** * Current gimbal mode */ mode?: GimbalMode; /** * Gimbal pitch angle in degrees */ pitch: number; /** * Gimbal roll angle in degrees */ roll: number; /** * Gimbal yaw angle in degrees */ yaw: number; /** * Indicates if gimbal pitch is at its limit */ isPitchAtLimit: boolean; /** * Indicates if gimbal roll is at its limit */ isRollAtLimit: boolean; /** * Indicates if gimbal yaw is at its limit */ isYawAtLimit: boolean; /** * Indicates if the gimbal is stuck */ isStuck: boolean; } export interface FrameApp { tip: string; warn: string; } export type Platform = "IOS" | "Android" | "DJIFly" | "Windows" | "Mac" | "Linux" | { Unknown: number }; export type ProductType = "None" | "Inspire1" | "Phantom3Standard" | "Phantom3Advanced" | "Phantom3Pro" | "OSMO" | "Matrice100" | "Phantom4" | "LB2" | "Inspire1Pro" | "A3" | "Matrice600" | "Phantom34K" | "MavicPro" | "ZenmuseXT" | "Inspire1RAW" | "A2" | "Inspire2" | "OSMOPro" | "OSMORaw" | "OSMOPlus" | "Mavic" | "OSMOMobile" | "OrangeCV600" | "Phantom4Pro" | "N3FC" | "Spark" | "Matrice600Pro" | "Phantom4Advanced" | "Phantom3SE" | "AG405" | "Matrice200" | "Matrice210" | "Matrice210RTK" | "MavicAir" | "Mavic2" | "Phantom4ProV2" | "Phantom4RTK" | "Phantom4Multispectral" | "Mavic2Enterprise" | "MavicMini" | "Matrice200V2" | "Matrice210V2" | "Matrice210RTKV2" | "MavicAir2" | "Matrice300RTK" | "FPV" | "MavicAir2S" | "Mini2" | "Mavic3" | "MiniSE" | "Mini3Pro" | "Mavic3Pro" | "Mini2SE" | "Matrice30" | "Mavic3Enterprise" | "Avata" | "Mini4Pro" | "Avata2" | "Matrice350RTK" | { Unknown: number }; export interface Details { subStreet: string; street: string; city: string; area: string; isFavorite: number; isNew: number; needsUpload: number; recordLineCount: number; detailInfoChecksum: number; startTime: string; /** * degrees */ longitude: number; /** * degrees */ latitude: number; /** * meters */ totalDistance: number; /** * seconds */ totalTime: number; /** * meters */ maxHeight: number; /** * meters / seconds */ maxHorizontalSpeed: number; /** * meters / seconds */ maxVerticalSpeed: number; captureNum: number; videoTime: number; momentPicImageBufferLen: [number, number, number, number]; momentPicShrinkImageBufferLen: [number, number, number, number]; /** * degrees */ momentPicLongitude: [number, number, number, number]; /** * degrees */ momentPicLatitude: [number, number, number, number]; takeOffAltitude: number; productType: ProductType; aircraftName: string; aircraftSn: string; cameraSn: string; rcSn: string; batterySn: string; appPlatform: Platform; appVersion: string; } export type CompassCalibrationState = "NotCalibrating" | "Horizontal" | "Vertical" | "Successful" | "Failed" | { Unnown: number }; export type GoHomeMode = "Normal" | "FixedHeight"; export type IOCMode = "CourseLock" | "HomeLock" | "HotspotSurround" | { Unknown: number }; export interface Home { /** * degrees */ longitude: number; /** * degrees */ latitude: number; /** * meters */ altitude: number; isHomeRecord: boolean; goHomeMode: GoHomeMode; aircraftHeadDirection: number; isDynamicHomePointEnabled: boolean; isNearDistanceLimit: boolean; isNearHeightLimit: boolean; isMultipleModeOpen: boolean; hasGoHome: boolean; compassState: CompassCalibrationState; isCompassAdjust: boolean; isBeginnerMode: boolean; isIocOpen: boolean; iocMode: IOCMode; goHomeHeight: number; iocCourseLockAngle: number; flightRecordSdState: number; recordSdCapacityPercent: number; recordSdLeftTime: number; currentFlightRecordIndex: number; maxAllowedHeight: number; } export type DeformStatus = "FoldComplete" | "Folding" | "StretchComplete" | "Stretching" | "StopDeformation" | { Unknown: number }; export type DeformMode = "Pack" | "Protect" | "Normal" | { Unknown: number }; export interface Deform { isDeformProtected: boolean; deformStatus: DeformStatus; deformMode: DeformMode; } export interface Custom { hSpeed: number; distance: number; updateTimestamp: string; } export type ComponentType = "Camera" | "Aircraft" | "RC" | "Battery" | { Unknown: number }; export interface ComponentSerial { componentType: ComponentType; serial: string; } export interface Recover { productType: ProductType; appPlatform: Platform; appVersion: string; aircraftSn: string; aircraftName: string; timestamp: string; cameraSn: string; rcSn: string; batterySn: string; } export type FailSafeProtectionType = "Hover" | "Landing" | "GoHome" | { Unknown: number }; export interface MCParams { failSafeProtection: FailSafeProtectionType; mvoFuncEnabled: boolean; avoidObstacleEnabled: boolean; userAvoidEnabled: boolean; } /** * Represents the different types of records. * * Each variant of this enum corresponds to a specific type of record in the log file. * Records typically consist of a \'magic\' byte indicating the record type, followed by the length of the record, * the actual data, and then a terminating byte of value `0xff`. * */ export type Record = { type: "OSD"; content: OSD } | { type: "Home"; content: Home } | { type: "Gimbal"; content: Gimbal } | { type: "RC"; content: RC } | { type: "Custom"; content: Custom } | { type: "Deform"; content: Deform } | { type: "CenterBattery"; content: CenterBattery } | { type: "SmartBattery"; content: SmartBattery } | { type: "AppTip"; content: AppTip } | { type: "AppWarn"; content: AppWarn } | { type: "RCGPS"; content: RCGPS } | { type: "Recover"; content: Recover } | { type: "AppGPS"; content: AppGPS } | { type: "Firmware"; content: Firmware } | { type: "MCParams"; content: MCParams } | { type: "SmartBatteryGroup"; content: SmartBatteryGroup } | { type: "AppSeriousWarn"; content: AppSeriousWarn } | { type: "Camera"; content: Camera } | { type: "VirtualStick"; content: VirtualStick } | { type: "ComponentSerial"; content: ComponentSerial } | { type: "OFDM"; content: OFDM } | { type: "KeyStorageRecover"; content: number[] } | { type: "GoBusinessData"; content: GoBusinessData } | { type: "KeyStorage"; content: KeyStorage } | { type: "RCDisplayField"; content: RCDisplayField } | { type: "JPEG"; content: number[] } | { type: "Unknown"; content: [number, number[]] } | { type: "Invalid"; content: number[] }; /** * Represents a normalized frame of data from a DJI log. * * A `Frame` is a standardized representation of log data, normalized across * different log versions. It provides a consistent and easy-to-use format * for analyzing and processing DJI log information. * */ export interface Frame { custom: FrameCustom; osd: FrameOSD; gimbal: FrameGimbal; camera: FrameCamera; rc: FrameRC; battery: FrameBattery; home: FrameHome; recover: FrameRecover; app: FrameApp; } export interface FrameRecover { /** * The platform of the app used (e.g., iOS, Android) */ appPlatform?: Platform; /** * Version of the app used */ appVersion: string; /** * Name of the aircraft */ aircraftName: string; /** * Serial number of the aircraft */ aircraftSn: string; cameraSn: string; /** * Serial number of the remote control */ rcSn: string; /** * Serial number of the battery */ batterySn: string; } export interface FrameRC { /** * Downlink signal strength */ downlinkSignal?: number; /** * Uplink signal strength */ uplinkSignal?: number; /** * Right stick horizontal position (aileron) */ aileron: number; /** * Right stick vertical position (elevator) */ elevator: number; /** * Left stick vertical position (throttle) */ throttle: number; /** * Left stick horizontal position (rudder) */ rudder: number; } export interface FrameDetails { /** * Total flight time in seconds */ totalTime: number; /** * Total distance flown in meters */ totalDistance: number; /** * Maximum height reached during the flight in meters */ maxHeight: number; /** * Maximum horizontal speed reached during the flight in meters per second */ maxHorizontalSpeed: number; /** * Maximum vertical speed reached during the flight in meters per second */ maxVerticalSpeed: number; /** * Number of photos taken during the flight */ photoNum: number; /** * Total video recording time in seconds */ videoTime: number; /** * Name of the aircraft */ aircraftName: string; /** * Serial number of the aircraft */ aircraftSn: string; /** * Serial number of the camera */ cameraSn: string; /** * Serial number of the remote control */ rcSn: string; /** * The platform of the app used (e.g., iOS, Android) */ appPlatform: Platform; /** * Version of the app used */ appVersion: string; } export interface FrameBattery { /** * Battery charge level in percentage */ chargeLevel: number; /** * Battery voltage */ voltage: number; /** * Battery current */ current: number; /** * Current battery capacity */ currentCapacity: number; /** * Full battery capacity */ fullCapacity: number; /** * Number of battery cells */ cellNum: number; /** * Indicates if cell voltage is derived from global voltage */ isCellVoltageEstimated: boolean; /** * Cell voltages */ cellVoltages: number[]; /** * Deviation in cell voltages */ cellVoltageDeviation: number; /** * Maximum deviation in cell voltages */ maxCellVoltageDeviation: number; /** * Battery temperature */ temperature: number; /** * Minimum battery temperature */ minTemperature: number; /** * Maximum battery temperature */ maxTemperature: number; } export type BatteryGoHomeStatus = "NonGoHome" | "GoHome" | "GoHomeAlready" | { Unknown: number }; export interface SmartBattery { usefulTime: number; goHomeTime: number; landTime: number; goHomeBattery: number; landBattery: number; safeFlyRadius: number; volumeConsume: number; status: number; goHomeStatus: BatteryGoHomeStatus; goHomeCountdown: number; /** * volts */ voltage: number; percent: number; lowWarning: number; lowWarningGoHome: number; seriousLowWarning: number; seriousLowWarningLanding: number; reserve: number; } export interface RCDisplayField { /** * right stick - horizontal */ aileron: number; /** * right stick - vertical */ elevator: number; /** * left stick - vertical */ throttle: number; /** * left stick - horizontal */ rudder: number; gimbal: number; } export type SenderType = "None" | "Camera" | "MC" | "Gimbal" | "RC" | "Battery" | { Unknown: number }; export interface Firmware { senderType: SenderType; subSenderType: number; version: string; } export interface AppTip { message: string; } /** * Request structure for keychain API. */ export interface KeychainsRequest { version: number; department: number; keychainsArray: EncodedKeychainFeaturePoint[][]; } export interface FrameCustom { /** * Date and time of the frame */ dateTime: string; } export type GimbalMode = "Free" | "FPV" | "YawFollow" | { Unknown: number }; export interface Gimbal { /** * degrees */ pitch: number; /** * degrees */ roll: number; /** * degrees */ yaw: number; mode: GimbalMode; reset: number; rollAdjust: number; yawAngle: number; isPitchAtLimit: boolean; isRollAtLimit: boolean; isYawAtLimit: boolean; isAutoCalibration: boolean; autoCalibrationResult: boolean; installDirection: boolean; isStuck: boolean; version: number; isDoubleClick: boolean; isTripleClick: boolean; isSingleClick: boolean; } export interface CenterBattery { relativeCapacity: number; voltage: number; currentCapacity: number; fullCapacity: number; life: number; numberOfDischarges: number; errorType: number; current: number; voltageCell1: number; voltageCell2: number; voltageCell3: number; voltageCell4: number; voltageCell5: number; voltageCell6: number; serialNumber: number; productDate: number; temperature: number; connectState: number; sumLearnCount: number; latestLearnCycle: number; batteryOnCharge: boolean; reverse: number; } export interface AppSeriousWarn { message: string; } export interface FrameOSD { /** * Flight time in seconds */ flyTime: number; /** * Latitude in degrees */ latitude: number; /** * Longitude in degrees */ longitude: number; /** * Height above ground level in meters */ height: number; /** * Maximum height reached in meters */ heightMax: number; /** * Visual Positioning System height in meters */ vpsHeight: number; /** * Altitude above sea level in meters */ altitude: number; /** * Speed along the X-axis in meters per second */ xSpeed: number; /** * Maximum speed reached along the X-axis in meters per second */ xSpeedMax: number; /** * Speed along the Y-axis in meters per second */ ySpeed: number; /** * Maximum speed reached along the Y-axis in meters per second */ ySpeedMax: number; /** * Vertical speed in meters per second */ zSpeed: number; /** * Maximum vertical speed reached in meters per second */ zSpeedMax: number; /** * Pitch angle in degrees */ pitch: number; /** * Roll angle in degrees */ roll: number; /** * Yaw angle in degrees */ yaw: number; /** * Current flight mode */ flycState?: FlightMode; /** * Current app command */ flycCommand?: AppCommand; /** * Current flight action */ flightAction?: FlightAction; /** * Indicates if GPS is being used */ isGpdUsed: boolean; /** * Reason for not using GPS */ nonGpsCause?: NonGPSCause; /** * Number of GPS satellites detected */ gpsNum: number; /** * GPS signal level */ gpsLevel: number; /** * Type of drone */ droneType?: DroneType; /** * Indicates if obstacle avoidance is active */ isSwaveWork: boolean; /** * Indicates if there\'s an error with obstacle avoidance */ waveError: boolean; /** * Current status of the return-to-home function */ goHomeStatus?: GoHomeStatus; /** * Type of battery */ batteryType?: BatteryType; /** * Indicates if the drone is on the ground */ isOnGround: boolean; /** * Indicates if the motor is running */ isMotorOn: boolean; /** * Indicates if the motor is blocked */ isMotorBlocked: boolean; /** * Reason for motor start failure */ motorStartFailedCause?: MotorStartFailedCause; /** * Indicates if the IMU is preheated */ isImuPreheated: boolean; /** * Reason for IMU initialization failure */ imuInitFailReason?: ImuInitFailReason; /** * Indicates if the accelerometer is over range */ isAcceletorOverRange: boolean; /** * Indicates if the barometer is malfunctioning in air */ isBarometerDeadInAir: boolean; /** * Indicates if there\'s a compass error */ isCompassError: boolean; /** * Indicates if the return-to-home height has been modified */ isGoHomeHeightModified: boolean; /** * Indicates if Intelligent Orientation Control can work */ canIocWork: boolean; /** * Indicates if there\'s not enough force (e.g., low battery) */ isNotEnoughForce: boolean; /** * Indicates if the drone is out of its flight limit */ isOutOfLimit: boolean; /** * Indicates if propeller catapult protection is active */ isPropellerCatapult: boolean; /** * Indicates if the drone is experiencing vibrations */ isVibrating: boolean; /** * Indicates if vision positioning system is being used */ isVisionUsed: boolean; /** * Battery voltage warning level */ voltageWarning: number; } export interface SmartBatterySingleVoltage { index: number; cell_count: number; cell_voltages: number[]; } export interface SmartBatteryDynamic { index: number; /** * volts */ current_voltage: number; current_current: number; /** * mAh */ full_capacity: number; /** * mAh */ remained_capacity: number; /** * degrees */ temperature: number; cell_count: number; capacity_percent: number; battery_state: number; } export interface SmartBatteryStatic { index: number; designed_capacity: number; loop_times: number; full_voltage: number; serial_number: number; version_number: [number, number, number, number, number, number, number, number]; battery_life: number; battery_type: number; } export type SmartBatteryGroup = ({ type: "SmartBatteryStatic" } & SmartBatteryStatic) | ({ type: "SmartBatteryDynamic" } & SmartBatteryDynamic) | ({ type: "SmartBatterySingleVoltage" } & SmartBatterySingleVoltage); export interface FrameCamera { /** * Indicates if the camera is in photo mode */ isPhoto: boolean; /** * Indicates if the camera is in video mode */ isVideo: boolean; /** * Indicates if an SD card is inserted */ sdCardIsInserted: boolean; /** * Current state of the SD card */ sdCardState?: SDCardState; } export interface RCGPS { hour: number; minute: number; second: number; year: number; month: number; day: number; latitude: number; longitude: number; speedX: number; speedY: number; gpsNum: number; accuracy: number; validData: number; } export type CameraWorkMode = "Capture" | "Recording" | "Playback" | "Transcode" | "Tuning" | "PowerSave" | "Download" | "XcodePlayback" | "Broadcast" | { Unknown: number }; export type SDCardState = "Normal" | "NoCard" | "InvalidCard" | "WriteProtected" | "Unformatted" | "Formatting" | "IllegalFileSys" | "Busy" | "Full" | "LowSpeed" | "IndexMax" | "Initialize" | "SuggestFormat" | "Repairing" | { Unknown: number }; export interface Camera { isConnect: boolean; isUsbConnect: boolean; timerSyncState: number; isShootingSinglePhoto: boolean; isRecording: boolean; hasSdCard: boolean; sdCardState: SDCardState; isUpgrading: number; isHeat: boolean; isCaptureDisable: boolean; isDdrStoring: boolean; contiCapture: boolean; hdmiOutputStatus: boolean; encryptStatus: number; fileSynState: boolean; rcBtnForbidState: boolean; getFocusState: boolean; panoTimelapseGimbalState: boolean; isEnableTrackingMode: boolean; workMode: CameraWorkMode; /** * MB */ sdCardTotalCapacity: number; /** * MB */ sdCardRemainCapacity: number; remainPhotoNum: number; /** * seconds */ remainVideoTimer: number; /** * seconds */ recordTime: number; cameraType: number; } export interface AppGPS { /** * degrees */ longitude: number; /** * degrees */ latitude: number; } export interface FrameHome { /** * Home point latitude in degrees */ latitude: number; /** * Home point longitude in degrees */ longitude: number; /** * Home point altitude in meters */ altitude: number; /** * Max allowed height in meters */ heightLimit: number; /** * Indicates if home point is recorded */ isHomeRecord: boolean; /** * Current return-to-home mode */ goHomeMode?: GoHomeMode; /** * Indicates if dynamic home point is enabled */ isDynamicHomePointEnabled: boolean; /** * Indicates if the drone is near its distance limit */ isNearDistanceLimit: boolean; /** * Indicates if the drone is near its height limit */ isNearHeightLimit: boolean; /** * Indicates if compass calibration is in progress */ isCompassCalibrating: boolean; /** * Current state of compass calibration */ compassCalibrationState?: CompassCalibrationState; /** * Indicates if multiple flight modes are enabled */ isMultipleModeEnabled: boolean; /** * Indicates if beginner mode is active */ isBeginnerMode: boolean; /** * Indicates if Intelligent Orientation Control is enabled */ isIocEnabled: boolean; /** * Current Intelligent Orientation Control mode */ iocMode?: IOCMode; /** * Return-to-home height in meters */ goHomeHeight: number; /** * Intelligent Orientation Control course lock angle */ iocCourseLockAngle?: number; /** * Maximum allowed height for the drone in meters */ maxAllowedHeight: number; /** * Index of the current flight record */ currentFlightRecordIndex: number; } /** */ export class DJILog { free(): void; /** * Constructs a `DJILog` from an array of bytes. * * This function parses the Prefix and Info blocks of the log file, * and handles different versions of the log format. * * # Arguments * * * `bytes` - An Uint8Array representing the DJI log file. * @param {Uint8Array} bytes */ constructor(bytes: Uint8Array); /** * Creates a `KeychainsRequest` object by parsing `KeyStorage` records. * * This function is used to build a request body for manually retrieving the keychain from the DJI API. * Keychains are required to decode records for logs with a version greater than or equal to 13. * For earlier versions, this function returns a default `KeychainsRequest`. * @returns {KeychainsRequest} */ keychainsRequest(): KeychainsRequest; /** * * This function first creates a `KeychainRequest` using the `keychain_request()` method, * then uses that request to fetch the actual keychains from the DJI API. * Keychains are required to decode records for logs with a version greater than or equal to 13. * * # Arguments * * * `api_key` - A string that holds the API key for authentication with the DJI API. * * `endpoint` - An optional string that specifies the endpoint for the DJI API. If not provided, a default endpoint will be used. * @param {string} api_key * @param {string | undefined} [endpoint] * @returns {Promise<KeychainFeaturePoint[][]>} */ fetchKeychains(api_key: string, endpoint?: string): Promise<KeychainFeaturePoint[][]>; /** * Retrieves the parsed raw records from the DJI log. * * This function decodes the raw records from the log file * * # Arguments * * * `keychains` - An optional vector of vectors containing `KeychainFeaturePoint` instances. This parameter * is used for decryption when working with encrypted logs (versions >= 13). If nothing is provided, * the function will attempt to process the log without decryption. * @param {KeychainFeaturePoint[][] | undefined} [keychains] * @returns {Record[]} */ records(keychains?: KeychainFeaturePoint[][]): Record[]; /** * Retrieves the normalized frames from the DJI log. * * This function processes the raw records from the log file and converts them into standardized * frames. Frames are a more user-friendly representation of the log data, normalized across all * log versions for easier use and analysis. * * The function first decodes the raw records based on the specified decryption method, then * converts these records into frames. This normalization process makes it easier to work with * log data from different DJI log versions. * * # Arguments * * * `keychains` - An optional vector of vectors containing `KeychainFeaturePoint` instances. This parameter * is used for decryption when working with encrypted logs (versions >= 13). If nothing is provided, * the function will attempt to process the log without decryption. * @param {KeychainFeaturePoint[][] | undefined} [keychains] * @returns {Frame[]} */ frames(keychains?: KeychainFeaturePoint[][]): Frame[]; /** * Get details */ readonly details: Details; /** * Get version */ readonly version: number; }