[690][adas]OTA升级功能接口修改

This commit is contained in:
xinfengkun
2024-12-02 15:16:19 +08:00
parent fdf1e4c0c4
commit e342a8d735
7 changed files with 84 additions and 65 deletions

View File

@@ -446,24 +446,24 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
/**
* SSM上报OTA下载进度, 开始升级后定频上报
*
* @param header 头
* @param token PadSsmMsg唯一消息ID
* @param timestamp 消息发送时间 单位:毫秒
* @param progress 数据 null表示 PadSsmMsg中的消息体为null
*/
override fun onOtaLoadingProgress(
header: MessagePad.Header?,
token: Long,
timestamp: Long,
progress: SsmInfo.OtaLoadingProgess?
) {
if(progress != null){
CallerOTAManager.invokeOtaLoadingProgress(progress)
}
}
// /**
// * SSM上报OTA下载进度, 开始升级后定频上报
// *
// * @param header 头
// * @param token PadSsmMsg唯一消息ID
// * @param timestamp 消息发送时间 单位:毫秒
// * @param progress 数据 null表示 PadSsmMsg中的消息体为null
// */
// override fun onOtaLoadingProgress(
// header: MessagePad.Header?,
// token: Long,
// timestamp: Long,
// progress: SsmInfo.OtaLoadingProgess?
// ) {
// if(progress != null){
// CallerOTAManager.invokeOtaLoadingProgress(progress)
// }
// }
/**
* SSM上报OTA状态和查询OTA状态

View File

@@ -56,15 +56,6 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
}
/**
* SSM上报OTA下载进度, 开始升级后定频上报
* @param progress 下载进度
*/
override fun onOtaLoadingProgress(progress: SsmInfo.OtaLoadingProgess) {
super.onOtaLoadingProgress(progress)
}
/**
* SSM上报OTA状态和查询OTA状态

View File

@@ -13,11 +13,11 @@ interface IOTAListener {
*/
fun onOtaDownloadRequest(request: SsmInfo.OtaDownloadRequest){}
/**
* SSM上报OTA下载进度, 开始升级后定频上报
* @param progress 下载进度
*/
fun onOtaLoadingProgress(progress: SsmInfo.OtaLoadingProgess){}
// /**
// * SSM上报OTA下载进度, 开始升级后定频上报
// * @param progress 下载进度
// */
// fun onOtaLoadingProgress(progress: SsmInfo.OtaLoadingProgess){}
/**
* SSM上报OTA状态和查询OTA状态

View File

@@ -20,16 +20,16 @@ object CallerOTAManager: CallerBase<IOTAListener>() {
}
}
/**
* SSM上报OTA下载进度, 开始升级后定频上报
* @param progress 下载进度
*/
fun invokeOtaLoadingProgress(progress: SsmInfo.OtaLoadingProgess){
M_LISTENERS.forEach {
val listener = it.value
listener.onOtaLoadingProgress(progress)
}
}
// /**
// * SSM上报OTA下载进度, 开始升级后定频上报
// * @param progress 下载进度
// */
// fun invokeOtaLoadingProgress(progress: SsmInfo.OtaLoadingProgess){
// M_LISTENERS.forEach {
// val listener = it.value
// listener.onOtaLoadingProgress(progress)
// }
// }
/**
* SSM上报OTA状态和查询OTA状态

View File

@@ -58,7 +58,7 @@ enum MessageType {
NOTIFICATION = 0; // ssm发送通知 msg:Notification
OTA_DOWNLOAD_REQUEST = 1; // ssm发送OTA升级提示请求 todo
OTA_DOWNLOAD_RESPONSE = 2; // pad下发OTA升级提示响应 todo
OTA_LOADING_PROGRESS = 3; // ssm上报OTA下载进度, 开始升级后定频上报 todo
OTA_LOADING_PROGRESS = 3; // ssm上报OTA下载进度, 开始升级后定频上报 todo 废弃 使用OTA_STATUS 定频推送的进度来为下载时是0.1Hz下载时是1Hz此接口无法表示多任务所以废弃
OTA_STATUS = 4; // ssm 上报OTA状态 todo
OTA_STATUS_QUERY = 5; // pad查询OTA状态 req:OtaToken resp:OtaStatus
COLD_START_STATUS_REPORT = 6; // 冷启动状态上报 msg:ColdStartState
@@ -91,13 +91,41 @@ enum OtaType {
MAP = 3;
PROFILE = 4;
}
//product_name中的数据
//[{
// "token": "12,34,56",
// "status": 0,// 与 UpgradeStatus 中的值相同
// "fail_reason": "",
// "upgrade_reason": "",
// "task_id": 0,
// "task_item_id": 0,
// "ota_type": 1,
// "product_name": "",
// "need_restart": false,
// "is_delay": false,
// "cur_size": 0,
// "total_size": 0
//}, {
// "token": "34,56,78",
// "status": 0,
// "fail_reason": "",
// "upgrade_reason": "",
// "task_id": 0,
// "task_item_id": 0,
// "ota_type": 1,
// "product_name": "",
// "need_restart": false,
// "is_delay": false,
// "cur_size": 0,
// "total_size": 0
//}]
message OtaDownloadRequest {
required string ota_token = 1; // ota token 唯一标识
required OtaType ota_type = 2; // ota type 1:镜像, 2:固件, 3:地图, 4:配置文件
required bool need_restart = 3; // 是否需要重启 True:需要, False:不需要
required OtaType ota_type = 2; // ota type 1:镜像, 2:固件, 3:地图, 4:配置文件 todo 废弃使用product_name json中的 ota_type
required bool need_restart = 3; // 是否需要重启 True:需要, False:不需要 todo 废弃使用product_name json中的 need_restart
required string product_name = 4; // 制品名称
optional double size = 5; // 文件大小 Mb
optional double size = 5; // 文件大小 Mb todo 废弃使用product_name json中的 cur_size total_size
}
enum IfUpgrade {
@@ -130,8 +158,8 @@ enum UpgradeStatus {
message OtaStatus {
required OtaDownloadRequest ota_info = 1; // 升级信息
required UpgradeStatus status = 2; // 状态 0:默认(未开始), 1:下载中, 2:下载完成, 3:升级完成, 4:升级失败
optional string reason = 3; // 失败原因
required UpgradeStatus status = 2; // 状态 0:默认(未开始), 1:下载中, 2:下载完成, 3:升级完成, 4:升级失败 todo 废弃使用product_name json中的 status
optional string reason = 3; // 失败原因 todo 废弃 todo 废弃使用product_name json中的 fail_reason
}
enum CSState {

View File

@@ -217,15 +217,15 @@ public interface OnAdasListener {
*/
void onOtaDownloadRequest(MessagePad.Header header, long token, long timestamp, @Nullable SsmInfo.OtaDownloadRequest request);
/**
* SSM上报OTA下载进度, 开始升级后定频上报
*
* @param header 头
* @param token PadSsmMsg唯一消息ID
* @param timestamp 消息发送时间 单位:毫秒
* @param progress 数据 null表示 PadSsmMsg中的消息体为null
*/
void onOtaLoadingProgress(MessagePad.Header header, long token, long timestamp, @Nullable SsmInfo.OtaLoadingProgess progress);
// /**
// * SSM上报OTA下载进度, 开始升级后定频上报
// *
// * @param header 头
// * @param token PadSsmMsg唯一消息ID
// * @param timestamp 消息发送时间 单位:毫秒
// * @param progress 数据 null表示 PadSsmMsg中的消息体为null
// */
// void onOtaLoadingProgress(MessagePad.Header header, long token, long timestamp, @Nullable SsmInfo.OtaLoadingProgess progress);
/**

View File

@@ -63,14 +63,14 @@ public class PadSsmFuncMsgMessage extends MyAbstractMessageHandler {
adasListener.onOtaDownloadRequest(raw.getHeader(), padSsmMsg.getToken(), timestamp, request);
}
} else if (type == SsmInfo.MessageType.OTA_LOADING_PROGRESS) {
//SSM上报OTA下载进度, 开始升级后定频上报
SsmInfo.OtaLoadingProgess progress = null;
if (!data.isEmpty()) {
progress = SsmInfo.OtaLoadingProgess.parseFrom(data);
}
if (adasListener != null) {
adasListener.onOtaLoadingProgress(raw.getHeader(), padSsmMsg.getToken(), timestamp, progress);
}
// //SSM上报OTA下载进度, 开始升级后定频上报
// SsmInfo.OtaLoadingProgess progress = null;
// if (!data.isEmpty()) {
// progress = SsmInfo.OtaLoadingProgess.parseFrom(data);
// }
// if (adasListener != null) {
// adasListener.onOtaLoadingProgress(raw.getHeader(), padSsmMsg.getToken(), timestamp, progress);
// }
} else if (type == SsmInfo.MessageType.OTA_STATUS || type == SsmInfo.MessageType.OTA_STATUS_QUERY) {
//SSM上报OTA状态和查询OTA状态
SsmInfo.OtaStatus status = null;