LTE Tutorial
LTE Tutorial
1. Overview
To meet the demand for long-distance operations of drones in various fields, the MSDK has opened up the drone's LTE functionality. Enabling the LTE function can ensure the stability of video transmission. The LTE Manager provides methods to set and obtain the LTE function switch status, domain name, password, username, etc.
2. Interface Call Description
2.1 LTE Switch Status
To set the LTE to be enabled, example code is as follows:
LTEManager.get().setLTEModuleEnable(isEnable = true,
onSuccess = {
updateLogInfo("open lte module success")
}, onFailure = { code, msg ->
updateLogInfo("open lte module onFailure:[code:$code;msg:$msg]")
})
To get the LTE switch status, the code is as follows:
LTEManager.get().getLTEModuleEnable(onSuccess = { state ->
updateLogInfo("get lte module enable state:$state")
}, onFailure = { code, msg ->
updateLogInfo("get lte module enable state onFailure:[code:$code;msg:$msg]")
})
2.2 LTE Domain Name
To set the LTE domain name, the example code is as follows:
LTEManager.get().setLTEAPNDomainName(domainName = "test domain name",
onSuccess = {
updateLogInfo("set domain name success")
}, onFailure = { code, msg ->
updateLogInfo("set domain name onFailure:[code:$code;msg:$msg]")
})
To get the LTE domain name, the example code is as follows:
LTEManager.get().getLTEAPNDomainName(onSuccess = { domain ->
updateLogInfo("get lte domain name onSuccess:[$domain]")
}, onFailure = { code, msg ->
updateLogInfo("get lte domain name failure:[code:$code;msg:$msg]")
})
2.3 LTE Username
To set the LTE username, an example code snippet is:
LTEManager.get().setLTEAPNUserName(userName = "test userName",
onSuccess = {
updateLogInfo("set username success")
}, onFailure = { code, msg ->
updateLogInfo("set username onFailure:[code:$code;msg:$msg]")
})
To get the LTE username, the example code is:
LTEManager.get().getLTEAPNUserName(onSuccess = { userName ->
updateLogInfo("get lte userName onSuccess:[$userName]")
}, onFailure = { code, msg ->
updateLogInfo("get lte userName onFailure:[code:$code;msg:$msg]")
})
2.4 LTE Password
To set the LTE password, the example code is as follows:
LTEManager.get().setLTEAPNPsd(passWord = "test passWord",
onSuccess = {
updateLogInfo("set password success")
}, onFailure = { code, msg ->
updateLogInfo("set password onFailure:[code:$code;msg:$msg]")
})
To get the LTE password, the example code is as follows:
LTEManager.get().getLTEAPNPsd(onSuccess = { passWord ->
updateLogInfo("get lte passWord onSuccess:[$passWord]")
}, onFailure = { code, msg ->
updateLogInfo("get lte passWord onFailure:[code:$code;msg:$msg]")
})
2.5 Get LTE Authorization Code
Example code:
LTEManager.get().getLTECcid(onSuccess = { ccid ->
updateLogInfo("get ccid onSuccess:[$ccid]")
}, onFailure = { code, msg ->
updateLogInfo("get ccid onFailure:[code:$code;msg:$msg]")
})
2.6 Get LTE Phone Number
Example code:
LTEManager.get().getLTEPhoneNumber(onSuccess = { phone ->
updateLogInfo("get phone onSuccess:[$phone]")
}, onFailure = { code, msg ->
updateLogInfo("get phone onFailure:[code:$code;msg:$msg]")
})
3.Sample Acquisition
Refer to LteFragment in the Sample.
4.Interface Description
/**
* Copyright: Autel Robotics
* @author R24033 on 2024/10/18
* LTE Management Class
*/
interface ILTEManager {
/**
* Set the LTE module switch status
* @param isEnable
* @param onSuccess
* @param onFailure
*/
fun setLTEModuleEnable(
isEnable: Boolean,
onSuccess: () -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Get the LTE module switch status
* @param onSuccess
* @param onFailure
*/
fun getLTEModuleEnable(
onSuccess: (Boolean) -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Set the LTE APN domain name
* @param domainName
* @param onSuccess
* @param onFailure
*/
fun setLTEAPNDomainName(
domainName: String,
onSuccess: () -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Get the LTE APN domain name
* @param onSuccess
* @param onFailure
*/
fun getLTEAPNDomainName(
onSuccess: (String?) -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Set the LTE APN username
* @param userName
* @param onSuccess
* @param onFailure
*/
fun setLTEAPNUserName(
userName: String,
onSuccess: () -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Get the LTE APN username
* @param onSuccess
* @param onFailure
*/
fun getLTEAPNUserName(
onSuccess: (String?) -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Set the LTE APN password
* @param passWord
* @param onSuccess
* @param onFailure
*/
fun setLTEAPNPsd(
passWord: String,
onSuccess: () -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Get the LTE APN password
* @param onSuccess
* @param onFailure
*/
fun getLTEAPNPsd(
onSuccess: (String?) -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Get the unique LTE authentication code
* @param onSuccess
* @param onFailure
*/
fun getLTECcid(
onSuccess: (String?) -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
/**
* Get the LTE phone number
* @param onSuccess
* @param onFailure
*/
fun getLTEPhoneNumber(
onSuccess: (String?) -> Unit,
onFailure: (code: IAutelCode?, msg: String?) -> Unit
)
}