[change]将超时检测数据更新移动到GNSS接口中

This commit is contained in:
xinfengkun
2022-05-12 19:06:57 +08:00
parent cd0266457b
commit da525cf7e8
3 changed files with 3 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class ReceiveTimeoutManager {
private static final String TAG = ReceiveTimeoutManager.class.getSimpleName();
private static volatile ReceiveTimeoutManager INSTANCE;
private static final long DEFAULT_TIMEOUT = 4 * 1000L;//默认超时时间
private static final long DEFAULT_TIMEOUT = 3 * 1000L;//默认超时时间
private final AtomicBoolean isEnable = new AtomicBoolean(true);//是否启用超时检测
private volatile long lastReceiveTime;
private OnTimeoutListener listener;

View File

@@ -3,7 +3,6 @@ package com.zhidao.support.adas.high.msg;
import com.google.gson.Gson;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
import mogo.telematics.pad.MessagePad;
@@ -18,7 +17,6 @@ public class AutopilotStateMessage extends MyAbstractMessageHandler {
@Override
public void handlerMsg(MessagePad.Header header, byte[] msg, OnAdasListener adasListener) throws InvalidProtocolBufferException {
ReceiveTimeoutManager.getInstance().refreshLast();
MessagePad.AutopilotState autopilotState = MessagePad.AutopilotState.parseFrom(msg);
if (adasListener != null) {
adasListener.onAutopilotState(header, autopilotState);

View File

@@ -3,6 +3,7 @@ package com.zhidao.support.adas.high.msg;
import com.google.gson.Gson;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
import mogo.telematics.pad.MessagePad;
@@ -17,6 +18,7 @@ public class GnssInfoMessage extends MyAbstractMessageHandler {
@Override
public void handlerMsg(MessagePad.Header header, byte[] msg, OnAdasListener adasListener) throws InvalidProtocolBufferException {
ReceiveTimeoutManager.getInstance().refreshLast();
MessagePad.GnssInfo trajectory = MessagePad.GnssInfo.parseFrom(msg);
if (adasListener != null) {
adasListener.onGnssInfo(header, trajectory);