Skip to main content

ILogManager

class ILogManager

Description Log download management class

method configLogLocalPath

fun configLogLocalPath(path: String)

Description: Set the log save path

Input parameters

path: The log save path

Output parameter: None

method queryLogInfoList

fun queryLogInfoList(
sn: String,
deviceType: DeviceLogTypeEnum,
callback: CommonCallbacks.CompletionCallbackWithParam<DeviceSysLog?>
)

Description: Query device logs

Input parameters

sn: Device serial number

deviceType: device type,refer to DeviceLogTypeEnum

callback:Query callback, refer to DeviceSysLog

Output parameter: None

method queryLogRealTimeInfoList

fun queryLogRealTimeInfoList(callback: CommonCallbacks.CompletionCallbackWithParam<DeviceSysLog?>)

Description: Query drone real-time log

Input parameters callback:Query callback, refer to DeviceSysLog

Output parameter: None

method downloadPowerLog

fun downloadPowerLog(
powerLogs: List<DeviceSysOncePowerLog>,
callback: CommonCallbacks.DownLoadCallbackCompletionWithProgressAndFile<Double, DeviceSysLogModule>
)

Description: Download logs by power record

Input parameters

powerLogs:logs by power record, refer to DeviceSysOncePowerLog

Query callback, refer to DeviceSysLogModule

Note:Each time a DeviceSysLogModule is completed, it will be notified through onProgressFileUpdate

Output parameter: None

method downloadModuleLog

fun downloadModuleLog(
moduleLogs: List<DeviceSysLogModule>,
callback: CommonCallbacks.DownLoadCallbackCompletionWithProgressAndFile<Double, DeviceSysLogModule>
)

Description: Download log by module

Input parameters

moduleLogs:List of module you want to download logs,refer to DeviceSysLogModule

callback:Query callback

Note:Each time a DeviceSysLogModule is completed, it will be notified through onProgressFileUpdate

Output parameter: None

method deleteLog

fun deleteLog(powerLog: DeviceSysOncePowerLog, callback: CommonCallbacks.CompletionCallback)

Description: Delete logs by power record

Input parameters

powerLog:logs by power record, refer to DeviceSysOncePowerLog

callback:Query callback

Output parameter: None

method deleteLog

fun deleteLog(moduleLog: DeviceSysLogModule, callback: CommonCallbacks.CompletionCallback)

Description: Delete the module log

Input parameters

moduleLog:Module log, refer to DeviceSysLogModule

callback:Query callback

Output parameter: None

method canceldownload

fun canceldownload()

Description: Cancel download log

Input parameters None

Output parameter: None

DeviceLogTypeEnum

Description Device Type Enumeration

enum class DeviceLogTypeEnum(var value: String) {
UNKOWN("Unkown"),
/** Remote control */
RC("RC"),
/** Drone*/
DRONE("UAV"),
/** App */
APP("APP"),
/** Drone nest */
NEST("NEST");
}

DeviceSysLog

Description Log information

data class DeviceSysLog(
var type: DeviceLogTypeEnum, //Log type
var sn: String, //Device serial number
var powerLogList: List<DeviceSysOncePowerLog>, //List of Power log
val deviceType: String = "" //Device type
)

DeviceSysOncePowerLog

Description Power log record information

data class DeviceSysOncePowerLog(
var type: DeviceLogTypeEnum, //Log type
var sn: String, //Device serial number
var index: Int, //Index of power logs
var time: Long, //Timestamp
var moduleList: List<DeviceSysLogModule>, //List of module logs
)

DeviceSysLogModule

Description Log information of modules

data class DeviceSysLogModule(
var mode: DeviceLogTypeEnum, //Device type
var sn: String, //Device serial number
var index: Int, //Index of power logs
var type: DeviceLogEnum, //Log type
var time: Long, //Timestamp
var size: Int, //Module log size. Note: The value is available only after the download operation is executed.
var downPath: String = "", //Log file download address, users don't need to care
var name: String = "", //Log file name
var localPath: String = "" //The directory after the log is downloaded. Note: the value will be available only after the download operation is executed.
)

DeviceLogEnum

Description Log Type Enumeration

enum class DeviceLogEnum(var value: String, val type: Int) {

/** unknown */
UNKOWN("Unkown", 0),

/** Rc Transmission */
RCTRANSMISSION("RcTransmission", 1),

/** Air Transmission */
AIRTRANSMISSION("AirTransmission", 2),

/** Air Skylink*/
AIRSKYLINK("AirSkylink", 3),

/** Air Vision*/
AIRVISION("AirVision", 4),

/** Rc Android */
RCANDROID("RcAndroid", 5),

/** Air Camera*/
AIRCAMERA("AirCamera", 6),

/** NestAndroid */
NESTANDROID("NestAndroid", 7),

/** app */
APP("App", 8),

/** Only if the plane goes missing*/
REALTIME("RealTime", 9),

/** Only the power-on record is available, but no module log is available */
POWERON("PowerON", 10);
}