Commit f21d3a19 authored by liyuanhong's avatar liyuanhong

增加了页面16进制消息的显示

parent f0bb02f9
...@@ -23,12 +23,13 @@ class SendMultMsgThread(): ...@@ -23,12 +23,13 @@ class SendMultMsgThread():
self.threadArr = {} #保存每个线程的信息 self.threadArr = {} #保存每个线程的信息
self.failThreadCount = 0 #失败线程数 self.failThreadCount = 0 #失败线程数
self.durThreads = [] #持续发送线程数组,当数组为空,表示所有线程已经结束 self.durThreads = [] #持续发送线程数组,当数组为空,表示所有线程已经结束
dt = 1 * 1 * 60 dt = 1 * 20 * 60
self.durTime = dt #线程持续时间 self.durTime = dt #线程持续时间
self.connectTimeoutNum = 0 #连接超时线程数 self.connectTimeoutNum = 0 #连接超时线程数
self.sendTimeoutNum = 0 #发送超时线程数 self.sendTimeoutNum = 0 #发送超时线程数
self.reviceTimeoutNum = 0 #接收超时线程数 self.reviceTimeoutNum = 0 #接收超时线程数
self.sucessNum = 0 #成功线程数 self.sucessNum = 0 #成功线程数
self.failThreadCount = 0 #失败线程数
self.messageCon = [] #用来统计每个线程所发的消息数 self.messageCon = [] #用来统计每个线程所发的消息数
self.messageCons = 0 # 用来统计每个线程所发的消息数 self.messageCons = 0 # 用来统计每个线程所发的消息数
pass pass
...@@ -127,6 +128,7 @@ class SendMultMsgThread(): ...@@ -127,6 +128,7 @@ class SendMultMsgThread():
self.durThreads.remove(threadName) self.durThreads.remove(threadName)
self.threadArr[threadName]["status"] = 1 self.threadArr[threadName]["status"] = 1
self.failThreadCount = self.failThreadCount + 1 self.failThreadCount = self.failThreadCount + 1
self.sendTimeoutNum = self.sendTimeoutNum + 1
endTime = int(time.time()) endTime = int(time.time())
timeExpend = endTime - startTime timeExpend = endTime - startTime
self.threadArr[threadName]["timeExp"] = timeExpend self.threadArr[threadName]["timeExp"] = timeExpend
...@@ -142,7 +144,7 @@ class SendMultMsgThread(): ...@@ -142,7 +144,7 @@ class SendMultMsgThread():
self.durThreads.remove(threadName) self.durThreads.remove(threadName)
self.threadArr[threadName]["status"] = 1 self.threadArr[threadName]["status"] = 1
self.failThreadCount = self.failThreadCount + 1 self.failThreadCount = self.failThreadCount + 1
self.reviceTimeoutNum = self.connectTimeoutNum + 1 self.reviceTimeoutNum = self.reviceTimeoutNum + 1
self.messageCon.append(msgCon) self.messageCon.append(msgCon)
self.threadArr[threadName]["msgCon"] = msgCon self.threadArr[threadName]["msgCon"] = msgCon
print(threadName + ":" + 'socket 接收消息超时!') print(threadName + ":" + 'socket 接收消息超时!')
...@@ -191,9 +193,9 @@ class SendMultMsgThread(): ...@@ -191,9 +193,9 @@ class SendMultMsgThread():
def startThreadContinuous(self): def startThreadContinuous(self):
timeStart = int(time.time() * 1000) timeStart = int(time.time() * 1000)
for i in range(0,self.threadCount): for i in range(0,self.threadCount):
threadName = "thread-" + str(i) threadName = "thread-" + str(i + 42000)
print(threadName) print(threadName)
carid = 201912000000 + i carid = 201912000000 + i + 42000
theThread = threading.Thread(target=self.sendMsgContinuous, args=(carid,threadName,)) # 数据写死,心跳 theThread = threading.Thread(target=self.sendMsgContinuous, args=(carid,threadName,)) # 数据写死,心跳
threadInfo = {} threadInfo = {}
threadInfo["name"] = threadName threadInfo["name"] = threadName
......
...@@ -18,12 +18,12 @@ class SendMultMsgThread(): ...@@ -18,12 +18,12 @@ class SendMultMsgThread():
self.msg = msg self.msg = msg
self.timeOut = 30 #socket超时时间 self.timeOut = 30 #socket超时时间
self.BUF_SIZE = 1024 #接收消息缓存 self.BUF_SIZE = 1024 #接收消息缓存
self.threadCount = 1000 #并发线程数 self.threadCount = 10000 #并发线程数
self.totalTime = 0 #所有线程的运行总和 self.totalTime = 0 #所有线程的运行总和
self.threadArr = {} #保存每个线程的信息 self.threadArr = {} #保存每个线程的信息
self.failThreadCount = 0 #失败线程数 self.failThreadCount = 0 #失败线程数
self.durThreads = [] #持续发送线程数组,当数组为空,表示所有线程已经结束 self.durThreads = [] #持续发送线程数组,当数组为空,表示所有线程已经结束
dt = 1 * 1 * 60 dt = 1 * 20 * 60
self.durTime = dt #线程持续时间 self.durTime = dt #线程持续时间
self.connectTimeoutNum = 0 #连接超时线程数 self.connectTimeoutNum = 0 #连接超时线程数
self.sendTimeoutNum = 0 #发送超时线程数 self.sendTimeoutNum = 0 #发送超时线程数
......
...@@ -92,6 +92,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -92,6 +92,7 @@ $("#sendMsgBtn").click(function(){
data["troubleCodeNums"] = troubleCodeNums; data["troubleCodeNums"] = troubleCodeNums;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg_F2", url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg_F2",
type:"post", type:"post",
...@@ -102,6 +103,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -102,6 +103,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -69,6 +69,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -69,6 +69,7 @@ $("#sendMsgBtn").click(function(){
data["infoTime"] = infoTime; data["infoTime"] = infoTime;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg_F3", url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg_F3",
type:"post", type:"post",
...@@ -79,6 +80,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -79,6 +80,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -85,6 +85,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -85,6 +85,7 @@ $("#sendMsgBtn").click(function(){
data["vibrateOutSleepSpeedUpVal"] = vibrateOutSleepSpeedUpVal; data["vibrateOutSleepSpeedUpVal"] = vibrateOutSleepSpeedUpVal;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg_F4", url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg_F4",
type:"post", type:"post",
...@@ -95,6 +96,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -95,6 +96,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -162,6 +162,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -162,6 +162,7 @@ $("#sendMsgBtn").click(function(){
data["sharpCurveTimes"] = sharpCurveTimes; data["sharpCurveTimes"] = sharpCurveTimes;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg", url:"http://" + host + "/messageTools/message_process/porcessDataUpstreamTransportMsg",
type:"post", type:"post",
...@@ -172,6 +173,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -172,6 +173,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
data["pkgCounts"] = pkgCounts; data["pkgCounts"] = pkgCounts;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessHeartBeatMsg", url:"http://" + host + "/messageTools/message_process/porcessHeartBeatMsg",
type:"post", type:"post",
...@@ -107,6 +108,7 @@ ...@@ -107,6 +108,7 @@
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -746,6 +746,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -746,6 +746,7 @@ $("#sendMsgBtn").click(function(){
data["extraInfo"] = getExtraInfo(); data["extraInfo"] = getExtraInfo();
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessTerminalRegisterMsg", url:"http://" + host + "/messageTools/message_process/porcessTerminalRegisterMsg",
type:"post", type:"post",
...@@ -756,6 +757,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -756,6 +757,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -77,6 +77,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -77,6 +77,7 @@ $("#sendMsgBtn").click(function(){
data["carSign"] = carSign; data["carSign"] = carSign;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessTerminalRegisterMsg", url:"http://" + host + "/messageTools/message_process/porcessTerminalRegisterMsg",
type:"post", type:"post",
...@@ -87,6 +88,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -87,6 +88,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -89,6 +89,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -89,6 +89,7 @@ $("#sendMsgBtn").click(function(){
data["totalOilExpend"] = totalOilExpend; data["totalOilExpend"] = totalOilExpend;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/messageTools/message_process/porcessTerminalVersionInfoUploadMsg", url:"http://" + host + "/messageTools/message_process/porcessTerminalVersionInfoUploadMsg",
type:"post", type:"post",
...@@ -99,6 +100,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -99,6 +100,7 @@ $("#sendMsgBtn").click(function(){
//window.location.reload() //window.location.reload()
var theShow = "原始数据: " + data.original + "\n"; var theShow = "原始数据: " + data.original + "\n";
theShow = theShow + "收到数据: " + data.result + "\n"; theShow = theShow + "收到数据: " + data.result + "\n";
theShow = theShow + "收到数据16进制: " + data.resultH + "\n";
theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n"; theShow = theShow + "解析数据: " + JSON.stringify(data.parse) + "\n";
$("#showFeedback").val(theShow) $("#showFeedback").val(theShow)
}else{ }else{
......
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
data["GPSTimestamp"] = GPSTimestamp; data["GPSTimestamp"] = GPSTimestamp;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/protocolTools/protocolReport_process/porcessGPSMsg", url:"http://" + host + "/protocolTools/protocolReport_process/porcessGPSMsg",
type:"post", type:"post",
...@@ -148,7 +149,11 @@ ...@@ -148,7 +149,11 @@
success:function(data){ success:function(data){
if(data.status == 200){ if(data.status == 200){
//window.location.reload() //window.location.reload()
$("#showFeedback").val(data.result) msg = "发送消息:" + data.msgSend + "\n"
msg = msg + "收到消息:" + data.result + "\n"
msg = msg + "收到消息16进制:" + data.rev + "\n"
msg = msg + "收到消息解析结果:" + data.orgRev + "\n"
$("#showFeedback").val(msg)
}else{ }else{
$("#showFeedback").val(data.message) $("#showFeedback").val(data.message)
alert(data.message); alert(data.message);
......
...@@ -191,6 +191,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -191,6 +191,7 @@ $("#sendMsgBtn").click(function(){
data["GPSMileage"] = GPSMileage; data["GPSMileage"] = GPSMileage;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/protocolTools/protocolReport_process/porcessOBD_CAN_Msg", url:"http://" + host + "/protocolTools/protocolReport_process/porcessOBD_CAN_Msg",
type:"post", type:"post",
...@@ -199,7 +200,11 @@ $("#sendMsgBtn").click(function(){ ...@@ -199,7 +200,11 @@ $("#sendMsgBtn").click(function(){
success:function(data){ success:function(data){
if(data.status == 200){ if(data.status == 200){
//window.location.reload() //window.location.reload()
$("#showFeedback").val(data.result) msg = "发送消息:" + data.msgSend + "\n"
msg = msg + "收到消息:" + data.result + "\n"
msg = msg + "收到消息16进制:" + data.rev + "\n"
msg = msg + "收到消息解析结果:" + data.orgRev + "\n"
$("#showFeedback").val(msg)
}else{ }else{
$("#showFeedback").val(data.message) $("#showFeedback").val(data.message)
alert(data.message); alert(data.message);
......
...@@ -31,6 +31,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -31,6 +31,7 @@ $("#sendMsgBtn").click(function(){
data["DEV_ID"] = DEV_ID; data["DEV_ID"] = DEV_ID;
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/protocolTools/protocolReport_process/porcessHeartBeatMsg", url:"http://" + host + "/protocolTools/protocolReport_process/porcessHeartBeatMsg",
type:"post", type:"post",
...@@ -39,7 +40,11 @@ $("#sendMsgBtn").click(function(){ ...@@ -39,7 +40,11 @@ $("#sendMsgBtn").click(function(){
success:function(data){ success:function(data){
if(data.status == 200){ if(data.status == 200){
//window.location.reload() //window.location.reload()
$("#showFeedback").val(data.result) msg = "发送消息:" + data.msgSend + "\n"
msg = msg + "收到消息:" + data.result + "\n"
msg = msg + "收到消息16进制:" + data.rev + "\n"
msg = msg + "收到消息解析结果:" + data.orgRev + "\n"
$("#showFeedback").val(msg)
}else{ }else{
$("#showFeedback").val(data.message) $("#showFeedback").val(data.message)
alert(data.message); alert(data.message);
......
...@@ -44,6 +44,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -44,6 +44,7 @@ $("#sendMsgBtn").click(function(){
data["imei"] = imei data["imei"] = imei
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/protocolTools/protocolReport_process/porcessLoginMsg", url:"http://" + host + "/protocolTools/protocolReport_process/porcessLoginMsg",
type:"post", type:"post",
...@@ -51,8 +52,11 @@ $("#sendMsgBtn").click(function(){ ...@@ -51,8 +52,11 @@ $("#sendMsgBtn").click(function(){
dataType:"json", dataType:"json",
success:function(data){ success:function(data){
if(data.status == 200){ if(data.status == 200){
//window.location.reload() msg = "发送消息:" + data.msgSend + "\n"
$("#showFeedback").val(data.result) msg = msg + "收到消息:" + data.result + "\n"
msg = msg + "收到消息16进制:" + data.rev + "\n"
msg = msg + "收到消息解析结果:" + data.orgRev + "\n"
$("#showFeedback").val(msg)
}else{ }else{
$("#showFeedback").val(data.message) $("#showFeedback").val(data.message)
alert(data.message); alert(data.message);
......
...@@ -333,6 +333,7 @@ $("#sendMsgBtn").click(function(){ ...@@ -333,6 +333,7 @@ $("#sendMsgBtn").click(function(){
data["dataByte"] = dataByte data["dataByte"] = dataByte
var host = window.location.host; var host = window.location.host;
$("#showFeedback").val("")
$.ajax({ $.ajax({
url:"http://" + host + "/protocolTools/protocolReport_process/porcessSecurityStatusMsg", url:"http://" + host + "/protocolTools/protocolReport_process/porcessSecurityStatusMsg",
type:"post", type:"post",
...@@ -341,7 +342,11 @@ $("#sendMsgBtn").click(function(){ ...@@ -341,7 +342,11 @@ $("#sendMsgBtn").click(function(){
success:function(data){ success:function(data){
if(data.status == 200){ if(data.status == 200){
//window.location.reload() //window.location.reload()
$("#showFeedback").val(data.result) msg = "发送消息:" + data.msgSend + "\n"
msg = msg + "收到消息:" + data.result + "\n"
msg = msg + "收到消息16进制:" + data.rev + "\n"
msg = msg + "收到消息解析结果:" + data.orgRev + "\n"
$("#showFeedback").val(msg)
}else{ }else{
$("#showFeedback").val(data.message) $("#showFeedback").val(data.message)
alert(data.message); alert(data.message);
......
...@@ -52,7 +52,9 @@ def porcessHeartBeatMsg(): ...@@ -52,7 +52,9 @@ def porcessHeartBeatMsg():
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["original"] = msg data["original"] = msg
data["result"] = socRecv_2 data["result"] = socRecv_2
data["parse"] = json.loads(PlatformCommon_res(socRecv_1).getMsg()) msgP = PlatformCommon_res(socRecv_1)
data["resultH"] = msgP.getOriginalMsg()
data["parse"] = json.loads(msgP.getMsg())
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -104,7 +106,9 @@ def porcessTerminalRegisterMsg(): ...@@ -104,7 +106,9 @@ def porcessTerminalRegisterMsg():
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["original"] = msg data["original"] = msg
data["result"] = socRecv_2 data["result"] = socRecv_2
data["parse"] = json.loads(PlatformCommon_res(socRecv_1).getMsg()) msgP = PlatformCommon_res(socRecv_1)
data["resultH"] = msgP.getOriginalMsg()
data["parse"] = json.loads(msgP.getMsg())
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -162,7 +166,9 @@ def porcessTerminalVersionInfoUploadMsg(): ...@@ -162,7 +166,9 @@ def porcessTerminalVersionInfoUploadMsg():
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["original"] = msg data["original"] = msg
data["result"] = socRecv_2 data["result"] = socRecv_2
data["parse"] = json.loads(PlatefromVersionInfo_res(socRecv_1).getMsg()) msgP = PlatformCommon_res(socRecv_1)
data["resultH"] = msgP.getOriginalMsg()
data["parse"] = json.loads(msgP.getMsg())
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -278,7 +284,9 @@ def porcessDataUpstreamTransportMsg(): ...@@ -278,7 +284,9 @@ def porcessDataUpstreamTransportMsg():
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["original"] = msg data["original"] = msg
data["result"] = socRecv_2 data["result"] = socRecv_2
data["parse"] = json.loads(PlatformCommon_res(socRecv_1).getMsg()) msgP = PlatformCommon_res(socRecv_1)
data["resultH"] = msgP.getOriginalMsg()
data["parse"] = json.loads(msgP.getMsg())
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -333,7 +341,9 @@ def porcessDataUpstreamTransportMsg_F2(): ...@@ -333,7 +341,9 @@ def porcessDataUpstreamTransportMsg_F2():
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["original"] = msg data["original"] = msg
data["result"] = socRecv_2 data["result"] = socRecv_2
data["parse"] = json.loads(PlatformCommon_res(socRecv_1).getMsg()) msgP = PlatformCommon_res(socRecv_1)
data["resultH"] = msgP.getOriginalMsg()
data["parse"] = json.loads(msgP.getMsg())
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -382,7 +392,9 @@ def porcessDataUpstreamTransportMsg_F3(): ...@@ -382,7 +392,9 @@ def porcessDataUpstreamTransportMsg_F3():
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["original"] = msg data["original"] = msg
data["result"] = socRecv_2 data["result"] = socRecv_2
data["parse"] = json.loads(PlatformCommon_res(socRecv_1).getMsg()) msgP = PlatformCommon_res(socRecv_1)
data["resultH"] = msgP.getOriginalMsg()
data["parse"] = json.loads(msgP.getMsg())
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -437,7 +449,9 @@ def porcessDataUpstreamTransportMsg_F4(): ...@@ -437,7 +449,9 @@ def porcessDataUpstreamTransportMsg_F4():
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["original"] = msg data["original"] = msg
data["result"] = socRecv_2 data["result"] = socRecv_2
data["parse"] = json.loads(PlatformCommon_res(socRecv_1).getMsg()) msgP = PlatformCommon_res(socRecv_1)
data["resultH"] = msgP.getOriginalMsg()
data["parse"] = json.loads(msgP.getMsg())
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
......
...@@ -39,11 +39,14 @@ def porcessHeartBeatMsg(): ...@@ -39,11 +39,14 @@ def porcessHeartBeatMsg():
msg = heartBeatProtocolObj.generateHeartBeatMsg() msg = heartBeatProtocolObj.generateHeartBeatMsg()
cliSocket.send(msg) cliSocket.send(msg)
socRecv = cliSocket.receive() socRecv = cliSocket.receive()
socRecv = str(socRecv) socRecvo = str(socRecv)
cliSocket.close() cliSocket.close()
data["status"] = "200" data["status"] = "200"
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["result"] = socRecv data["msgSend"] = msg
data["result"] = socRecvo
data["rev"] = str(binascii.b2a_hex(socRecv))[2:][:-1]
data["orgRev"] = "*********返回的消息还未解析*********"
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -80,11 +83,14 @@ def porcessLoginBeatMsg(): ...@@ -80,11 +83,14 @@ def porcessLoginBeatMsg():
msg = loginProtocolObj.generateLoginMsg() msg = loginProtocolObj.generateLoginMsg()
cliSocket.send(msg) cliSocket.send(msg)
socRecv = cliSocket.receive() socRecv = cliSocket.receive()
socRecv = str(socRecv) socRecvo = str(socRecv)
cliSocket.close() cliSocket.close()
data["status"] = "200" data["status"] = "200"
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["result"] = socRecv data["msgSend"] = msg
data["result"] = socRecvo
data["rev"] = str(binascii.b2a_hex(socRecv))[2:][:-1]
data["orgRev"] = "*********返回的消息还未解析*********"
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -137,12 +143,14 @@ def porcessGPSMsg(): ...@@ -137,12 +143,14 @@ def porcessGPSMsg():
msg = GPSProtocolObj.generateGpsMsg() msg = GPSProtocolObj.generateGpsMsg()
cliSocket.send(msg) cliSocket.send(msg)
socRecv = cliSocket.receive() socRecv = cliSocket.receive()
socRecv = str(socRecv) socRecvo = str(socRecv)
# socRecv = str(binascii.b2a_hex(socRecv))
cliSocket.close() cliSocket.close()
data["status"] = "200" data["status"] = "200"
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["result"] = socRecv data["msgSend"] = msg
data["result"] = socRecvo
data["rev"] = str(binascii.b2a_hex(socRecv))[2:][:-1]
data["orgRev"] = "*********返回的消息还未解析*********"
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -220,12 +228,14 @@ def porcessOBD_CAN_Msg(): ...@@ -220,12 +228,14 @@ def porcessOBD_CAN_Msg():
msg = OBD_CAN_protocolObj.generateOBDReportCANMsg() msg = OBD_CAN_protocolObj.generateOBDReportCANMsg()
cliSocket.send(msg) cliSocket.send(msg)
socRecv = cliSocket.receive() socRecv = cliSocket.receive()
socRecv = str(socRecv) socRecvo = str(socRecv)
# socRecv = str(binascii.b2a_hex(socRecv))
cliSocket.close() cliSocket.close()
data["status"] = "200" data["status"] = "200"
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["result"] = socRecv data["msgSend"] = msg
data["result"] = socRecvo
data["rev"] = str(binascii.b2a_hex(socRecv))[2:][:-1]
data["orgRev"] = "*********返回的消息还未解析*********"
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
...@@ -269,11 +279,14 @@ def porcessSecurityStatusMsg(): ...@@ -269,11 +279,14 @@ def porcessSecurityStatusMsg():
msg = securityStatusProtocolObj.generateSecurityStatusMsg() msg = securityStatusProtocolObj.generateSecurityStatusMsg()
cliSocket.send(msg) cliSocket.send(msg)
socRecv = cliSocket.receive() socRecv = cliSocket.receive()
socRecv = str(socRecv) socRecvo = str(socRecv)
cliSocket.close() cliSocket.close()
data["status"] = "200" data["status"] = "200"
data["message"] = "Sucess: " data["message"] = "Sucess: "
data["result"] = socRecv data["msgSend"] = msg
data["result"] = socRecvo
data["rev"] = str(binascii.b2a_hex(socRecv))[2:][:-1]
data["orgRev"] = "*********返回的消息还未解析*********"
except BaseException as e: except BaseException as e:
# 打印异常信息 # 打印异常信息
traceback.print_exc() traceback.print_exc()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment