[6.2.6][V2N] V2N新需求代码提交

This commit is contained in:
renwj
2023-12-18 17:46:02 +08:00
parent fdb4133160
commit d79efd6d62
10 changed files with 67 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.datacenter.autopilot.telematic
import android.util.Log
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.google.protobuf.TextFormat
@@ -11,9 +12,11 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_STATUS
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.data.v2x.V2XEvent.RoadEventX
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
@@ -32,6 +35,7 @@ import io.netty.channel.Channel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import java.nio.charset.Charset
class TeleMsgHandler : IMsgHandler {
@@ -58,6 +62,20 @@ class TeleMsgHandler : IMsgHandler {
override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) {
msg?.let {
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_DATA_TO_PASSENGER) {
try {
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 1 ---")
val content = String(it.body, Charset.defaultCharset())
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 2 ---:$content")
val data = GsonUtils.fromJson(content, RoadEventX::class.java)
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 3 ---:$data")
CallerCloudListenerManager.invokeSocketAck(data)
} catch (t: Throwable) {
t.printStackTrace()
Log.e(TAG, "乘客屏收到司机屏转发云端下发的V2N事件异常", t)
}
return
}
when (it.protocolType) {
MogoProtocolMsg.NORMAL_DATA -> {
try {