def __init__(self, arb_id_request, arb_id_response, bus=None): MockEcu.__init__(self, bus) self.ARBITRATION_ID_REQUEST = arb_id_request self.ARBITRATION_ID_RESPONSE = arb_id_response self.iso_tp = iso15765_2.IsoTp( arb_id_request=self.ARBITRATION_ID_REQUEST, arb_id_response=self.ARBITRATION_ID_RESPONSE, bus=self.bus)
def setUp(self): # Initialize mock ECU self.ecu = MockEcuIsoTp(self.ARB_ID_REQUEST, self.ARB_ID_RESPONSE) self.ecu.start_server() # Initialize virtual CAN bus can_bus = can.Bus(DEFAULT_INTERFACE) # Setup ISO-TP layer self.tp = iso15765_2.IsoTp(self.ARB_ID_REQUEST, self.ARB_ID_RESPONSE, bus=can_bus)
def setUp(self): # Initialize mock ECU self.ecu = MockEcuIso14229(self.ARB_ID_REQUEST, self.ARB_ID_RESPONSE) self.ecu.start_server() # Initialize virtual CAN bus can_bus = can.Bus(DEFAULT_INTERFACE, bustype="socketcan") # Setup diagnostics on top of ISO-TP layer self.tp = iso15765_2.IsoTp(self.ARB_ID_REQUEST, self.ARB_ID_RESPONSE, bus=can_bus) self.diagnostics = iso14229_1.Iso14229_1(self.tp) # Reduce timeout value to speed up testing self.diagnostics.P3_CLIENT = 0.5