[change]将超时检测数据更新移动到GNSS接口中
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user