[change]修复乘客屏分发线程没启动问题

This commit is contained in:
xinfengkun
2022-06-16 15:07:20 +08:00
committed by liujing
parent 819c127dd9
commit e5c3800a18
4 changed files with 58 additions and 19 deletions

View File

@@ -473,34 +473,44 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
adasConnectStatusListener.onConnectionIPCStatus(ipcConnectionStatus.get(), reason);
}
if (status == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
if (dispatchHandler != null) {
dispatchHandler.start();
}
if (dispatchHandlerPointCloud != null) {
dispatchHandlerPointCloud.start();
}
if (dispatchHandlerParsePointCloud != null) {
dispatchHandlerParsePointCloud.start();
}
startDispatchHandler();
startCheckCompatibility();
} else {
stopCheckCompatibility();
}
if (status == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
AdasManager.getInstance().setCarConfig(null);
if (dispatchHandler != null) {
dispatchHandler.stop();
}
if (dispatchHandlerPointCloud != null) {
dispatchHandlerPointCloud.stop();
}
if (dispatchHandlerParsePointCloud != null) {
dispatchHandlerParsePointCloud.stop();
}
stopDispatchHandler();
}
CupidLogUtils.i(TAG, "工控机连接状态 status=" + status + " reason=" + reason);
}
@Override
public void startDispatchHandler() {
if (dispatchHandler != null) {
dispatchHandler.start();
}
if (dispatchHandlerPointCloud != null) {
dispatchHandlerPointCloud.start();
}
if (dispatchHandlerParsePointCloud != null) {
dispatchHandlerParsePointCloud.start();
}
}
@Override
public void stopDispatchHandler() {
if (dispatchHandler != null) {
dispatchHandler.stop();
}
if (dispatchHandlerPointCloud != null) {
dispatchHandlerPointCloud.stop();
}
if (dispatchHandlerParsePointCloud != null) {
dispatchHandlerParsePointCloud.stop();
}
}
/**
* 检查兼容性
*/

View File

@@ -200,6 +200,20 @@ public class AdasManager implements IAdasNetCommApi {
}
}
@Override
public void startDispatchHandler() {
if (mChannel != null) {
mChannel.startDispatchHandler();
}
}
@Override
public void stopDispatchHandler() {
if (mChannel != null) {
mChannel.stopDispatchHandler();
}
}
/**
* 获取工控机链接配置
*

View File

@@ -214,6 +214,16 @@ public interface IAdasNetCommApi {
*/
void decoderRaw(byte[] bytes);
/**
* 启动分发线程
*/
void startDispatchHandler();
/**
* 停止分发线程
*/
void stopDispatchHandler();
/**
* Log是否开启打印
*/