Merge remote-tracking branch 'origin/master'
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -26,6 +26,7 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -63,12 +63,12 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
|
||||
new IMogoCloudSocketOnMessageListener<CommandModel>() {
|
||||
|
||||
@Override
|
||||
public Class<CommandModel> target() {
|
||||
public Class<CommandModel> target(int msgType) {
|
||||
return CommandModel.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(CommandModel obj) {
|
||||
public void onMsgReceived(int msgType, CommandModel obj) {
|
||||
Logger.i(TAG, "onMsgReceived: obj=" + obj + " systemClock :" + SystemClock.elapsedRealtime() + " SystemTime : " + System.currentTimeMillis());
|
||||
livePushHandler(obj.getType(), obj.getVideoChannel());
|
||||
}
|
||||
|
||||
@@ -7,13 +7,15 @@ public interface IMogoCloudSocketOnMessageListener<T> {
|
||||
|
||||
/**
|
||||
* 获取解析实例对象
|
||||
* @param msgType 消息类型
|
||||
* @return class
|
||||
*/
|
||||
Class<T> target();
|
||||
Class<T> target(int msgType);
|
||||
|
||||
/**
|
||||
* 消息接收回调
|
||||
* @param msgType 消息类型
|
||||
* @param obj T 业务bean数据
|
||||
*/
|
||||
void onMsgReceived(T obj);
|
||||
void onMsgReceived(int msgType, T obj);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import android.support.annotation.NonNull;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.mogo.cloud.GsonUtil;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.GsonUtil;
|
||||
import com.mogo.cloud.utils.logger.Logger;
|
||||
import com.zhidao.locupload.Platform;
|
||||
import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon;
|
||||
@@ -83,7 +83,6 @@ public class SocketManager implements IMogoCloudSocketManager, Callback {
|
||||
.setClient(Platform.getClient(Platform.car))
|
||||
.setChannelId(SocketServicesConstants.SOCKET_CHANNEL_ID)
|
||||
.setOpenAnalytics(true)
|
||||
// TODO 这里先用设备ID,原因是因为后台分配的SN与蘑菇自研车机SN不符合导致在线及推送有问题
|
||||
.setSn(cloudClientConfig.getThirdPartyDeviceId())
|
||||
.setToken(cloudClientConfig.getToken())
|
||||
.setAuthPubKey(cloudClientConfig.getAuthPubKey())
|
||||
@@ -144,11 +143,11 @@ public class SocketManager implements IMogoCloudSocketManager, Callback {
|
||||
while (iterator.hasNext()) {
|
||||
IMogoCloudSocketOnMessageListener listener = iterator.next();
|
||||
if (object == null) {
|
||||
object = GsonUtil.objectFromJson(payload.getPayload().toStringUtf8(), listener.target());
|
||||
object = GsonUtil.objectFromJson(payload.getPayload().toStringUtf8(), listener.target(msgType));
|
||||
}
|
||||
if (listener != null) {
|
||||
Logger.d(TAG, "received msgId = %s, content = %s", msgId, payload.getPayload().toStringUtf8());
|
||||
listener.onMsgReceived(object);
|
||||
listener.onMsgReceived(msgType, object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,20 +30,20 @@ PASSWORD=xintai2018
|
||||
RELEASE=true
|
||||
# AI CLOUD 云平台
|
||||
# 工具类
|
||||
MOGO_UTILS_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_UTILS_VERSION=1.0.32-SNAPSHOT
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_NETWORK_VERSION=1.0.32-SNAPSHOT
|
||||
# 网络DNS
|
||||
MOGO_HTTPDNS_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_HTTPDNS_VERSION=1.0.32-SNAPSHOT
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_PASSPORT_VERSION=1.0.32-SNAPSHOT
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_SOCKET_VERSION=1.0.32-SNAPSHOT
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_REALTIME_VERSION=1.0.32-SNAPSHOT
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_TANLU_VERSION=1.0.32-SNAPSHOT
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_LIVE_VERSION=1.0.32-SNAPSHOT
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.28-SNAPSHOT
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.32-SNAPSHOT
|
||||
|
||||
@@ -32,6 +32,7 @@ public class CloudRoadData implements Parcelable {
|
||||
private double heading;
|
||||
|
||||
private long systemTime;
|
||||
private long satelliteTime;
|
||||
|
||||
/**
|
||||
* 红绿灯状态 1红 2绿 3黄
|
||||
@@ -166,6 +167,14 @@ public class CloudRoadData implements Parcelable {
|
||||
this.fromType = fromType;
|
||||
}
|
||||
|
||||
public long getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
}
|
||||
|
||||
public void setSatelliteTime( long satelliteTime ) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
public CloudRoadData() {
|
||||
}
|
||||
|
||||
@@ -185,6 +194,7 @@ public class CloudRoadData implements Parcelable {
|
||||
dest.writeDouble( this.speed );
|
||||
dest.writeDouble( this.heading );
|
||||
dest.writeLong( this.systemTime );
|
||||
dest.writeLong( this.satelliteTime );
|
||||
dest.writeInt( this.lightStatus );
|
||||
dest.writeInt( this.lightLeftTime );
|
||||
dest.writeString( this.rtmpUrl );
|
||||
@@ -202,6 +212,7 @@ public class CloudRoadData implements Parcelable {
|
||||
this.speed = in.readDouble();
|
||||
this.heading = in.readDouble();
|
||||
this.systemTime = in.readLong();
|
||||
this.satelliteTime = in.readLong();
|
||||
this.lightStatus = in.readInt();
|
||||
this.lightLeftTime = in.readInt();
|
||||
this.rtmpUrl = in.readString();
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.mogo.realtime.socket;
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.mogo.cloud.GsonUtil;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener;
|
||||
import com.mogo.cloud.socket.MsgBody;
|
||||
import com.mogo.cloud.socket.SocketManager;
|
||||
import com.mogo.cloud.socket.WebSocketData;
|
||||
import com.mogo.cloud.utils.logger.Logger;
|
||||
import com.mogo.realtime.core.SimpleLocationCorrectStrategy;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
@@ -16,8 +18,6 @@ import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.entity.OnePerSecondSendContent;
|
||||
import com.mogo.realtime.spi.RealTimeProviderImp;
|
||||
import com.mogo.realtime.util.MortonCode;
|
||||
import com.mogo.cloud.GsonUtil;
|
||||
import com.mogo.cloud.utils.logger.Logger;
|
||||
import com.zhidao.ptech.connsvr.protocol.MogoConnsvr;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -89,13 +89,12 @@ public class SocketHandler {
|
||||
|
||||
private final IMogoCloudSocketOnMessageListener<WebSocketData> onMessageListener = new IMogoCloudSocketOnMessageListener<WebSocketData>() {
|
||||
@Override
|
||||
public Class<WebSocketData> target() {
|
||||
public Class<WebSocketData> target(int msgType) {
|
||||
return WebSocketData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(WebSocketData webSocketData) {
|
||||
int msgType = webSocketData.getMsgType();
|
||||
public void onMsgReceived(int msgType, WebSocketData webSocketData) {
|
||||
if (msgType == MSG_TYPE_ACK.getMsgType()) {
|
||||
if (webSocketData.getUtcTime() > 0) {
|
||||
serverTime = webSocketData.getUtcTime();
|
||||
|
||||
Reference in New Issue
Block a user