Beispiel #1
0
 def QueryCurGPSInfo(self, msg, id):
     try:
         body_info = msg[14:]
         result, index = self.get_gps(body_info)
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurGPSInfo error:%s' % e)
Beispiel #2
0
 def QueryCurTBOXVERInfo(self, msg, id):
     try:
         body_info = msg[14:]
         result = {'TBOX版本信息': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurTBOXVERInfo error:%s' % e)
Beispiel #3
0
 def QueryCurWANConnInfo(self, msg, id):
     try:
         wan_status = msg[14:]
         db_content = self.get_wan(wan_status)
         self.set_db_data(db_content, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurWANConnInfo error:%s' % e)
Beispiel #4
0
 def QueryCurCallStatus(self, msg, id):
     try:
         body_info = Common.CommonVar.CALL_STATUE.get(int(msg[14:16], 16))
         result = {'当前通话状态': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurCallStatus error:%s' % e)
Beispiel #5
0
 def QueryCurToken(self, msg, id):
     try:
         body_info = msg[14:64 + 14]
         result = {'当前用户Token': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurToken error:%s' % e)
Beispiel #6
0
 def QueryCurPrivacyModeSetting(self, msg, id):
     try:
         body_info = Common.CommonVar.PRIVACY_MODE.get(int(msg[14:16], 16))
         result = {'当前用户私有数据搜集设置': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurPrivacyModeSetting error:%s' % e)
Beispiel #7
0
 def QueryCurMechKeyInfo(self, msg, id):
     try:
         body_info = msg[14:22]
         result = {'当前机械钥匙信息': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurMechKeyInfo error:%s' % e)
Beispiel #8
0
 def QueryCurIMSI(self, msg, id):
     try:
         body_info = msg[14:44]
         result = {'IMSI': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurIMSI error:%s' % e)
Beispiel #9
0
 def QueryCurActivationInfo(self, msg, id):
     try:
         body_info = msg[14:]
         CurActivationInfo = self.get_active_info(body_info)
         self.set_db_data(CurActivationInfo, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurActivationInfo error:%s' % e)
Beispiel #10
0
 def QueryCurRoamingSetting(self, msg, id):
     try:
         body_info = Common.CommonVar.ROAMING_SETTING.get(
             int(msg[14:16], 16))
         result = {'当前漫游设置': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurRoamingSetting error:%s' % e)
Beispiel #11
0
 def QueryCurCSQ(self, msg, id):
     try:
         data = int(msg[14:16], 16)
         if data != 99:
             body_info = str(data)
         elif data == 99:
             body_info = SINGLE.get(99)
         result = {'当前信号强度': body_info}
         self.set_db_data(result, id, 'avnpara')
     except Exception as e:
         logger.info('QueryCurCSQ error:%s' % e)
Beispiel #12
0
 def auth(self):
     try:
         #切换通道
         self.SendMsgForResp(ext_CANmsg)
         time.sleep(0.01)
         #发送keep msg
         #self.SendMsgForResp(keep_CANmsg)
         # 发送鉴权
         seedlist = self.SendMsgForResp(seed_CANmsg)
         time.sleep(0.01)
         seedList = seedlist.get('DATA')
         seedList.pop()
         seedStr = ''.join(seedList)
         # print(int(seedStr, 16))
         seedCalc = c_ulong(int(seedStr, 16))
         self.sa.Seed2Key.restype = c_ulong
         #生成二次挑战码
         keyRst = self.sa.Seed2Key(seedCalc, c_int(1))
         # print(keyRst, hex(keyRst))
         keyStr = str((hex(keyRst)))[2:]
         lenth = len(keyStr)
         for i in range(4):
             if (lenth - (2 * i)) > 0:
                 DiagDict['key_CANmsg']['DATA'][6 - i] = keyStr[-(2 * (i + 1)):(lenth - (2 * i))].zfill(2)
             else:
                 DiagDict['key_CANmsg']['DATA'][6 - i] = '00'
         rstData = self.SendMsgForResp(DiagDict['key_CANmsg'])
         time.sleep(0.01)
         if len(rstData) > 0:
             logger.info('诊断CAN鉴权成功')
             return (True, '')
         else:
             logger.info('诊断CAN鉴权失败')
     except Exception as e:
         logger.info('诊断CAN鉴权失败:%s' % e)
         reason = str(e)
         return (False, reason)