| | |
| | | output_key_temp & 0xFF) |
| | | # output_key_temp = ((((temp_key >> 4) ^ temp_key) |
| | | # << 3) ^ temp_key) & 0xFFFFFFFF |
| | | elif level == 0x09: |
| | | elif level == 0x11: |
| | | output_key_temp = 0x70237577 |
| | | output_key = struct.pack('BBBB', (output_key_temp >> 24) & 0xFF, |
| | | (output_key_temp >> 16) & 0xFF, |
| | |
| | | self.needdisconnect.value = 0 |
| | | self._isOpen.value = 0 |
| | | else: |
| | | msg, num = self._usbcan.Receive(len=1) |
| | | msg, num = self._usbcan.Receive(len=10, timeout=10) |
| | | if not num == 0: |
| | | for i in range(num): |
| | | if msg[i].arbitration_id == self.shifter.canid.phy_txId: |
| | |
| | | if self._isOpen.value == 0: |
| | | if self._usbcan is None: |
| | | self.update_HardwareDevice() |
| | | can_filters = [{'can_id': 0x420, 'can_mask': 0xFFFFFFFF}] |
| | | can_filters = [{'can_id': 0x5E0, 'can_mask': 0xFFFFFFFF}] |
| | | |
| | | bitrate = list( |
| | | TIMING_DICT.keys())[self.devicedescription.baudrate] |
| | |
| | | for i in range(_dataSize): |
| | | receiveNum += 1 |
| | | msg = self.msgQueue.get() |
| | | if msg.arbitration_id == 0x420: |
| | | self.shifter.FramUnpack(msg.arbitration_id, msg.data) |
| | | resp_data = self.Vehicle.ShiftLogic(self.shifter) |
| | | self.send_VehiclePosition(resp_data) |
| | | # if msg.arbitration_id == 0x420: |
| | | # self.shifter.FramUnpack(msg.arbitration_id, msg.data) |
| | | # resp_data = self.Vehicle.ShiftLogic(self.shifter) |
| | | # self.send_VehiclePosition(resp_data) |
| | | formateddata.append(self._formatMsgData( |
| | | receiveNum, msg, True)) # return a data list |
| | | self._insertDataSmooth(data=formateddata, datasize=_dataSize) |
| | | self.dispShiftstatus() |
| | | # self.dispShiftstatus() |
| | | |
| | | def _insertDataSmooth(self, data, datasize): |
| | | # row = 6-datasize |
| | |
| | | "background-color:rgb(255, 85, 127)") |
| | | |
| | | def SecurityUnlockLevel_2(self): |
| | | data = self.udsclient.unlock_security_access(9) |
| | | data = self.udsclient.unlock_security_access(0x11) |
| | | if data.positive: |
| | | self.UI.pushButton_32.setStyleSheet( |
| | | "background-color:rgb(255, 85, 127)") |
| | |
| | | response = self.udsclient.change_session(3) |
| | | if response.positive: |
| | | self.disp_string('>>> 解锁安全访问') |
| | | response = self.udsclient.unlock_security_access(9) |
| | | response = self.udsclient.unlock_security_access(0x11) |
| | | |
| | | if response.positive: |
| | | # 检查编程条件 |
| | |
| | | if response.positive: |
| | | # 安全访问 |
| | | self.disp_string('>>> 安全访问') |
| | | response = self.udsclient.unlock_security_access(9) |
| | | response = self.udsclient.unlock_security_access(0x11) |
| | | # print(response) |
| | | if response.positive: |
| | | self.disp_string('>>> 请求下载驱动文件') |