Skip to main content

UpgradeManger

class UpgradeManger

Description: Upgrade Management

    class UpgradeManger : IUpgradeManager {
/**
* sd card path
*/
private var sdPath: String? = null
/**
* progress call back object
*/
private var mProgressCallback: CommonCallbacks.KeyListener<Int>? = null
/**
* result call back object
*/
private var mResultCallback: CommonCallbacks.KeyListener<UpgradeResultBean>? = null
/**
* client type enum holder
*/
var clientType = UpgradeClientTypeEnum.CLIENT_TYPE_GND
}

method getKeyManager

    private fun getKeyManager(): IKeyManager? 

Description: Getting current key manager object

Input parameters: None。

Output parameters: None。

Related parameters: None。

method performUpgradeQuery

    fun performUpgradeQuery(queryCallback: CompletionCallbackWithParam<Void>)

Description: Perform upgrade query

Input parameters: queryCallback: callback for completion of upgrade

Output parameters: None。

Related parameters: None。

method performUpgradeStateQuery

    fun performUpgradeStateQuery(callback: CompletionCallbackWithParam<UpgradeStateEnum>)

Description: Update starts with callback

Input parameters: queryCallback: callback for completion of upgrade

Output parameters: None。

Related parameters: None。

method performEnter

    private fun performEnter(file: File) 

Description: Start upgrade

Input parameters: file: file path

Output parameters: None。

Related parameters: None。

method performUpgradeEnter

    fun performUpgradeEnter(upgradeEnterCallback: CompletionCallbackWithParam<Void>) 

Description: Perform upgrade callback of starting

Input parameters: upgradeEnterCallback: upgrade starts listener

Output parameters: None。

Related parameters: None。

method performUpgradeTransfer

     private fun performUpgradeTransfer(progress: Int, file: File)

Description: Perform upgrade transfer progress

Input parameters: progress: progress for transfer file: file path

Output parameters: None。

Related parameters: None。

method performUpgradeTransfer

    fun performUpgradeTransfer(progress: Int, upgradeTransferCallback: CompletionCallbackWithParam<Void>)

Description: Perform upgrade transfer

Input parameters: progress: progress value of transfer upgradeEnterCallback: upgrade enter callback

Output parameters: None。

Related parameters: None。

method performUpgradeCheck

    private fun performUpgradeCheck(MD5: String, fileName: String)

Description: Upgrade checking

Input parameters: MD5: string value of MD5 fileName: file name of upgrade check

Output parameters: None。

Related parameters: None。

method performUpgradeCheck

    fun performUpgradeCheck(MD5: String, fileName: String, upgradeTransferCallback: CompletionCallbackWithParam<Void>)

Description: Upgrade checking with callback

Input parameters: MD5: string value of MD5 fileName: file name of upgrade check upgradeTransferCallback: callback object for upgrade checking

Output parameters: None。

Related parameters: None。

method performKeyUpgradeExecute

    private fun performKeyUpgradeExecute(force: Boolean, fileName: String) 

Description: Upgrade starting

Input parameters: force: force upgrade or not state fileName: file name of upgrade

Output parameters: None。

Related parameters: None。

method performUpgradeComponentCheck

    fun performUpgradeComponentCheck(callback: CommonCallbacks.KeyListener<List<DroneVersionItemBean>>)

Description: Upgrade callback setting

Input parameters: callback: callback object of key listener

Output parameters: None。

Related parameters: None。

method performUpgradeComponentRecover

    fun performUpgradeComponentRecover() 

Description: Perform upgrade component recover

Input parameters: None。

Output parameters: None。

Related parameters: None。

method performUpgradeComponentRecover

    fun performUpgradeComponentRecover(callback: CompletionCallbackWithParam<Void>)

Description: Perform upgrade component recover with callback

Input parameters: callback: object for completion of upgrade

Output parameters: None。

Related parameters: None。

method setHighSeedMode

    fun setHighSeedMode(highSpeed: HighSpeedEnum, setHighSpeedModeCallback: CompletionCallbackWithParam<Void>)

Description: Set the uplink and downlink high-speed mode

Input parameters: highSpeed: high speed enum state setHighSpeedModeCallback: callback of completion

Output parameters: None。

Related parameters: None。

method getHighSeedMode

    fun getHighSeedMode(getHighSpeedModeCallback: CompletionCallbackWithParam<HighSpeedEnum>)

Description: Get uplink and downlink high-speed mode

Input parameters: getHighSpeedModeCallback: get callback passes for completion

Output parameters: None。

Related parameters: None。

method exitHighSeedMode

    fun exitHighSeedMode()

Description: exit high speed mode

Input parameters: None。

Output parameters: None。

Related parameters: None。

method performKeyUpgradeExecute

    fun performKeyUpgradeExecute(fileName: String, upgradeExecuteCallback: CompletionCallbackWithParam<Int>)

Description: Perform upgrade start with callback

Input parameters: fileName: file name of upgrade upgradeExecuteCallback: callback object for completion

Output parameters: None。

Related parameters: None。

method isForceUpgrade

    fun isForceUpgrade(): Boolean

Description: Returning state for force upgrade or not

Input parameters: None。

Output parameters: true/false for force upgrade enable or not

Related parameters: None。