[690][adas]域控OTA功能收发接口
This commit is contained in:
@@ -425,6 +425,61 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
override fun onWarn(header: MessagePad.Header, warn: MessagePad.Warn?) {
|
||||
}
|
||||
|
||||
/**
|
||||
* SSM发送OTA升级提示请求
|
||||
*
|
||||
* @param header 头
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param request 数据 null表示 PadSsmMsg中的消息体为null
|
||||
*/
|
||||
override fun onOtaDownloadRequest(
|
||||
header: MessagePad.Header?,
|
||||
token: Long,
|
||||
timestamp: Long,
|
||||
request: SsmInfo.OtaDownloadRequest?
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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?
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* SSM上报OTA状态和查询OTA状态
|
||||
* 冷启动状态变更上报以及查询状态
|
||||
* 如果是查询到的结果,{@link SsmInfo.OtaStatus#getOtaInfo()}中的{@link SsmInfo.OtaDownloadRequest#getOtaToken()}==""表示不存在升级任务
|
||||
*
|
||||
* @param header 头
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param isQuery 是否是查询 ture:查询响应的结果 false:表示状态变动域控主动推送
|
||||
* @param status 数据 null表示 PadSsmMsg中的消息体为null
|
||||
*/
|
||||
override fun onOtaStatus(
|
||||
header: MessagePad.Header?,
|
||||
token: Long,
|
||||
timestamp: Long,
|
||||
isQuery: Boolean,
|
||||
status: SsmInfo.OtaStatus?
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 冷启动状态变更上报以及查询状态
|
||||
*
|
||||
|
||||
@@ -2970,6 +2970,44 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendPBMessage(messageType, req.toByteArray(), messageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* SSM发送OTA升级提示请求响应
|
||||
*
|
||||
* @param token 域控发送OTA升级请求中的Token {@link SsmInfo.OtaDownloadRequest#getOtaToken()}
|
||||
* @param ifUpgrade {@link SsmInfo.IfUpgrade#IMMEDIATELY}:立即
|
||||
* {@link SsmInfo.IfUpgrade#DELAY}:推迟
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendSsmFuncOtaDownloadResponse(@NonNull String token, @NonNull SsmInfo.IfUpgrade ifUpgrade) {
|
||||
SsmInfo.OtaDownloadResponse.Builder builder = SsmInfo.OtaDownloadResponse.newBuilder();
|
||||
if (!TextUtils.isEmpty(token)) {
|
||||
builder.setToken(token);
|
||||
}
|
||||
builder.setIfUpgrade(ifUpgrade);
|
||||
return sendSsmFuncMsg(false, system_master.SsmInfo.MessageType.OTA_DOWNLOAD_RESPONSE, builder.build().toByteString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询OTA状态
|
||||
*
|
||||
* @param token 域控发送OTA升级请求中的Token {@link SsmInfo.OtaDownloadRequest#getOtaToken()}
|
||||
* 如果没有可以传null或""
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendSsmFuncOtaStatusQuery(@Nullable String token) {
|
||||
SsmInfo.OtaToken.Builder builder = SsmInfo.OtaToken.newBuilder();
|
||||
builder.setToken(TextUtils.isEmpty(token) ? String.valueOf(System.currentTimeMillis()) : token);
|
||||
return sendSsmFuncMsg(true, system_master.SsmInfo.MessageType.OTA_STATUS_QUERY, builder.build().toByteString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询冷启动状态
|
||||
*
|
||||
|
||||
@@ -42,6 +42,7 @@ import chassis.Chassis;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.yycp.paralleldriving.protocol.ParallelDrivingRequest;
|
||||
import system_master.SsmInfo;
|
||||
|
||||
/**
|
||||
* @ProjectName: lib-adas-fpga
|
||||
@@ -1782,6 +1783,37 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel == null ? -1L : mChannel.sendPowerUnitReset();
|
||||
}
|
||||
|
||||
/**
|
||||
* SSM发送OTA升级提示请求响应
|
||||
*
|
||||
* @param token 域控发送OTA升级请求中的Token {@link SsmInfo.OtaDownloadRequest#getOtaToken()}
|
||||
* @param ifUpgrade {@link SsmInfo.IfUpgrade#IMMEDIATELY}:立即
|
||||
* {@link SsmInfo.IfUpgrade#DELAY}:推迟
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendSsmFuncOtaDownloadResponse(@NonNull String token, @NonNull SsmInfo.IfUpgrade ifUpgrade) {
|
||||
return mChannel == null ? -1L : mChannel.sendSsmFuncOtaDownloadResponse(token, ifUpgrade);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询OTA状态
|
||||
*
|
||||
* @param token 域控发送OTA升级请求中的Token {@link SsmInfo.OtaDownloadRequest#getOtaToken()}
|
||||
* 如果没有可以传null或""
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendSsmFuncOtaStatusQuery(@Nullable String token) {
|
||||
return mChannel == null ? -1L : mChannel.sendSsmFuncOtaStatusQuery(token);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询冷启动状态
|
||||
*
|
||||
|
||||
@@ -26,6 +26,7 @@ import bag_manager.BagManagerOuterClass;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.yycp.paralleldriving.protocol.ParallelDrivingRequest;
|
||||
import system_master.SsmInfo;
|
||||
|
||||
/**
|
||||
* @author nie yunlong
|
||||
@@ -1286,6 +1287,31 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
long sendPowerUnitReset();
|
||||
|
||||
/**
|
||||
* SSM发送OTA升级提示请求响应
|
||||
*
|
||||
* @param token 域控发送OTA升级请求中的Token {@link SsmInfo.OtaDownloadRequest#getOtaToken()}
|
||||
* @param ifUpgrade {@link SsmInfo.IfUpgrade#IMMEDIATELY}:立即
|
||||
* {@link SsmInfo.IfUpgrade#DELAY}:推迟
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
long sendSsmFuncOtaDownloadResponse(@NonNull String token, @NonNull SsmInfo.IfUpgrade ifUpgrade);
|
||||
|
||||
/**
|
||||
* 查询OTA状态
|
||||
*
|
||||
* @param token 域控发送OTA升级请求中的Token {@link SsmInfo.OtaDownloadRequest#getOtaToken()}
|
||||
* 如果没有可以传null或""
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
long sendSsmFuncOtaStatusQuery(@Nullable String token);
|
||||
|
||||
/**
|
||||
* 查询冷启动状态
|
||||
*
|
||||
|
||||
@@ -207,13 +207,47 @@ public interface OnAdasListener {
|
||||
@Deprecated
|
||||
void onWarn(MessagePad.Header header, MessagePad.Warn warn);
|
||||
|
||||
/**
|
||||
* SSM发送OTA升级提示请求
|
||||
*
|
||||
* @param header 头
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param request 数据 null表示 PadSsmMsg中的消息体为null
|
||||
*/
|
||||
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状态和查询OTA状态
|
||||
* 冷启动状态变更上报以及查询状态
|
||||
* 如果是查询到的结果,{@link SsmInfo.OtaStatus#getOtaInfo()}中的{@link SsmInfo.OtaDownloadRequest#getOtaToken()}==""表示不存在升级任务
|
||||
*
|
||||
* @param header 头
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param isQuery 是否是查询 ture:查询响应的结果 false:表示状态变动域控主动推送
|
||||
* @param status 数据 null表示 PadSsmMsg中的消息体为null
|
||||
*/
|
||||
void onOtaStatus(MessagePad.Header header, long token, long timestamp, boolean isQuery, @Nullable SsmInfo.OtaStatus status);
|
||||
|
||||
/**
|
||||
* 冷启动状态变更上报以及查询状态
|
||||
*
|
||||
* @param header 头
|
||||
* @param token 唯一消息ID
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param isQuery 是否是查询 ture:查询相应的结果 false:表示状态变动域控主动推送
|
||||
* @param isQuery 是否是查询 ture:查询响应的结果 false:表示状态变动域控主动推送
|
||||
* @param coldStartState 数据 null表示 PadSsmMsg中的消息体为null
|
||||
*/
|
||||
void onColdStartState(MessagePad.Header header, long token, long timestamp, boolean isQuery, @Nullable SsmInfo.ColdStartState coldStartState);
|
||||
@@ -223,7 +257,7 @@ public interface OnAdasListener {
|
||||
* 返回 是否首次进自驾、订单号、次数
|
||||
*
|
||||
* @param header 头
|
||||
* @param token 唯一消息ID
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param autoPilotInfo 数据 null表示 PadSsmMsg中的消息体为null
|
||||
*/
|
||||
@@ -233,7 +267,7 @@ public interface OnAdasListener {
|
||||
* 到站信息查询响应
|
||||
*
|
||||
* @param header 头
|
||||
* @param token 唯一消息ID
|
||||
* @param token PadSsmMsg唯一消息ID
|
||||
* @param timestamp 消息发送时间 单位:毫秒
|
||||
* @param autoPilotStation 数据 null表示 PadSsmMsg中的消息体为null
|
||||
*/
|
||||
|
||||
@@ -53,6 +53,33 @@ public class PadSsmFuncMsgMessage extends MyAbstractMessageHandler {
|
||||
if (adasListener != null) {
|
||||
adasListener.onAutoPilotStation(raw.getHeader(), padSsmMsg.getToken(), timestamp, autoPilotStation);
|
||||
}
|
||||
} else if (type == SsmInfo.MessageType.OTA_DOWNLOAD_REQUEST) {
|
||||
//SSM发送OTA升级提示请求
|
||||
SsmInfo.OtaDownloadRequest request = null;
|
||||
if (!data.isEmpty()) {
|
||||
request = SsmInfo.OtaDownloadRequest.parseFrom(data);
|
||||
}
|
||||
if (adasListener != null) {
|
||||
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);
|
||||
}
|
||||
} else if (type == SsmInfo.MessageType.OTA_STATUS || type == SsmInfo.MessageType.OTA_STATUS_QUERY) {
|
||||
//SSM上报OTA状态和查询OTA状态
|
||||
SsmInfo.OtaStatus status = null;
|
||||
if (!data.isEmpty()) {
|
||||
status = SsmInfo.OtaStatus.parseFrom(data);
|
||||
}
|
||||
if (adasListener != null) {
|
||||
adasListener.onOtaStatus(raw.getHeader(), padSsmMsg.getToken(), timestamp, type == SsmInfo.MessageType.OTA_STATUS_QUERY, status);
|
||||
}
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("SSM功能", nowTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user