Index: leahi_dialin/protocols/CAN.py =================================================================== diff -u -r779949e7648b7957c57ad970c4056e91abc0819d -r6d104d3185ac3ed7c18c97ecdc13fd59bf53a8d1 --- leahi_dialin/protocols/CAN.py (.../CAN.py) (revision 779949e7648b7957c57ad970c4056e91abc0819d) +++ leahi_dialin/protocols/CAN.py (.../CAN.py) (revision 6d104d3185ac3ed7c18c97ecdc13fd59bf53a8d1) @@ -24,16 +24,13 @@ from can.interfaces import socketcan import math from time import sleep -from datetime import datetime import sys from logging import Logger import struct -from .. import common -from ..common import MsgIds, msg_defs +from ..common import MsgIds, MSG_HEADER_SIZE, ACK_NOT_REQUIRED from ..utils import SingletonMeta, IntervalTimer from concurrent.futures import ThreadPoolExecutor -import os class DenaliMessage: BYTE_ORDER = 'little' @@ -42,7 +39,7 @@ MSG_SEQ_INDEX = 1 MSG_ID_INDEX = 3 PAYLOAD_LENGTH_INDEX = 5 - PAYLOAD_START_INDEX = 6 + PAYLOAD_START_INDEX = MSG_HEADER_SIZE PAYLOAD_LENGTH_FIRST_PACKET = 1 HEADER_LENGTH = 6 PACKET_LENGTH = 8 @@ -107,7 +104,7 @@ seq = cls._seq_num - if message_id not in common.msg_defs.ACK_NOT_REQUIRED: + if message_id not in ACK_NOT_REQUIRED: seq *= -1 message_seq_in_bytes = seq.to_bytes(2, byteorder=DenaliMessage.BYTE_ORDER, signed=True) @@ -297,7 +294,7 @@ message = DenaliMessage.build_message( channel_id=channel_id_tx, - message_id=common.msg_defs.MsgIds.MSG_ID_ACK_MESSAGE_THAT_REQUIRES_ACK.value, + message_id=MsgIds.MSG_ID_ACK_MESSAGE_THAT_REQUIRES_ACK.value, payload=payload, seq=-seq)