obu数据自测

This commit is contained in:
tongchenfei
2020-09-22 17:46:39 +08:00
parent e4e01c1176
commit d811751442
6 changed files with 44 additions and 9 deletions

View File

@@ -128,7 +128,7 @@ public class MogoApplication extends AbsMogoApplication {
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
DebugConfig.setUseMockObuData(true);
DebugConfig.setUseMockObuData(false);
ObuConfig.useObuLocation = false;
DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );

View File

@@ -206,7 +206,7 @@ targetSdkVersion : 22,
skinsupportnoop : "com.mogo.skin:skin-support-noop:${MOGO_SKIN_SUPPORT_NOOP_VERSION}",
skinsupportlight : "com.mogo.skin:skin-light:${MOGO_SKIN_LIGHT_VERSION}",
crashreport : "com.mogo.test:crashrepot:${CRASHREPORT_VERSION}",
crashreport : "com.mogo.test:crashreport:${CRASHREPORT_VERSION}",
crashreportbugly : "com.mogo.test:crashreport-bugly:${CRASHREPORT_BUGLY_VERSION}",
crashreportnoop : "com.mogo.test:crashreport-noop:${CRASHREPORT_NOOP_VERSION}",
]

View File

@@ -36,9 +36,10 @@ class HualiObu : BaseObu(), IUdpSocketCallback {
}
override fun onMessageReceived(msg: ByteArray) {
// todo 处理数据
// 处理数据
val m = String(msg)
Logger.d(TAG, "onMessageReceived: $m")
printByteArray(msg)
parseObuProtocol(msg)
}
@@ -188,10 +189,10 @@ class HualiObu : BaseObu(), IUdpSocketCallback {
array.forEach {
val res = it.toInt() and 0xff
arrayBuilder.append("0x")
if (res < 10) {
if (res < 16) {
arrayBuilder.append("0")
}
arrayBuilder.append(it.toString(16)).append(", ")
arrayBuilder.append(Integer.toHexString(res)).append(", ")
}
Logger.d(TAG, arrayBuilder.toString())
}

View File

@@ -59,7 +59,7 @@ class UdpSocketManager(private val callback: IUdpSocketCallback? = null) {
socket = DatagramSocket(address.port)
socketMap[address] = socket
}
val buffer = ByteArray(1024)
val buffer = ByteArray(2048)
val packet = DatagramPacket(buffer, buffer.size)
while (isConnected){
if(socket.isClosed){

View File

@@ -28,7 +28,6 @@ import com.zhidao.mogo.module.obu.obu.bean.MogoObuEventInfo;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuLocationInfo;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuTrafficLightInfo;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import java.util.Map;
@@ -188,8 +187,9 @@ public class V2XObuManager implements IObuCallback, Handler.Callback {
return;
}
}
if (SystemClock.elapsedRealtime() - last > DEFAULT_INTERVAL_TIME) {
if (SystemClock.elapsedRealtime() - last > DEFAULT_INTERVAL_TIME||DebugConfig.getObuType() == DebugConfig.OBU_TYPE_HUALI) {
// 距离上次记录超过三十秒,继续相关逻辑,如果不超过三十秒,忽略此次事件
// 华砺智行obu暂时去掉此判断
intervalMap.put(info.getTypeCode(), SystemClock.elapsedRealtime());
V2XMessageEntity<V2XObuEventEntity> messageEntity = new V2XMessageEntity<>();
messageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_OBU_EVENT);

View File

@@ -2,8 +2,16 @@
./gradlew :foudations:mogo-utils:clean :foudations:mogo-utils:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:mogo-skin-support:clean :skin:mogo-skin-support:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :foudations:mogo-commons:clean :foudations:mogo-commons:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :test:crashreport:clean :test:crashreport:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :test:crashreport-bugly:clean :test:crashreport-bugly:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :test:crashreport-noop:clean :test:crashreport-noop:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :libraries:mogo-map-api:clean :libraries:mogo-map-api:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :services:mogo-service-api:clean :services:mogo-service-api:uploadArchives
@@ -16,6 +24,22 @@ if [ $? -ne 0 ]; then exit; fi
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-common:clean :modules:mogo-module-common:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:mogo-skin-light:clean :skin:mogo-skin-light:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:mogo-skin-support-impl:clean :skin:mogo-skin-support-impl:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:mogo-skin-support-noop:clean :skin:mogo-skin-support-noop:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:skin-support:clean :skin:skin-support:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:skin-support-appcompat:clean :skin:skin-support-appcompat:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:skin-support-cardview:clean :skin:skin-support-cardview:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:skin-support-constraint-layout:clean :skin:skin-support-constraint-layout:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:skin-support-design:clean :skin:skin-support-design:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :services:mogo-service:clean :services:mogo-service:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-obu:clean :modules:mogo-module-obu:uploadArchives
@@ -70,4 +94,14 @@ if [ $? -ne 0 ]; then exit; fi
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-push-noop:clean :modules:mogo-module-push-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-push:clean :modules:mogo-module-push:uploadArchives
./gradlew :modules:mogo-module-push:clean :modules:mogo-module-push:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-widgets:clean :modules:mogo-module-widgets:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-splash:clean :modules:mogo-module-splash:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-splash-noop:clean :modules:mogo-module-splash-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-tanlu:clean :modules:mogo-module-tanlu:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-monitor:clean :modules:mogo-module-monitor:uploadArchives