-
Notifications
You must be signed in to change notification settings - Fork 281
MyMesh Refactor and Advert Button #353
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
Conversation
Pulled the class out of main.cpp, made a header to go along with it, externed globals in headers to make them accessible to button code. Added button code to send an advert on double press. Refactored ini files to prevent linker errors.
|
I'll test this on the g2 nano tonight |
|
The project doesn't have a linter or code format def yet, but it's customary to use the predominant brace/indenting style of the repo. |
examples/companion_radio/UITask.h
Outdated
| @@ -1,4 +1,5 @@ | |||
| #pragma once | |||
| #ifndef UI_TASK_H | |||
| #define UI_TASK_H | |||
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.
'#pragma once' does this, and is very widely supported now.
variants/t114/platformio.ini
Outdated
| ; -D ENABLE_PRIVATE_KEY_EXPORT=1 | ||
| ; -D MESH_PACKET_LOGGING=1 | ||
| ; -D MESH_DEBUG=1 | ||
| -D MESH_DEBUG=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.
try not to leave these uncommented/enabled when committing
examples/companion_radio/MyMesh.h
Outdated
|
|
||
| #define PUBLIC_GROUP_PSK "izOH6cXN6mrJ5e26oRXNcg==" | ||
|
|
||
| #define CMD_APP_START 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.
the CMD_ and RESP_ codes don't need to be known by other modules, so can be moved to the .cpp file
Please review! Thanks! |
|
Thanks for the changes. Still, I'd like as many unnecessary changes as possible to be reverted. Like the simple_secure_chat/main.cpp. Doesn't look like there are any actual changes there. Same with the Button.* files. If you could revert these files please. (I know, the author of Button didn't follow code formatting, but I'd rather leave as-is, and stick to the 'no unnecessary diffs pls' principle. Also, with the clang formatter, there are still some differences, like else and else if being on same line. And function opening brace on same line. |
…nto mymesh-refactor2
…sh-refactor2 Applying a987efe
…nto mymesh-refactor2
But changing to pragma once.
|
MyMesh Refactor and Advert Button
This branch does a few things:
FIRMWARE_VERSION ends up in MyMesh.h, which can be moved if desired. main.cpp just isn't a great place for it. This brings up a potential future task of cleaning up the MyMesh classes in the different example codebases to make a proper class structure that would support Repeater, Room Server and Companion (and other) implementations.
I just tested the doublepress advert on a tbeam sx1276 and it works great, shows up immediately on another node's discover list.