zenitesolar / can_ids Goto Github PK
View Code? Open in Web Editor NEWCAN BUS protocol description with code generation for the solar boat modules and applications
License: GNU General Public License v3.0
CAN BUS protocol description with code generation for the solar boat modules and applications
License: GNU General Public License v3.0
Each data should have a description, its type and units.
Good example: https://github.com/bluerobotics/ping-protocol/blob/master/src/definitions/ping1d.json#L358
Implement a way to describe modules variations, like different signatures, specifically to be able to describe the voltage/current sensors (MSC19).
For now the consistency of the protocol is not guaranteed.
At least it needs:
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")
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;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.