Add developer example module#10452
Conversation
|
|
b951c10 to
a8a2455
Compare
|
Force-pushed to clean up commit history. What changed in the force push:
No functional changes, just a cleaner diff for review. |
|
Minimal portnums.pb.h change with EXAMPLE_APP = 14 Please do not include ANY generated files in PR's - these will generate merge conflicts of the nasty kind once the protobuf PR is merged. What about putting this example on PRIVATE_APP portnum? |
|
Makes sense. I'll switch the example module to PRIVATE_APP, remove the generated portnums.pb.h change entirely so this PR contains no generated files, and close the protobuf PR since it won't be needed anymore. |
- Add ExampleModule.h and ExampleModule.cpp with full lifecycle comments - Register module in Modules.cpp behind MESHTASTIC_EXCLUDE_EXAMPLE flag - Add flag to configuration.h and platformio.ini (disabled by default) - Use PRIVATE_APP portnum to avoid generated protobuf file changes Relates to Discussion meshtastic#10422
a8a2455 to
6aa5fe0
Compare
|
Changes in this push:
This PR now contain no generated files and avoid the merge-conflict risk you pointed out. |
|
@caveman99 Updated this yesterday based on your feedback. Let me know if this looks like the right direction now. |
Summary
Adds a disabled-by-default ExampleModule as a heavily-commented reference implementation for developers learning how to create firmware modules.
This follows up on Discussion #10422:
#10422
What changed
What does NOT change
Rationale
The current ReplyModule is useful but very small. It only demonstrates allocReply() and does not show the full lifecycle of a Meshtastic module.
ExampleModule is intentionally didactic and demonstrates:
Runtime impact
None by default.
The module is excluded from normal builds with:
-DMESHTASTIC_EXCLUDE_EXAMPLE=1Developers can enable it locally by removing or undefining that flag.
Testing