Git Product home page Git Product logo

can_ids's People

Contributors

alejopm03 avatar ayresgit avatar gabrielgunthercenteno avatar guilhermecv avatar joaoantoniocardoso avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

salamandra7

can_ids's Issues

Verify consistency

For now the consistency of the protocol is not guaranteed.

At least it needs:

  • to check the data types before describe bytes and bits, also before add topics and modules.
  • to check for any duplicated modules ids and topics ids before import or export.

Describe all topics from all modules

List all modules and its topics, then create a python script describing them. Ex:

from can import Can
can = Can()

m1 = can.module(...)
t1 = can.topic(...)
t1.describe_byte(...)
t1.describe_bit(...)
...
m1.add_topic(t1)
can.add_module(m1)
...
can.export_json("can_ids.json")

can parser types: values with more than 1 byte are generated wrong

when values are separated in bytes all parts are with the total size, instead of the size of the part
Example:

// Auxiliar Battery Voltage
typedef struct
{
    union {
        uint8_t raw[8];
        struct {
            uint8_t signature;  // Senders signature. Units: 
            uint16_t batvoltage_l;  // Battery Voltage, byte low. Units: V/100
            uint16_t batvoltage_h;  // Battery Voltage, byte high. Units: V/100
            uint16_t position_l;  // Tail Poisition, byte low. Units: °/100
            uint16_t position_h;  // Tail Poisition, byte high. Units: °/100
            uint16_t batcurrent_l;  // Battery Current, byte low. Units: A/100
            uint16_t batcurrent_h;  // Battery Current, byte high. Units: A/100
        };
    };
} can_mde22_steeringbat_measurements_msg_t;

This should be:

// Auxiliar Battery Voltage
typedef struct
{
    union {
        uint8_t raw[8];
        struct {
            uint8_t signature;  // Senders signature. Units: 
            uint16_t batvoltage;  // Battery Voltage. Units: V/100
            uint16_t position;  // Tail Poisition. Units: °/100
            uint16_t batcurrent;  // Battery Current. Units: A/100
        };
    };
} can_mde22_steeringbat_measurements_msg_t;

Or:

// Auxiliar Battery Voltage
typedef struct
{
    union {
        uint8_t raw[8];
        struct {
            uint8_t signature;  // Senders signature. Units: 
            union{
                uint16_t batvoltage;
                struct{
                    uint8_t batvoltage_l;  // Battery Voltage, byte low. Units: V/100
                    uint8_t batvoltage_h;  // Battery Voltage, byte high. Units: V/100
                };
            };
        };
    };
} can_mde22_steeringbat_measurements_msg_t;

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.