-
Notifications
You must be signed in to change notification settings - Fork 33
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
For discussion: Extended commands #112
base: master
Are you sure you want to change the base?
Conversation
#define EXTENDED_CALIB_MAX 'C' | ||
#define EXTENDED_CALIB_START 's' | ||
#define EXTENDED_CALIB_STATUS 'S' | ||
#define EXTENDED_VOLTAGE_TYPE 'v' |
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.
Probably needs a better name to make it more clear what it's for.
ESP32LapTimer/src/Comms.cpp
Outdated
#define EXTENDED_WIFI_CHANNEL 'W' // half byte | ||
#define EXTENDED_WIFI_PROTOCOL 'w' // half byte | ||
#define EXTENDED_FILTER_CUTOFF 'F' | ||
#define EXTENDED_MULTIPLEX_OFF 'm' |
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.
Same here. A more descriptive name would be nice
ESP32LapTimer/src/Comms.cpp
Outdated
#define EXTENDED_WIFI_PROTOCOL 'w' // half byte | ||
#define EXTENDED_FILTER_CUTOFF 'F' | ||
#define EXTENDED_MULTIPLEX_OFF 'm' | ||
#define EXTENDED_UPDATE_PROGRESS 'U' |
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.
Remove this since it's currently unused. Could always be added back at a later point if a need for it arises.
I'm thinking it might be a good idea to be able to mark a client as supporting the extended format. I think this would only apply in a scenario where there are more than one clients connected though because i haven't seen any code that doles out data on a per client basis it goes to everyone all the time if more than one is connected. I could however be mistaken |
I added a short description on what these messages might do. I am using them in my fork, but just see them as a suggestion we might implement later. Yeah at first only one client was supported on the protocol. When I added support for multiple clients I just made everything a broadcast. |
You're right it's not that much extra data. I would like to not broadcast everything but that's for a different pull request :) Edit: |
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.
Looks good
If the implementation is correct, these messages should just be discarded. Not sure how you'd implement this wrong. No problem when using the Android app. |
I’ll test it in the iOS app |
This adds a skeleton for sending extended commands over the normal connections.
This way we'll be able to completely control everything using the normal connections and will replace the json stuff from the webserver in the future and use websockets for the communication. This allows us to make the page much more responsive (no reloading required).
The json way also consumes a large amount of dynamic memory, which should be avoided.
Still open for suggestions on how to improve this.
Test for compatability: