vedderb / bldc

The VESC motor control firmware
2.09k stars 1.31k forks source link

Feature Discussion: Strong-Typed Packet ID #613

Closed Electro707 closed 1 year ago

Electro707 commented 1 year ago

This is a change I can make thru a PR, but I want to get the community's opinion first before I create it.

I think that COMM_PACKET_ID and CAN_PACKET_ID should be strongly typed (by that I mean hard-coding the packet ID number in the enum), as those enum's are used by external applications (such as a Python application) which needs to know the packet ID number instead of looking thru the enum's order, and it will be a safeguard against any accidental changes/additions to the packet ID to prevent ID changes unless explicitly desired.

casainho commented 1 year ago

I also feel that need, as I am working on a small Python (CircuitPython) that runs on ESP32 and interfaces with VESC over UART. I also feel that COMM_PACKET_ID and CAN_PACKET_ID should have hard-coded numbers on the enum.

Electro707 commented 1 year ago

Closing issue due to merged branch.