This commit is contained in:
lixiaopeng
2022-05-20 14:50:01 +08:00
parent fa5df17063
commit 1931889746
4 changed files with 16 additions and 13 deletions

View File

@@ -107,7 +107,7 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) { //TODO 这里判断
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) {
Log.d("liyz", "司机端 onAutopilotCarConfig ---" + carConfigResp.getMacAddress());
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress(), MoGoAiCloudClientConfig.getInstance().getSn());
}

View File

@@ -1,6 +1,8 @@
package com.mogo.eagle.core.function.autopilot.telematic
import android.util.Log
import com.google.protobuf.TextFormat
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
@@ -58,6 +60,8 @@ class TeleMsgHandler : IMsgHandler {
AppConfigInfo.plateNumber = carConfig.plateNumber
AppConfigInfo.iPCMacAddress = carConfig.macAddress
invokeNettyConnResult("司机屏发送给乘客屏配置信息为:${TextFormat.printer().escapingNonAscii(false).printToString(carConfig)}")
Log.d("liyz", "TeleMsgHandler macAddress = " + carConfig.macAddress)
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfig.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
}
else -> {
}

View File

@@ -56,13 +56,13 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
*/
@Override
public void getBindingcarInfo(String macAddress, String widevineIDWithMd5) {
// mAddress = macAddress;
// mWidevineIDWithMd5 = widevineIDWithMd5;
// if (getScreenType() == 1) { //司机屏
// driverScreen(macAddress, widevineIDWithMd5);
// } else if (getScreenType() == 2) { //乘客屏
// passengerScreen(macAddress, widevineIDWithMd5);
// }
mAddress = macAddress;
mWidevineIDWithMd5 = widevineIDWithMd5;
if (getScreenType() == 1) { //司机屏
driverScreen(macAddress, widevineIDWithMd5);
} else if (getScreenType() == 2) { //乘客屏
passengerScreen(macAddress, widevineIDWithMd5);
}
}
/**
@@ -94,10 +94,9 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
private void driverScreen(String macAddress, String widevineIDWithMd5) {
long currentHour = System.currentTimeMillis() / (1000 * 60);
long oldHour = SharedPrefsMgr.getInstance(mContext).getLong("typeDriver", 0);
Log.d("liyz", "driverScreen ------ macAddress = " + macAddress + "--widevineIDWithMd5 = " + widevineIDWithMd5 + "--getScreenType() = " + getScreenType());
//如果5分钟内频繁调需要拦截业务导致的会多次请求工控机信息 TODO
//如果5分钟内频繁调需要拦截业务导致的会多次请求工控机信息
if (HmiBuildConfig.isShowSnBindingView) {
Log.d("liyz", "driverScreen -----间隔时间 = " + (currentHour - oldHour));
Log.d("liyz", "driverScreen -----间隔时间 = " + (currentHour - oldHour) + "-- macAddress = " + macAddress + "--widevineIDWithMd5 = " + widevineIDWithMd5 + "--getScreenType() = " + getScreenType());
if (currentHour - oldHour > 5) {
SharedPrefsMgr.getInstance(mContext).putLong("typeDriver", System.currentTimeMillis() / (1000 * 60));
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, widevineIDWithMd5, getScreenType());
@@ -108,10 +107,9 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
private void passengerScreen(String macAddress, String widevineIDWithMd5) {
long currentHour = System.currentTimeMillis() / (1000 * 60);
long oldHour = SharedPrefsMgr.getInstance(mContext).getLong("typePassenger", 0);
Log.d("liyz", "passengerScreen ------ mAddress = " + macAddress + "--mWidevineIDWithMd5 = " + widevineIDWithMd5 + "--getScreenType() = " + getScreenType());
//如果5分钟内频繁调需要拦截业务导致的会多次请求工控机信息
if (HmiBuildConfig.isShowSnBindingView) {
Log.d("liyz", "passengerScreen -----间隔时间 = " + (currentHour - oldHour));
Log.d("liyz", "passengerScreen --间隔时间 = " + (currentHour - oldHour) + "-- mAddress = " + macAddress + "--mWidevineIDWithMd5 = " + widevineIDWithMd5 + "--getScreenType() = " + getScreenType());
if (currentHour - oldHour > 5) {
SharedPrefsMgr.getInstance(mContext).putLong("typePassenger", System.currentTimeMillis() / (1000 * 60));
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, widevineIDWithMd5, getScreenType());