增加当前车辆当前位置上报功能,还有点儿小问题

This commit is contained in:
董宏宇
2021-06-09 14:53:05 +08:00
parent 34ac5081aa
commit 7fb76d86c5
11 changed files with 10934 additions and 28 deletions

View File

@@ -55,7 +55,7 @@ public class MoGoApplication extends MultiDexApplication {
// TODO 这里使用的是测试的sn
clientConfig.setThirdPartyDeviceId("test-sn-abcd-1234");
// 设置应用服务AppId 长链、鉴权 //todo 需要卸载智慧驾驶、行车记录仪
clientConfig.setServiceAppId("com.mogo.test");
clientConfig.setServiceAppId("com.mogo.launcher");
// 设置循环检测间隔时间
clientConfig.setLoopCheckDelay(15 * 1000);
// 设置是否属于高精定位设备

View File

@@ -0,0 +1,59 @@
package com.mogo.cloud;
import com.elegant.spi.annotations.Service;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.realtime.api.IRealTimeProvider;
import com.mogo.realtime.entity.DataCollectMsgDataProto;
import com.mogo.realtime.entity.DataCollectWrapper;
import com.mogo.realtime.entity.SocketReceiveDataProto3;
import com.mogo.realtime.util.MortonCode;
import static com.mogo.cloud.socket.SocketMsgType.MSG_TYPE_UPLINK_CAR_DATA;
/**
* @author liujing
* @description 描述
* @since: 2021/1/26
*/
@Service(value = IRealTimeProvider.class)
class SPIRealTimeTestClass implements IRealTimeProvider {
@Override
public DataCollectWrapper.DataCollectMsg getLocationMsg() {
long mortonCode = MortonCode.encodeMorton(116.410871, 39.968309);
SocketReceiveDataProto3.LocationInfoProto locationInfoProto =
SocketReceiveDataProto3.LocationInfoProto.newBuilder()
.setLat(39.968309)
.setLon(116.410871)
.setHeading(120)
.setSystemTime(System.currentTimeMillis())
.setSatelliteTime(System.currentTimeMillis())
.setAlt(55)
.setDataAccuracy(1)
.setSpeed(30)
.setMortonCode(mortonCode)
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
.build();
SocketReceiveDataProto3.MyLocationReq myLocationReq = SocketReceiveDataProto3.MyLocationReq.newBuilder()
.setLastCoordinate(locationInfoProto)
.setDataAccuracy(1)
.setMortonCode(mortonCode)
.setFromType(1)
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
.build();
SocketReceiveDataProto3.OnePerSecondSendReqProto self = SocketReceiveDataProto3.OnePerSecondSendReqProto.newBuilder()
.setSelf(myLocationReq).build();
DataCollectMsgDataProto.DataCollectMsgData msgData = DataCollectMsgDataProto.DataCollectMsgData.newBuilder()
.setPayload(self.toByteString()).build();
return DataCollectWrapper.DataCollectMsg.newBuilder()
.setData(msgData.toByteString())
.setTimestamp(System.currentTimeMillis()).build();
}
}