Exemplo n.º 1
0
 def __init__(self, arb_id_request, arb_id_response, bus=None):
     MockEcu.__init__(self, bus)
     self.ARBITRATION_ID_ISO_14229_REQUEST = arb_id_request
     self.ARBITRATION_ID_ISO_14229_RESPONSE = arb_id_response
     self.iso_tp = iso15765_2.IsoTp(
         arb_id_request=self.ARBITRATION_ID_ISO_14229_REQUEST,
         arb_id_response=self.ARBITRATION_ID_ISO_14229_RESPONSE,
         bus=self.bus)
     self.diagnostics = iso14229_1.Iso14229_1(tp=self.iso_tp)
Exemplo n.º 2
0
 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