[8.1.0_new_ota]OTA 2.0 版本
This commit is contained in:
@@ -1556,6 +1556,14 @@ class MoGoAutopilotControlProvider :
|
||||
return AdasManager.getInstance().sendSsmFuncOtaStatusQuery(token)>-1
|
||||
}
|
||||
|
||||
/**
|
||||
* OTA2.0查询
|
||||
* @param queryStr {"cmd":"PAD_QUERY_UPGRADE_STATUS","token":"123"} JSON
|
||||
*/
|
||||
override fun sendOtaPadMsgQuery(queryStr: String): Boolean {
|
||||
return AdasManager.getInstance().sendOtaPadMsgQuery(queryStr) > -1
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工接管时获取前方和后方摄像头数据
|
||||
* 一次请求域控回调次两次摄像头数据 根据{@link MessagePad.CaptureImgOnTakeOver#getUuid()}进行区分是否是哪次请求
|
||||
|
||||
@@ -622,6 +622,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
timestamp: Long,
|
||||
status: SsmInfo.PureStr?
|
||||
) {
|
||||
if(status != null){
|
||||
CallerOTAManager.invokeOtaPureStr(token,timestamp,status)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,4 +28,23 @@ object OTAUpgradeConfig {
|
||||
//已经提示过升级成功的列表
|
||||
@JvmField
|
||||
var upgradeFinish: ArrayList<String> = ArrayList()
|
||||
|
||||
|
||||
|
||||
var token: String = ""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -394,6 +394,65 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* OTA 2.0 新接口
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param status OTA 2.0 数据
|
||||
*/
|
||||
override fun onOtaPureStr(token: Long, timestamp: Long, status: SsmInfo.PureStr) {
|
||||
super.onOtaPureStr(token, timestamp, status)
|
||||
Log.i(TAG, "onOtaPureStr token=$token")
|
||||
Log.i(TAG, "onOtaPureStr timestamp=$timestamp")
|
||||
Log.i(TAG, "onOtaPureStr status=$status")
|
||||
Log.i(TAG, "onOtaPureStr status.data=${status.data}")
|
||||
val jsonObject = JSONObject(status.data)
|
||||
val cmd = jsonObject.optString("cmd")
|
||||
val otaToken = jsonObject.optString("token")
|
||||
val otaStatus = jsonObject.optString("status")
|
||||
val upgradeReason = jsonObject.optString("upgrade_reason")
|
||||
val isDelay = jsonObject.optBoolean("is_delay")
|
||||
val isCancel = jsonObject.optBoolean("is_cancel")
|
||||
|
||||
Log.i(TAG, "cmd=$cmd")
|
||||
Log.i(TAG, "otaToken=$otaToken")
|
||||
Log.i(TAG, "otaStatus=$otaStatus")
|
||||
Log.i(TAG, "upgradeReason=$upgradeReason")
|
||||
Log.i(TAG, "isDelay=$isDelay")
|
||||
Log.i(TAG, "isCancel=$isCancel")
|
||||
|
||||
val products = jsonObject.optString("products")
|
||||
val productsArray = JSONArray(products)
|
||||
if(productsArray.length() > 0){
|
||||
for(index in 0 until productsArray.length()){
|
||||
val productInfo = productsArray[index] as JSONObject
|
||||
val productStatus = productInfo.optString("status")
|
||||
val failReason = productInfo.optString("fail_reason")
|
||||
val speed = productInfo.optDouble("speed")
|
||||
val leftTime = productInfo.optInt("left_time")
|
||||
val name = productInfo.optString("name")
|
||||
val curSize = productInfo.optInt("cur_size")
|
||||
val totalSize = productInfo.optInt("total_size")
|
||||
|
||||
Log.i(TAG, "productStatus=$productStatus")
|
||||
Log.i(TAG, "failReason=$failReason")
|
||||
Log.i(TAG, "speed=$speed")
|
||||
Log.i(TAG, "leftTime=$leftTime")
|
||||
Log.i(TAG, "name=$name")
|
||||
Log.i(TAG, "curSize=$curSize")
|
||||
Log.i(TAG, "totalSize=$totalSize")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(otaToken.isNotEmpty()){
|
||||
CallerHmiManager.showOTAUpgradeDialog(true,upgradeReason)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private val pattern = Pattern.compile("\\d+\\.\\d+\\.\\d+")
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,14 +154,24 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
"${SceneConstant.M_HMI}${TAG}",
|
||||
"ad version view clicked"
|
||||
)
|
||||
if(OTAUpgradeConfig.supportOTA){
|
||||
//查询OTA状态
|
||||
OTAUpgradeConfig.isQuery = true
|
||||
OTAUpgradeConfig.promptedUpgrade.remove(OTAUpgradeConfig.otaToken)
|
||||
CallerAutoPilotControlManager.sendSsmFuncOtaStatusQuery(OTAUpgradeConfig.otaToken)
|
||||
}else{
|
||||
ToastUtils.showLong("当前SSM节点未成功启动或当前版本不支持OTA升级")
|
||||
}
|
||||
// if(OTAUpgradeConfig.supportOTA){
|
||||
// //查询OTA状态
|
||||
// OTAUpgradeConfig.isQuery = true
|
||||
// OTAUpgradeConfig.promptedUpgrade.remove(OTAUpgradeConfig.otaToken)
|
||||
// CallerAutoPilotControlManager.sendSsmFuncOtaStatusQuery(OTAUpgradeConfig.otaToken)
|
||||
// }else{
|
||||
// ToastUtils.showLong("当前SSM节点未成功启动或当前版本不支持OTA升级")
|
||||
// }
|
||||
|
||||
|
||||
//查询OTA升级
|
||||
val query: JSONObject = JSONObject()
|
||||
query.put("cmd","PAD_QUERY_UPGRADE_STATUS")
|
||||
query.put("token",OTAUpgradeConfig.token)
|
||||
Log.i("xuxinchao",query.toString())
|
||||
CallerAutoPilotControlManager.sendOtaPadMsgQuery(query.toString())
|
||||
|
||||
|
||||
}
|
||||
tvHDMapVersion.text = tvHDMapVersion.text.toString() + DebugConfig.getMapVersion()
|
||||
//高精地图 检查更新
|
||||
|
||||
Reference in New Issue
Block a user