Giter VIP home page Giter VIP logo

pyusbtin's Introduction

pyUSBtin

This is the python implementation of the USBtin API based on https://github.com/EmbedME/USBtinLib

STATUS: mostly untested, examples/message_handling.py working on python 3.5 and 2.7

pyusbtin's People

Contributors

danielhrisca avatar fishpepper avatar isaachook avatar jochist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyusbtin's Issues

DBC handling ignores the "byte_order" field

The DBC loader reads in and remembers the endian flag of signals, calling it "byte_order". It then completely ignores it and makes no use of it at all.
This means it will not cope with big-endian messages - which is most of them where I work!

DBC parser barfs on negative numbers

If the scaling factor of a signal uses a negative gain or, more commonly, offset, the load_dbc method's regex (like I said elsewhere, BAD IDEA) fails.

Exception class fails to initialise (raises exception)

The init method of USBtinException uses the "super" operator with no arguments, which throws an exception on at least some versions of Python. It should instead say:
def __init__(self, *args, **kwargs): super(USBtinException, self).__init__(*args, **kwargs)

The load_dbc method fails if the DBC file has non-native line endings

Running PyUSBTin on Linux but with a DBC file written by a Windows program (Kvaser DB Editor) results in only the first frame (message) being loaded but all the defined signals being allocated to it.
I'd provide a patch but the "parser" uses regex's - which is a really bad idea nearly all the time - so it's rather hard to figure out how to fix it.

Something wrong with close_can_channel()

Thanks for writing this project. But when i using this API, i found out there something wrong with close_can_channel function, it trapped into a deadloop and never get channel closed.

The filtermask submodule isn't valid Python!

The author of the filtermask module appears to have been writing in a language other than Python.
The class defines two __init__ methods in an attempt to create overloaded constructors like in C++ or Java. This does not work in Python - the second definition merely overwrites the first and the first is thrown away.
Once in the __init__ method, the first thing that happens is the 'registers' member is set to be an empty list of zero length. Then it tries to set the first four elements of this zero-length list, which don't exist because it's zero length!

DBC scalings applied wrongly

In the getattribute method of CANMessage, around line 270 of canmessage.py:
if (factor, offset) == (1, 0): return value else: return (value - offset) * factor
This is wrong. The offset in a DBC file is defined in engineering units and should be added after the multiplication
return (value * factor ) + offset
The equivalent error also exists in the setattr method

See the Kvaser help page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.