richClubb / python-uds

A uds library for python
MIT License
97 stars 55 forks source link

suggest to add support for extended frame (CAN 2.0b) #53

Open kaizh102 opened 4 years ago

kaizh102 commented 4 years ago

seems current implementation in CanTp doesn't support diagnostic frame with 29-bit identifier. The parameter "extended" in bus.sent() method inside CanTp class is hard coded to "False". Suggest to add support for extended frames.

kaizh102 commented 2 years ago

line 47 of .\uds\uds_communications\TransportProtocols\Can\CanConnection.py, "extended=False" makes it impossible to support diagnostics over extended CAN ID.

    def transmit(self, data, reqId, extended=True):
        canMsg = can.Message(arbitration_id=reqId, extended_id=extended)
        canMsg.dlc = 8

        canMsg.data = data

        self.__bus.send(canMsg)