diff --git a/chassis-powertrain-body-setup/ecu_coordinator.py b/chassis-powertrain-body-setup/ecu_coordinator.py index 41a0103fa8003482065bc048562e839e09b4a932..8ed1bac6abbc248072b2cf0f65441584e6ddb92c 100644 --- a/chassis-powertrain-body-setup/ecu_coordinator.py +++ b/chassis-powertrain-body-setup/ecu_coordinator.py @@ -7,29 +7,7 @@ from scapy.config import conf # from scapy.contrib.cansocket_python_can import CANSocket from scapy.contrib.cansocket import CANSocket from scapy.main import load_contrib -from time import sleep import multiprocessing as mp -import can - - -def coordinate_python_can(): - # create a bus instance using 'with' statement, - # this will cause bus.shutdown() to be called on the block exit; - # many other interfaces are supported as well (see documentation) - with can.Bus(interface='socketcan', channel='vcan0', receive_own_messages=True) as bus: - # send a message - message = can.Message(arbitration_id=123, is_extended_id=False, - data=[0x11, 0x22, 0x33]) - bus.send(message, timeout=0.2) - - # iterate over received messages - # for msg in bus: - # print(f"{msg.arbitration_id:X}: {msg.data}") - - # or use an asynchronous notifier - _ = can.Notifier(bus, [can.Logger("recorded.log"), can.Printer()]) - sleep(5) - def get_filtered_can_socket(vehicle_segment: VehicleSegment): filters = [{'can_id': f.value, 'can_mask': 0x7FF} for f in CANFrame if