diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt index bd745e614b..ad5e57f222 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt @@ -106,13 +106,13 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight * AI云获取红绿灯状态 */ override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.SHOW_TRAFFIC_LIGHT, GsonUtils.toJson(trafficLightResult).toByteArray()) + } if (!hasObuLightStatus) { hasAiLightStatus = true CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightStatus trafficLightResult = $trafficLightResult ") updateTrafficLight(trafficLightResult) - if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - CallerTelematicManager.sendMsgToAllClients(TelematicConstant.SHOW_TRAFFIC_LIGHT, GsonUtils.toJson(trafficLightResult).toByteArray()) - } } } @@ -126,13 +126,13 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight Handler().postDelayed({ hasAiLightStatus = false }, 5000) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray()) + } //如果没有OBU灯态则进行隐藏,如果有OBU灯态,则交由OBU管理 if(!hasObuLightStatus){ CallerTrafficLightListenerManager.resetTrafficLightStatus(!hasObuLightStatus) hide() - if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray()) - } } } }