Skip to content

Commit

Permalink
feat: [mediatek] modify metadata format for parsing, add offline repl…
Browse files Browse the repository at this point in the history
…ayer (#1)
  • Loading branch information
cathyli93 authored and zwyuan committed Jun 28, 2017
1 parent d2cc1ed commit 96ad884
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 164 deletions.
15 changes: 10 additions & 5 deletions mobile_insight/monitor/android_mtk_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ def __init__(self, prefs={}):
libs_path,
"android_pie_ws_dissector"),
"libwireshark_path": libs_path}
DMLogPacket.init(prefs) # ???
DMLogPacket.init(prefs)
# res = mtk_log_parser.ws_dissector_proc_start(prefs.get("ws_dissect_executable_path", None), prefs.get("libwireshark_path", None))
# self.log_debug('qianru init: ' + str(res))
# WSDissector.init_proc(prefs.get("ws_dissect_executable_path", None),
# prefs.get("libwireshark_path", None))


def available_log_types(self):
Expand Down Expand Up @@ -162,9 +166,9 @@ def enable_log(self, type_name):
if tn in msg_type:
msg_enabled[msg_type.index(tn)] = 1
self.log_info("Enable collection: " + tn)
else:
self.log_warning("Unsupported message by MediaTek: "+str(tn))
# dm_collector_c.set_filtered(self._type_names) # ???
# else: # delelte by qianru
# self.log_warning("Unsupported message by MediaTek: "+str(tn))
# # dm_collector_c.set_filtered(self._type_names) # ???

def set_filter(self):
"""
Expand Down Expand Up @@ -267,6 +271,7 @@ def _read_muxraw(self, f, cur_pos):
"""
Return final position.
"""
# mtk_log_parser.ws_dissector_proc_start(self.ws_dissector_path, self.libs_path)
BLOCK_SIZE = 128
f.seek(cur_pos, 0)
while True:
Expand Down Expand Up @@ -398,4 +403,4 @@ def run(self):
sys.exit(str(traceback.format_exc()))
finally:
self._parse_muxraws(monitoring_files)
self._stop_collection()
self._stop_collection()
218 changes: 61 additions & 157 deletions mobile_insight/monitor/mtk_log_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
except ImportError:
import xml.etree.ElementTree as ET

from mobile_insight.monitor.dm_collector.dm_endec.ws_dissector import *

ANDROID_SHELL = "/system/bin/sh"

SMS_CP = '\x90\x01\x00\x00' #400
Expand Down Expand Up @@ -74,166 +76,56 @@
LTE_NAS_str = "LTE_NAS_ESM_OTA_Incoming_Packet"



type_id_mapping = {
# SMS_CP,
MM_CM_REQ:[190,NAS_str,"NAS"],#"MM_CM_REQ"],
MM_AUTH_REQ:[190,NAS_str,"NAS"],#"MM_AUTH_REQ"],
GMM_UL:[190,NAS_str,"NAS"],#"GMM_UL"],
GMM_DL:[190,NAS_str,"NAS"],#"GMM_DL"],
MM_CM_REQ:["NAS",NAS_str,"NAS"],#"MM_CM_REQ"],
MM_AUTH_REQ:["NAS",NAS_str,"NAS"],#"MM_AUTH_REQ"],
GMM_UL:["NAS",NAS_str,"NAS"],#"GMM_UL"],
GMM_DL:["NAS",NAS_str,"NAS"],#"GMM_DL"],
# SMS_RP,
CC_UL:[190,NAS_str,"NAS"],#"CC_UL"],
CC_DL:[190,NAS_str,"NAS"],#"CC_DL"],
SM_PDP:[190,NAS_str,"NAS"],#"SM_PDP"],
CC_UL:["NAS",NAS_str,"NAS"],#"CC_UL"],
CC_DL:["NAS",NAS_str,"NAS"],#"CC_DL"],
SM_PDP:["NAS",NAS_str,"NAS"],#"SM_PDP"],
# _2G_RR,
# _2G_RR_SI,
# _2G_RR_MEAS,
# _2G_RR_CHNL,
LTE_BCCH_BCH:[203,LTE_RRC_str,"LTE-RRC_BCCH_DL_SCH"],#"LTE_BCCH_BCH"],
LTE_BCCH_DL_SCH:[203,LTE_RRC_str,"LTE-RRC_BCCH_DL_SCH"],#"LTE-RRC_BCCH_DL_SCH"],
LTE_DL_CCCH:[204,LTE_RRC_str,"LTE-RRC_DL_CCCH"],#"LTE_DL_CCCH"],
LTE_DL_DCCH:[201,LTE_RRC_str,"LTE-RRC_DL_DCCH"],#"LTE-RRC_DL_DCCH"],
LTE_PCCH:[200,LTE_RRC_str,"LTE-RRC_PCCH"],#"LTE_PCCH"],
LTE_UL_CCCH:[205,LTE_RRC_str,"LTE-RRC_UL_CCCH"],#"LTE_UL_CCCH"],
LTE_UL_DCCH:[202,LTE_RRC_str,"LTE-RRC_UL_DCCH"],

RRC_SI_MIB:[150,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_MIB"],
RRC_SI_SB1:[181,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SB1"],
RRC_SI_SB2:[182,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SB2"],
RRC_SI_SIB1:[151,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB1"],
RRC_SI_SIB2:[152,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB2"],
RRC_SI_SIB3:[153,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB3"],
RRC_SI_SIB4:[154,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB4"],
RRC_SI_SIB5a:[155,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB5a"],
RRC_SI_SIB5b:[155,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB5b"],
RRC_SI_SIB6:[156,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB6"],
RRC_SI_SIB7:[157,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB7"],
RRC_SI_SIB11:[161,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB11"],
RRC_SI_SIB12:[162,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB12"],
RRC_SI_SIB18:[168,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB18"],
RRC_SI_SIB19:[169,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB19"],
RRC_SI_SIB20:[170,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB20"],
RRC_DL_CCCH:[102,RRC_str,"RRC_DL_CCCH"],
RRC_DL_DCCH:[103,RRC_str,"RRC_DL_DCCH"],
RRC_PAGING_TYPE1:[106,RRC_str,"RRC_DL_PCCH"],
RRC_CONN_REQ:[100,RRC_str,"RRC_UL_CCCH"],
LTE_BCCH_BCH:["LTE-RRC_BCCH_DL_SCH",LTE_RRC_str,"LTE-RRC_BCCH_DL_SCH"],#"LTE_BCCH_BCH"],
LTE_BCCH_DL_SCH:["LTE-RRC_BCCH_DL_SCH",LTE_RRC_str,"LTE-RRC_BCCH_DL_SCH"],#"LTE-RRC_BCCH_DL_SCH"],
LTE_DL_CCCH:["LTE-RRC_DL_CCCH",LTE_RRC_str,"LTE-RRC_DL_CCCH"],#"LTE_DL_CCCH"],
LTE_DL_DCCH:["LTE-RRC_DL_DCCH",LTE_RRC_str,"LTE-RRC_DL_DCCH"],#"LTE-RRC_DL_DCCH"],
LTE_PCCH:["LTE-RRC_PCCH",LTE_RRC_str,"LTE-RRC_PCCH"],#"LTE_PCCH"],
LTE_UL_CCCH:["LTE-RRC_UL_CCCH",LTE_RRC_str,"LTE-RRC_UL_CCCH"],#"LTE_UL_CCCH"],
LTE_UL_DCCH:["LTE-RRC_UL_DCCH",LTE_RRC_str,"LTE-RRC_UL_DCCH"],

RRC_SI_MIB:["RRC_MIB",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_MIB"],
RRC_SI_SB1:["RRC_SB1",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SB1"],
# RRC_SI_SB2:[182,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SB2"],
RRC_SI_SIB1:["RRC_SIB1",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB1"],
RRC_SI_SIB2:["RRC_SIB2",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB2"],
RRC_SI_SIB3:["RRC_SIB3",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB3"],
# RRC_SI_SIB4:[154,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB4"],
RRC_SI_SIB5a:["RRC_SIB5",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB5a"],
RRC_SI_SIB5b:["RRC_SIB5",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB5b"],
# RRC_SI_SIB6:[156,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB6"],
RRC_SI_SIB7:["RRC_SIB7",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB7"],
# RRC_SI_SIB11:[161,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB11"],
RRC_SI_SIB12:["RRC_SIB12",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB12"],
# RRC_SI_SIB18:[168,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB18"],
RRC_SI_SIB19:["RRC_SIB19",RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB19"],
# RRC_SI_SIB20:[170,RRC_str,"RRC_COMPLETE_SIB"],#"RRC_SI_SIB20"],
RRC_DL_CCCH:["RRC_DL_CCCH",RRC_str,"RRC_DL_CCCH"],
RRC_DL_DCCH:["RRC_DL_DCCH",RRC_str,"RRC_DL_DCCH"],
RRC_PAGING_TYPE1:["RRC_DL_PCCH",RRC_str,"RRC_DL_PCCH"],
RRC_CONN_REQ:["RRC_UL_CCCH",RRC_str,"RRC_UL_CCCH"],
# RRC_UL_CCCH,
RRC_UL_DCCH:[101,RRC_str,"RRC_UL_DCCH"],
RRC_HANDOVERTOUTRANCOMMAND:[103,RRC_str,"RRC_DL_DCCH"],#"RRC_HANDOVERTOUTRANCOMMAND"],
RRC_INTERRATHANDOVERINFO:[103,RRC_str,"RRC_DL_DCCH"],#"RRC_INTERRATHANDOVERINFO"],
EMM_SERVICE_REQUEST:[250,LTE_NAS_str,"LTE-NAS_EPS_PLAIN"]
RRC_UL_DCCH:["RRC_UL_DCCH",RRC_str,"RRC_UL_DCCH"],
RRC_HANDOVERTOUTRANCOMMAND:["RRC_DL_DCCH",RRC_str,"RRC_DL_DCCH"],#"RRC_HANDOVERTOUTRANCOMMAND"],
RRC_INTERRATHANDOVERINFO:["RRC_DL_DCCH",RRC_str,"RRC_DL_DCCH"],#"RRC_INTERRATHANDOVERINFO"],
EMM_SERVICE_REQUEST:["LTE-NAS_EPS_PLAIN",LTE_NAS_str,"LTE-NAS_EPS_PLAIN"]
}




# SMS_CP = ['0x90', '0x1', '0x0', '0x0'] #400
# MM_CM_REQ = ['0x91', '0x1', '0x0', '0x0'] # 401
# MM_AUTH_REQ = ['0x92', '0x1', '0x0', '0x0'] #402
# GMM_UL = ['0x93', '0x1', '0x0', '0x0'] #403
# # (gmm_identity_response)/(gmm_rau_comp)/gmm_service_req
# GMM_DL = ['0x94', '0x1', '0x0', '0x0'] #404
# # (gmm_rau_accept)/gmm_service_accept
# SMS_RP = ['0x95', '0x1', '0x0', '0x0'] #405
# CC_UL = ['0x9e', '0x1', '0x0', '0x0'] #414
# CC_DL = ['0x9f', '0x1', '0x0', '0x0'] #415
# SM_PDP = ['0xa0', '0x1', '0x0', '0x0'] #416
# # (modify_pdp_accept/ul)
# _2G_RR = ['0xf4', '0x1', '0x0', '0x0'] #500
# # (gprs_suspend_req_ul)/rr_ciphermode_command_dl/ul
# _2G_RR_SI = ['0xf5', '0x1', '0x0', '0x0'] #501
# _2G_RR_MEAS = ['0xf6', '0x1', '0x0', '0x0'] #502
# _2G_RR_CHNL = ['0xf7', '0x1', '0x0', '0x0'] #503

# LTE_BCCH_BCH = ['0xbc', '0x2', '0x0', '0x0']
# LTE_BCCH_DL_SCH = ['0xbd', '0x2', '0x0', '0x0']
# LTE_DL_CCCH = ['0xbe', '0x2', '0x0', '0x0']
# LTE_DL_DCCH = ['0xbf', '0x2', '0x0', '0x0']
# LTE_PCCH = ['0xc0', '0x2', '0x0', '0x0']
# LTE_UL_CCCH = ['0xc1', '0x2', '0x0', '0x0']
# LTE_UL_DCCH = ['0xc2', '0x2', '0x0', '0x0']
# RRC_SI_MIB = ['0xe8', '0x3', '0x0', '0x0']
# RRC_SI_SB1 = ['0xe9', '0x3', '0x0', '0x0']
# RRC_SI_SB2 = ['0xea', '0x3', '0x0', '0x0']
# RRC_SI_SIB1 = ['0xeb', '0x3', '0x0', '0x0']
# RRC_SI_SIB2 = ['0xec', '0x3', '0x0', '0x0']
# RRC_SI_SIB3 = ['0xed', '0x3', '0x0', '0x0']
# RRC_SI_SIB4 = ['0xee', '0x3', '0x0', '0x0']
# RRC_SI_SIB5a = ['0xef', '0x3', '0x0', '0x0']
# RRC_SI_SIB5b = ['0xf0', '0x3', '0x0', '0x0']
# RRC_SI_SIB6 = ['0xf1', '0x3', '0x0', '0x0']
# RRC_SI_SIB7 = ['0xf2', '0x3', '0x0', '0x0']
# RRC_SI_SIB11 = ['0xf6', '0x3', '0x0', '0x0']
# RRC_SI_SIB11_BIS = ['0xf7', '0x3', '0x0', '0x0']
# RRC_SI_SIB12 = ['0xf8', '0x3', '0x0', '0x0']
# RRC_BCCH_RACH = ['0x85', '0x3', '0x0', '0x0']
# RRC_DL_CCCH = ['0x86', '0x3', '0x0', '0x0']
# RRC_DL_DCCH = ['0x87', '0x3', '0x0', '0x0']
# RRC_PAGING_TYPE1 = ['0x8b', '0x3', '0x0', '0x0']
# RRC_CONN_REQ = ['0x8c', '0x3', '0x0', '0x0'] #908
# # RRC_UL_CCCH = ['0xc0', '0x3', '0x0', '0x0']
# RRC_UL_DCCH = ['0x8d', '0x3', '0x0', '0x0']
# RRC_HANDOVERTOUTRANCOMMAND = ['0x8f', '0x3', '0x0', '0x0']
# RRC_INTERRATHANDOVERINFO = ['0x90', '0x3', '0x0', '0x0']
# EMM_SERVICE_REQUEST = ['0x21', '0x3', '0x0', '0x0']
# RRC_SI_SIB18 = ['0xe', '0x4', '0x0', '0x0']
# RRC_SI_SIB19 = ['0xf', '0x4', '0x0', '0x0']
# RRC_SI_SIB20 = ['0x10', '0x4', '0x0', '0x0']

SMS_CP = '\x90\x01\x00\x00' #400
MM_CM_REQ = '\x91\x01\x00\x00' # 401
MM_AUTH_REQ = '\x92\x01\x00\x00' #402
GMM_UL = '\x93\x01\x00\x00' #403
# (gmm_identity_response)/(gmm_rau_comp)/gmm_service_req
GMM_DL = '\x94\x01\x00\x00' #404
# (gmm_rau_accept)/gmm_service_accept
SMS_RP = '\x95\x01\x00\x00' #405
CC_UL = '\x9e\x01\x00\x01' #414
CC_DL = '\x9f\x01\x00\x00' #415
SM_PDP = '\xa0\x01\x00\x00' #416
# (modify_pdp_accept/ul)
_2G_RR = '\xf4\x01\x00\x00' #500
# (gprs_suspend_req_ul)/rr_ciphermode_command_dl/ul
_2G_RR_SI = '\xf5\x01\x00\x00' #501
_2G_RR_MEAS = '\xf6\x01\x00\x00' #502
_2G_RR_CHNL = '\xf7\x01\x00\x00' #503

LTE_BCCH_BCH = '\xbc\x02\x00\x00'
LTE_BCCH_DL_SCH = '\xbd\x02\x00\x00'
LTE_DL_CCCH = '\xbe\x02\x00\x00'
LTE_DL_DCCH = '\xbf\x02\x00\x00'
LTE_PCCH = '\xc0\x02\x00\x00'
LTE_UL_CCCH = '\xc1\x02\x00\x00'
LTE_UL_DCCH = '\xc2\x02\x00\x00'
RRC_SI_MIB = '\xe8\x03\x00\x00'
RRC_SI_SB1 = '\xe9\x03\x00\x00'
RRC_SI_SB2 = '\xea\x03\x00\x00'
RRC_SI_SIB1 = '\xeb\x03\x00\x00'
RRC_SI_SIB2 = '\xec\x03\x00\x00'
RRC_SI_SIB3 = '\xed\x03\x00\x00'
RRC_SI_SIB4 = '\xee\x03\x00\x00'
RRC_SI_SIB5a = '\xef\x03\x00\x00'
RRC_SI_SIB5b = '\xf0\x03\x00\x00'
RRC_SI_SIB6 = '\xf1\x03\x00\x00'
RRC_SI_SIB7 = '\xf2\x03\x00\x00'
RRC_SI_SIB11 = '\xf6\x03\x00\x00'
RRC_SI_SIB11_BIS = '\xf7\x03\x00\x00'
RRC_SI_SIB12 = '\xf8\x03\x00\x00'
RRC_BCCH_RACH = '\x85\x03\x00\x00'
RRC_DL_CCCH = '\x86\x03\x00\x00'
RRC_DL_DCCH = '\x87\x03\x00\x00'
RRC_PAGING_TYPE1 = '\x8b\x03\x00\x00'
RRC_CONN_REQ = '\x8c\x03\x00\x00' #908
# RRC_UL_CCCH = ['0xc0', '0x3', '0x0', '0x0']
RRC_UL_DCCH = '\x8d\x03\x00\x00'
RRC_HANDOVERTOUTRANCOMMAND = '\x8f\x03\x00\x00'
RRC_INTERRATHANDOVERINFO = '\x90\x03\x00\x00'
EMM_SERVICE_REQUEST = '\x21\x03\x00\x00'
RRC_SI_SIB18 = '\x0e\x04\x00\x00'
RRC_SI_SIB19 = '\x0f\x04\x00\x00'
RRC_SI_SIB20 = '\x10\x04\x00\x00'


# mtk_log_parser_buff = [] # store bytes in current section
mtk_log_parser_buff = ''
first_header = False
Expand All @@ -246,6 +138,10 @@ def setfilter(m_type, m_enabled):
msg_enabled = msg_enabled


def ws_dissector_proc_start(ws_exec_path = None, ws_lib_path = None):
return WSDissector.init_proc(ws_exec_path, ws_lib_path)


def feed_binary(buff):
global mtk_log_parser_buff
msg_list = []
Expand All @@ -267,12 +163,14 @@ def feed_binary(buff):
pstrace = []

msg_id = mtk_log_str[6+loc:10+loc]
length = 0
if msg_id in type_id_mapping:
# calculate the length of raw_data
decimal_high = ord(mtk_log_str[10+loc])
decimal_low = ord(mtk_log_str[11+loc])
length = decimal_low * 256 + decimal_high


if length > 0 and length < new_log_len - loc:
raw_bytes = mtk_log_str[12+loc:12 + length+loc]
raw_data = map(lambda x: x if (x != '\x00') else '\x00', raw_bytes)
Expand Down Expand Up @@ -321,21 +219,27 @@ def decode(logger, raw_msg):
"""
msg_id = raw_msg[0][3]
if msg_id not in type_id_mapping:
return "",""
return "","",""

ws_dis_str = type_id_mapping[msg_id][0]
type_str = type_id_mapping[msg_id][1]
raw_str = type_id_mapping[msg_id][2]

raw_msg[0][3] = chr(type_id_mapping[msg_id][0])
# logger.log_info("qianru: " + ws_dis_str)

# raw_msg[0][3] = chr(type_id_mapping[msg_id][0])
# qianru-edit-end
# print "global_msg_id ", type_str
msg = "\\" + "\\".join([format(ord(j), '#04x')[1:] for j in raw_msg[0]])
output = msg
msg = "\\" + "\\".join([format(ord(j), '#04x')[1:] for j in raw_msg[0][8:]])
# output = msg

# logger.log_info("lizhehan: Receive message: " + msg)
# logger.log_info("qianru: Receive message: " + msg)
# qianru-edit
p = subprocess.Popen("su", executable=ANDROID_SHELL, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
output,err = p.communicate("echo -ne \'" + msg + "\' | LD_LIBRARY_PATH=" + logger.libs_path + ' ' + logger.ws_dissector_path + '\n')
p.wait()
# p = subprocess.Popen("su", executable=ANDROID_SHELL, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
# output,err = p.communicate("echo -ne \'" + msg + "\' | LD_LIBRARY_PATH=" + logger.libs_path + ' ' + logger.ws_dissector_path + '\n')
# p.wait()
output = WSDissector.decode_msg(ws_dis_str, ''.join(raw_msg[0][8:]))
# logger.log_info("qianru: " + ws_dis_str)
end = output.rfind('>') + 1
output = output[:end]
# qianru-edit
Expand Down
11 changes: 9 additions & 2 deletions mobile_insight/monitor/mtk_offline_replayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from monitor import Monitor, Event
from dm_collector import dm_collector_c, DMLogPacket, FormatError
# from monitor.dm_collector.dm_endec.ws_dissector import *
import mtk_log_parser


Expand Down Expand Up @@ -59,6 +60,10 @@ def __init__(self):

self.__test_android()

# self.ws_dissector_path = "ws_dissector"
self.ws_dissector_path = None
self.libs_path = None

if self.is_android:
libs_path = self.__get_libs_path()
ws_dissector_path = os.path.join(libs_path, "android_pie_ws_dissector")
Expand Down Expand Up @@ -223,6 +228,8 @@ def run(self):

log_list.sort() # Hidden assumption: logs follow the diag_log_TIMSTAMP_XXX format

# mtk_log_parser.ws_dissector_proc_start(self.ws_dissector_path, self.libs_path)

for file in log_list:
self.log_info("Loading " + file)
self._input_file = open(file, "rb")
Expand Down Expand Up @@ -254,11 +261,12 @@ def run(self):

##############################################
for msg in decoded:

typeid, rawid, msgstr = mtk_log_parser.decode(self, msg) #self for debug

if typeid == "":
continue
packet = DMLogPacket([("log_msg_len", len(msg), ""),('type_id', typeid, ''),('timestamp', datetime.datetime.now(), ''),("Msg", msgstr, "msg")]) # ("Msg", msgstr, "raw_msg/" + rawid)])
# print "DMLogPacket decoded[0]:",str([typeid])
event = Event( timeit.default_timer(), typeid, packet)
self.send(event)
##############################################
Expand All @@ -271,4 +279,3 @@ def run(self):
except Exception as e:
import traceback
print str(traceback.format_exc())
# sys.exit(e)

0 comments on commit 96ad884

Please sign in to comment.