[8.0.0][adas] 域控摄像头上传NDE云开关命令以及状态查询
This commit is contained in:
@@ -1478,6 +1478,12 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
CallerCloudConfigListenerManager.invokeCloudConfig(config)
|
||||
}
|
||||
|
||||
override fun onImgUploadCloudStatusResp(
|
||||
header: MessagePad.Header,
|
||||
resp: MessagePad.ImgUploadCloudStatusResp
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶
|
||||
* 使用方法查看:app_ipc_monitoring/uiMainActivity/onAutopilotAbility
|
||||
|
||||
@@ -101,6 +101,9 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_COPY_BAG(MessagePad.MessageType.MsgTypeCopyBag, "数据落盘响应"),
|
||||
TYPE_SEND_CLOUD_CONFIG(MessagePad.MessageType.MsgTypeCloudConfig, "云端配置查询"),
|
||||
TYPE_RECEIVE_CLOUD_CONFIG(MessagePad.MessageType.MsgTypeCloudConfig, "云端配置响应"),
|
||||
TYPE_SEND_IMG_UPLOAD_CLOUD_ENABLE(MessagePad.MessageType.MsgTypeImgUploadCloudEnable, "摄像头上传NDE云开关"),
|
||||
TYPE_SEND_IMG_UPLOAD_CLOUD_STATUS_QUERY(MessagePad.MessageType.MsgTypeImgUploadCloudStatusQuery, "摄像头上传NDE云状态查询"),
|
||||
TYPE_RECEIVE_IMG_UPLOAD_CLOUD_STATUS_QUERY(MessagePad.MessageType.MsgTypeImgUploadCloudStatusQuery, "摄像头上传NDE云状态响应"),
|
||||
|
||||
//TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态"),
|
||||
|
||||
@@ -105,6 +105,8 @@ enum MessageType
|
||||
MsgTypeEzhouCloud = 0x10133;//NED pad通信(不仅限于鄂州) bus ros1 MAP500版本支持, bus ros2 MAP480版本支持,taxi 还没有上
|
||||
MsgTypeCopyBag = 0x10134;//数据落盘(上下行)
|
||||
MsgTypeCloudConfig = 0x10135;//云端配置查询和返回(上下行)
|
||||
MsgTypeImgUploadCloudEnable = 0x10136;//摄像头上传NDE云开关
|
||||
MsgTypeImgUploadCloudStatusQuery = 0x10137;//查询摄像头上传NDE云状态
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -1004,4 +1006,15 @@ message CloudLinkAddr
|
||||
message CloudConfig
|
||||
{
|
||||
repeated CloudLinkAddr addrs = 1;
|
||||
}
|
||||
|
||||
//message definition for MsgTypeImgUploadCloudEnable
|
||||
//发送摄像头上传NDE云开关命令:
|
||||
message ImgUploadCloudCmd {
|
||||
bool enable = 1; //false: 关闭, true: 打开
|
||||
}
|
||||
//message definition for MsgTypeImgUploadCloudStatusQuery
|
||||
//查询摄像头上传NDE云状态返回
|
||||
message ImgUploadCloudStatusResp {
|
||||
bool enable = 1; //false: 关闭, true: 打开
|
||||
}
|
||||
@@ -3187,5 +3187,35 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
public long sendCloudConfigRequest() {
|
||||
return sendPBMessage(MessageType.TYPE_SEND_CLOUD_CONFIG, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控摄像头上传NDE云开关命令
|
||||
*
|
||||
* @param enable false: 关闭, true: 打开
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendImgUploadCloudEnable(boolean enable) {
|
||||
MessagePad.ImgUploadCloudCmd.Builder builder = MessagePad.ImgUploadCloudCmd
|
||||
.newBuilder()
|
||||
.setEnable(enable);
|
||||
return sendPBMessage(MessageType.TYPE_SEND_IMG_UPLOAD_CLOUD_ENABLE, builder.build().toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询域控摄像头上传NDE云开关状态查询
|
||||
*
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendImgUploadCloudStatusQuery() {
|
||||
return sendPBMessage(MessageType.TYPE_SEND_IMG_UPLOAD_CLOUD_STATUS_QUERY, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1940,6 +1940,33 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel == null ? -1L : mChannel.sendCloudConfigRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控摄像头上传NDE云开关命令
|
||||
*
|
||||
* @param enable false: 关闭, true: 打开
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendImgUploadCloudEnable(boolean enable) {
|
||||
return mChannel == null ? -1L : mChannel.sendImgUploadCloudEnable(enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询域控摄像头上传NDE云开关状态查询
|
||||
*
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendImgUploadCloudStatusQuery() {
|
||||
return mChannel == null ? -1L : mChannel.sendImgUploadCloudStatusQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询节点状态
|
||||
*
|
||||
|
||||
@@ -1413,6 +1413,27 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
long sendCloudConfigRequest();
|
||||
|
||||
/**
|
||||
* 域控摄像头上传NDE云开关命令
|
||||
*
|
||||
* @param enable false: 关闭, true: 打开
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
long sendImgUploadCloudEnable(boolean enable);
|
||||
|
||||
/**
|
||||
* 查询域控摄像头上传NDE云开关状态查询
|
||||
*
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
long sendImgUploadCloudStatusQuery();
|
||||
|
||||
// TODO 需求暂停 待讨论
|
||||
// boolean getRoutes();
|
||||
|
||||
|
||||
@@ -664,6 +664,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onCloudConfig(@NonNull MessagePad.Header header, @NonNull MessagePad.CloudConfig config);
|
||||
|
||||
/**
|
||||
* 摄像头上传NDE云状态响应
|
||||
*
|
||||
* @param header 头
|
||||
* @param resp 数据
|
||||
*/
|
||||
void onImgUploadCloudStatusResp(@NonNull MessagePad.Header header, @NonNull MessagePad.ImgUploadCloudStatusResp resp);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 摄像头上传NDE云状态响应
|
||||
*/
|
||||
public class ImgUploadCloudStatusRespMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
MessagePad.ImgUploadCloudStatusResp resp = MessagePad.ImgUploadCloudStatusResp.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("摄像头上传NDE云状态响应", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onImgUploadCloudStatusResp(raw.getHeader(), resp);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("摄像头上传NDE云状态响应", nowTime);
|
||||
// CupidLogUtils.e("到站提醒--->" + arrivalNotification.toString());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,6 +58,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg captureImgOnTakeOverMessage;//接管时前方和后方摄像头数据请求的响应
|
||||
private IMsg copyBagMessage;//数据落盘
|
||||
private IMsg cloudConfigMessage;//云端配置
|
||||
private IMsg imgUploadCloudStatusRespMessage;//摄像头上传NDE云状态响应
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
private final TurnLightState lightLeft = new TurnLightState();
|
||||
@@ -338,6 +339,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
cloudConfigMessage = new CloudConfigMessage();
|
||||
}
|
||||
return cloudConfigMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_IMG_UPLOAD_CLOUD_STATUS_QUERY.typeCode) {
|
||||
//摄像头上传NDE云状态响应
|
||||
if (imgUploadCloudStatusRespMessage == null) {
|
||||
imgUploadCloudStatusRespMessage = new ImgUploadCloudStatusRespMessage();
|
||||
}
|
||||
return imgUploadCloudStatusRespMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user