Commit aab9957
committed
Add Region & Scope system foundation (MeshCore 1.10.0+)
Phase 1: Core Infrastructure and Design
EEPROM Structure Changes (v5):
- Extended NodeConfig with regions array (8 regions × 8 chars)
- Added regionCount field for tracking configured regions
- Default configuration includes wildcard "*" for backward compatibility
- EEPROM_VERSION bumped from 4 to 5
- Memory impact: +65 bytes to NodeConfig (~175 bytes total)
Files Modified:
- src/main.h: Added MC_MAX_REGIONS (8), MC_REGION_LEN (8) defines
- src/core/Config.h: Updated NodeConfig struct and EEPROM_VERSION
- src/core/Config.cpp: Updated defaultConfig with wildcard "*"
Design Document:
- docs/REGION_SCOPE_DESIGN.md: Complete implementation plan
- Architecture overview with components and data flow
- 9-phase implementation roadmap
- MeshCore protocol analysis (transport codes)
- RegionManager class design
- CLI commands specification
- Packet filtering logic design
- Testing strategy and examples
- Backward compatibility guarantees
- Performance and memory impact analysis
Key Features (Planned):
- Geographic packet filtering via scope matching
- Hierarchical region matching (e.g., "us" matches "us-co")
- Wildcard "*" for global forwarding (backward compat)
- Up to 8 configurable regions per repeater
- CLI commands: get/set/add/remove region
- MeshCore 1.10.0+ transport code support
Backward Compatibility:
- Default wildcard "*" forwards all packets
- Legacy FLOOD/DIRECT packets (no scope) always forwarded
- No breaking changes for existing deployments
- Gradual adoption path documented
Next Steps (Phase 2-9):
- Implement RegionManager class (src/mesh/RegionManager.h)
- Add transport code parsing to Packet.h
- Integrate scope filtering in shouldForward()
- Add CLI commands for region management
- Create test suite (tools/test_region_scope.py)
- Update documentation (API.md, COMMANDS.md)
This commit establishes the foundation for full Region & Scope
support. The system is designed but not yet functional - development
continues in subsequent phases as documented in REGION_SCOPE_DESIGN.md.1 parent d1d6e1a commit aab9957
4 files changed
Lines changed: 650 additions & 5 deletions
0 commit comments