add new func of track process of adas
This commit is contained in:
@@ -67,6 +67,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation rootProject.ext.dependencies.mogochainbase
|
||||
//okhttp3的依赖
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.3'
|
||||
// parser
|
||||
@@ -80,6 +82,12 @@ dependencies {
|
||||
implementation 'com.jcraft:jsch:0.1.55'
|
||||
// api project(path: ':lib_recorder')
|
||||
api "com.zhidao.support.recorder:recorder:1.0.0.3"
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
} else {
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
}
|
||||
|
||||
//task androidSourcesJar(type: Jar) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zhidao.support.adas.high;
|
||||
|
||||
import static com.mogo.eagle.core.data.chain.ChainConstant.CHAIN_ALIAS_CODE_UDP_CONNECT_ADDRESS;
|
||||
import static com.zhidao.support.adas.high.common.ActionTypeReceive.ACTION_WS_AUTOPILOT_CONTROL;
|
||||
import static com.zhidao.support.adas.high.udp.CupidUdpConstract.VIDEO_RENDER_IMAGE_UDP;
|
||||
|
||||
@@ -39,6 +40,8 @@ import com.zhidao.support.adas.high.socket.read.SocketReader;
|
||||
import com.zhidao.support.adas.high.udp.CupidUdpConstract;
|
||||
import com.zhidao.support.adas.high.udp.IConnectRtpListener;
|
||||
import com.zhidao.support.adas.high.udp.IGetH264Data;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -109,6 +112,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
|
||||
AdasChannel(Context context, String ipAddr) {
|
||||
initData(context);
|
||||
this.ipAddr = ipAddr;
|
||||
@@ -167,6 +171,11 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(linkCode = 1,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_UDP_CONNECT_ADDRESS,
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn")
|
||||
private void connectSocket(String address) {
|
||||
mSocket.connectWebSocket(address);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
package com.zhidao.support.adas.high.socket;
|
||||
|
||||
import static com.mogo.eagle.core.data.chain.ChainConstant.CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_BYTE;
|
||||
import static com.mogo.eagle.core.data.chain.ChainConstant.CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_JSON;
|
||||
import static com.mogo.eagle.core.data.chain.ChainConstant.CHAIN_ALIAS_CODE_WEB_SOCKET_OPEN;
|
||||
import static com.mogo.eagle.core.data.chain.ChainConstant.CHAIN_LINK_ADAS;
|
||||
import static com.zhidao.support.adas.high.common.Constants.WS_IP_HOST_HEAD;
|
||||
import static com.zhidao.support.adas.high.common.Constants.WS_PORT;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.bean.FaceLoginResponse;
|
||||
import com.zhidao.support.adas.high.common.DigitalTrans;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.RequestWsMsgType;
|
||||
import com.zhidao.support.adas.high.queue.WSByteQueueManager;
|
||||
import com.zhidao.support.adas.high.queue.WebSocketQueueManager;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
@@ -21,7 +29,6 @@ import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import adas.Adas;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -29,9 +36,6 @@ import okhttp3.WebSocket;
|
||||
import okhttp3.WebSocketListener;
|
||||
import okio.ByteString;
|
||||
|
||||
import static com.zhidao.support.adas.high.common.Constants.WS_IP_HOST_HEAD;
|
||||
import static com.zhidao.support.adas.high.common.Constants.WS_PORT;
|
||||
|
||||
/**
|
||||
* @ProjectName: lib-adas-fpga
|
||||
* @Package: com.zhidao.lib.adas.high
|
||||
@@ -79,6 +83,11 @@ public class FpgaSocket implements IWebSocket {
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(linkCode = 1,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = "PAD_YINGYAN_ADAS",
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn")
|
||||
@Override
|
||||
public void connectWebSocket(String address) {
|
||||
String wsHost = WS_IP_HOST_HEAD + address + WS_PORT;
|
||||
@@ -95,7 +104,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
@Override
|
||||
public void closeWebSocket() {
|
||||
CupidLogUtils.e("===>closeWebSocket");
|
||||
if (AdasChannel.isUseQueue){
|
||||
if (AdasChannel.isUseQueue) {
|
||||
WebSocketQueueManager.getInstance().release();
|
||||
WSByteQueueManager.getInstance().release();
|
||||
}
|
||||
@@ -239,7 +248,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
public interface IWebSocketConnectListener {
|
||||
void onWebSocketConnectSuccess(WebSocket webSocket);
|
||||
|
||||
void onWebSocketConnectFailed(WebSocket webSocket,String t);
|
||||
void onWebSocketConnectFailed(WebSocket webSocket, String t);
|
||||
|
||||
void onMessage(String message);
|
||||
|
||||
@@ -251,6 +260,12 @@ public class FpgaSocket implements IWebSocket {
|
||||
}
|
||||
|
||||
public class EchoWebSocketListener extends WebSocketListener {
|
||||
|
||||
@ChainLog(linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_WEB_SOCKET_OPEN,
|
||||
paramIndexes = {1},
|
||||
clientPkFileName = "sn")
|
||||
@Override
|
||||
public void onOpen(WebSocket webSocket, Response response) {
|
||||
super.onOpen(webSocket, response);
|
||||
@@ -259,6 +274,11 @@ public class FpgaSocket implements IWebSocket {
|
||||
mWebSocketConnectListener.onWebSocketConnectSuccess(webSocket);
|
||||
}
|
||||
|
||||
@ChainLog(linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_JSON,
|
||||
paramIndexes = {1},
|
||||
clientPkFileName = "sn")
|
||||
@Override
|
||||
public void onMessage(WebSocket webSocket, String text) {
|
||||
super.onMessage(webSocket, text);
|
||||
@@ -273,12 +293,16 @@ public class FpgaSocket implements IWebSocket {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ChainLog(linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_BYTE,
|
||||
paramIndexes = {1},
|
||||
clientPkFileName = "sn")
|
||||
@Override
|
||||
public void onMessage(WebSocket webSocket, ByteString bytes) {
|
||||
super.onMessage(webSocket, bytes);
|
||||
CupidLogUtils.e("--->websocket response connect byte" + bytes.hex());
|
||||
if (bytes==null){
|
||||
if (bytes == null) {
|
||||
return;
|
||||
}
|
||||
if (AdasChannel.isUseQueue) {
|
||||
@@ -305,7 +329,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
super.onClosed(webSocket, code, reason);
|
||||
mWebSocket = null;
|
||||
CupidLogUtils.e("--->websocket onClosed ==> " + reason);
|
||||
mWebSocketConnectListener.onWebSocketConnectFailed(webSocket,reason);
|
||||
mWebSocketConnectListener.onWebSocketConnectFailed(webSocket, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -313,7 +337,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
super.onFailure(webSocket, t, response);
|
||||
mWebSocket = null;
|
||||
CupidLogUtils.e("--->websocket onFailure ===>" + t.getMessage());
|
||||
mWebSocketConnectListener.onWebSocketConnectFailed(webSocket,t.toString());
|
||||
mWebSocketConnectListener.onWebSocketConnectFailed(webSocket, t.toString());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.zhidao.support.adas.high.udp;
|
||||
|
||||
|
||||
import static com.mogo.eagle.core.data.chain.ChainConstant.CHAIN_ALIAS_CODE_UDP_INIT;
|
||||
import static com.mogo.eagle.core.data.chain.ChainConstant.CHAIN_LINK_ADAS;
|
||||
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.udp.factory.AbstractUdpImpl;
|
||||
import com.zhidao.support.adas.high.udp.factory.CupidUdpFactory;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
/**
|
||||
* @author nie yunlong
|
||||
@@ -45,6 +50,11 @@ public class CupidUdpConstract {
|
||||
/**
|
||||
* 初始化UDPserver 接收数据
|
||||
*/
|
||||
@ChainLog(linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_UDP_INIT,
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn")
|
||||
private void init(int udpType) {
|
||||
if (udpType == VIDEO_STREAM_UDP) {
|
||||
udpImpl = CupidUdpFactory.createVideoStreamUdp();
|
||||
|
||||
Reference in New Issue
Block a user