-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update protocol definitions #229
Conversation
Reviewer's Guide by SourceryThis pull request updates the protocol definitions in the File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @bessman - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please provide more context and documentation for these changes. Why are the NRF-related definitions being removed? What's the rationale behind replacing multiple baud rate definitions with UART_PASSTHROUGH?
- Consider adding inline comments or updating the PR description to explain the new sensor definitions and how they improve the system's functionality.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
SETBAUD = Byte.pack(12) | ||
BAUD9600 = Byte.pack(1) | ||
BAUD14400 = Byte.pack(2) | ||
BAUD19200 = Byte.pack(3) | ||
BAUD28800 = Byte.pack(4) | ||
BAUD38400 = Byte.pack(5) | ||
BAUD57600 = Byte.pack(6) | ||
BAUD115200 = Byte.pack(7) | ||
BAUD230400 = Byte.pack(8) | ||
BAUD1000000 = Byte.pack(9) | ||
|
||
# /*-----------NRFL01 radio module----------*/ | ||
NRFL01 = Byte.pack(13) | ||
NRF_SETUP = Byte.pack(1) | ||
NRF_RXMODE = Byte.pack(2) | ||
NRF_TXMODE = Byte.pack(3) | ||
NRF_POWER_DOWN = Byte.pack(4) | ||
NRF_RXCHAR = Byte.pack(5) | ||
NRF_TXCHAR = Byte.pack(6) | ||
NRF_HASDATA = Byte.pack(7) | ||
NRF_FLUSH = Byte.pack(8) | ||
NRF_WRITEREG = Byte.pack(9) | ||
NRF_READREG = Byte.pack(10) | ||
NRF_GETSTATUS = Byte.pack(11) | ||
NRF_WRITECOMMAND = Byte.pack(12) | ||
NRF_WRITEPAYLOAD = Byte.pack(13) | ||
NRF_READPAYLOAD = Byte.pack(14) | ||
NRF_WRITEADDRESS = Byte.pack(15) | ||
NRF_TRANSACTION = Byte.pack(16) | ||
NRF_START_TOKEN_MANAGER = Byte.pack(17) | ||
NRF_STOP_TOKEN_MANAGER = Byte.pack(18) | ||
NRF_TOTAL_TOKENS = Byte.pack(19) | ||
NRF_REPORTS = Byte.pack(20) | ||
NRF_WRITE_REPORT = Byte.pack(21) | ||
NRF_DELETE_REPORT_ROW = Byte.pack(22) | ||
|
||
NRF_WRITEADDRESSES = Byte.pack(23) | ||
|
||
# ---------Non standard IO protocols-------- | ||
|
||
NONSTANDARD_IO = Byte.pack(14) | ||
# HX711_HEADER = Byte.pack(1) | ||
HCSR04_HEADER = Byte.pack(2) | ||
# AM2302_HEADER = Byte.pack(3) | ||
# TCD1304_HEADER = Byte.pack(4) | ||
# STEPPER_MOTOR = Byte.pack(5) | ||
UART_PASSTHROUGH = Byte.pack(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider explaining the purpose and usage of UART_PASSTHROUGH
Adding a brief comment about how UART_PASSTHROUGH is used would improve code clarity and maintainability.
SETBAUD = Byte.pack(12) | |
BAUD9600 = Byte.pack(1) | |
BAUD14400 = Byte.pack(2) | |
BAUD19200 = Byte.pack(3) | |
BAUD28800 = Byte.pack(4) | |
BAUD38400 = Byte.pack(5) | |
BAUD57600 = Byte.pack(6) | |
BAUD115200 = Byte.pack(7) | |
BAUD230400 = Byte.pack(8) | |
BAUD1000000 = Byte.pack(9) | |
# /*-----------NRFL01 radio module----------*/ | |
NRFL01 = Byte.pack(13) | |
NRF_SETUP = Byte.pack(1) | |
NRF_RXMODE = Byte.pack(2) | |
NRF_TXMODE = Byte.pack(3) | |
NRF_POWER_DOWN = Byte.pack(4) | |
NRF_RXCHAR = Byte.pack(5) | |
NRF_TXCHAR = Byte.pack(6) | |
NRF_HASDATA = Byte.pack(7) | |
NRF_FLUSH = Byte.pack(8) | |
NRF_WRITEREG = Byte.pack(9) | |
NRF_READREG = Byte.pack(10) | |
NRF_GETSTATUS = Byte.pack(11) | |
NRF_WRITECOMMAND = Byte.pack(12) | |
NRF_WRITEPAYLOAD = Byte.pack(13) | |
NRF_READPAYLOAD = Byte.pack(14) | |
NRF_WRITEADDRESS = Byte.pack(15) | |
NRF_TRANSACTION = Byte.pack(16) | |
NRF_START_TOKEN_MANAGER = Byte.pack(17) | |
NRF_STOP_TOKEN_MANAGER = Byte.pack(18) | |
NRF_TOTAL_TOKENS = Byte.pack(19) | |
NRF_REPORTS = Byte.pack(20) | |
NRF_WRITE_REPORT = Byte.pack(21) | |
NRF_DELETE_REPORT_ROW = Byte.pack(22) | |
NRF_WRITEADDRESSES = Byte.pack(23) | |
# ---------Non standard IO protocols-------- | |
NONSTANDARD_IO = Byte.pack(14) | |
# HX711_HEADER = Byte.pack(1) | |
HCSR04_HEADER = Byte.pack(2) | |
# AM2302_HEADER = Byte.pack(3) | |
# TCD1304_HEADER = Byte.pack(4) | |
# STEPPER_MOTOR = Byte.pack(5) | |
UART_PASSTHROUGH = Byte.pack(1) | |
# SETBAUD is used to set the baud rate for serial communication | |
SETBAUD = Byte.pack(12) | |
# UART_PASSTHROUGH enables UART passthrough mode | |
UART_PASSTHROUGH = Byte.pack(1) |
Summary by Sourcery
This pull request updates the protocol definitions by removing outdated baud rate and NRFL01 radio module definitions, and adding new definitions for UART passthrough and various sensors.