Skip to content

Fr/117 fr meshx cpp shift#121

Open
pranjalchanda08 wants to merge 23 commits intorel/120-release-v05from
fr/117-fr-meshx-cpp-shift
Open

Fr/117 fr meshx cpp shift#121
pranjalchanda08 wants to merge 23 commits intorel/120-release-v05from
fr/117-fr-meshx-cpp-shift

Conversation

@pranjalchanda08
Copy link
Copy Markdown
Owner

No description provided.

Generic Client model completed
Light Client model completed
Generic Server in progress
…tation

Key Changes:
Header Includes: Added Light Server headers to meshx_c_header.h
Code Formatting: Fixed spacing and alignment in Generic model headers
Virtual Destructors: Made destructors explicitly virtual for proper inheritance
Function Fix: Corrected plat_send_msg() call in Light Server - removed invalid data_len parameter
Constants: Made magic numbers constexpr for better type safety
Documentation: Added comprehensive comments for callback registration/deregistration functions
Files Modified:
meshx_c_header.h
 - Added Light Server includes
meshx_base_model_generic.hpp
 - Formatting and virtual destructor fixes
meshx_base_model_light.cpp
 - Fixed platform send function call
meshx_base_model_class.hpp/cpp - Documentation and constant improvements
 call in Light Server - removed invalid data_len parameter
Constants: Made magic numbers constexpr for better type safety
Documentation: Added comprehensive comments for callback registration/deregistration functions
Files Modified:
meshx_c_header.h
 - Added Light Server includes
meshx_base_model_generic.hpp
 - Formatting and virtual destructor fixes
meshx_base_model_light.cpp
 - Fixed platform send function call
meshx_base_model_class.hpp/cpp - Documentation and constant improvements
…ID validation.

Modified meshx_base_model_class.hpp: Changed validate_client_model_id from static to virtual pure in meshXBaseClientModel for extensibility.
Added meshx_model_class.hpp: Template declarations for meshXModel, meshXServerModel, and meshXClientModel as wrappers around base models.
Added meshx_model_generic.hpp: Initial implementation of meshXGenericOnOffClientModel(note: constructor name mismatch with class name).
Added meshx_model_class.cpp: Implementations for the model class constructors.
GenericBaseModelServer state restore implementation
LightBaseModelServer state restore implementation
@pranjalchanda08 pranjalchanda08 added this to the Release v0.5 milestone Oct 27, 2025
@pranjalchanda08 pranjalchanda08 self-assigned this Oct 27, 2025
@pranjalchanda08 pranjalchanda08 added Feature New feature or request MeshX BLE Mesh Any BLE Mesh related issue or Feature labels Oct 27, 2025
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch 6 times, most recently from 24a14cd to 4eb59e3 Compare October 28, 2025 19:11
model_from_ble_cb updated for All Server model
Build failure fix. Added models to model_profile.yml
Documentation updates
doxygen Config fixes
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch 2 times, most recently from 1f18bd8 to 69d8d95 Compare October 30, 2025 04:53
Documentation updated
Generic Sever models updated `plat_model_create` and `plat_model_delete` functions
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from 69d8d95 to 2b5b9c3 Compare October 30, 2025 16:11
- Add new control model header file for MeshX CTL models
- Add include guards to generic model headers that were missing them
- Add documentation to battery model create function
- Fix header inclusion issues to prevent multiple definition errors
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from 7bb439a to 3a8f8a7 Compare November 9, 2025 16:34
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from 095c3e1 to df0a480 Compare November 23, 2025 14:39
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from df0a480 to 312dd8c Compare November 23, 2025 14:50
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from c87105b to b6d1ff3 Compare December 14, 2025 14:31
Add new common model C++ implementation files and directories to support
enhanced mesh configuration server functionality. Include mesh config server
header in the main C header to enable configuration server access across the
meshx component.
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from b6d1ff3 to 56c035e Compare December 14, 2025 14:46
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from ff8f914 to ffb1b28 Compare December 24, 2025 10:19
Add meshXRelayServerElement and meshXRelayClientElement classes with
Generic OnOff model support for the MeshX BLE mesh network.

As part of this implementation, refactor all model constructors to remove
the model_id and p_plat_model parameter. Model IDs are now hardcoded within each model
constructor initializer list and p_plat_model is set to `nullptr`, simplifying the API and improving code
maintainability across all generic, light, and config models.

Doxygen CI workflow temporarily disabled by renaming the doxygen_ci.yml file to doxygen_ci.yml_old.
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from ffb1b28 to 49aab31 Compare December 24, 2025 10:56
Add server and client element classes for CWWW (Cool White - Warm White)
lighting control in the BLE mesh network. These elements combine Generic
OnOff and Light CTL models to provide tunable white light functionality.
- Add element context structures for state persistence matching C implementation
- Refactor on_model_cb signature to include param_size parameter
- Add element_state_change_notify virtual function for derived element classes
- Add element_state_change_handle pure virtual function to model interface
- Add parent element state pointer to models for centralized state management
- Modify model constructors to accept parent element state parameter
- Add template parameter to element hierarchy for type-safe callbacks
- Fix typo: CWWWW_CLIENT → CWWW_CLIENT
- Add MODULE_ID_ELEMENT_ROOT
- Remove doxygen-awesome-css submodule

BREAKING CHANGE: Model constructors now require parent element state parameter. on_model_cb signature changed to include param_size. Element classes now use template parameter for type safety.
This commit refactors the mesh model layer to introduce consistent state
management across all model types. Key changes include:

- Introduce model-specific state structures for each model type
- Refactor message structures to use unified headers with state fields
- Add model_state member to track BLE layer state in models
- Add parent_element_state parameter to model constructors
- Implement element_state_change_handle() for state synchronization
- Remove const qualifier from meshx_state_change_notify methods

This refactoring centralizes state management, separates state from transport
details, and enables better state synchronization between models and elements.
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch 3 times, most recently from 0c30f77 to bb16f34 Compare January 5, 2026 04:00
Move element notification logic from individual model implementations to a
common base class method to reduce code duplication and improve maintainability.

Changes:
- Moved meshXElementIF definition from meshx_element_class.hpp to
  meshx_fwd_decl.hpp for better forward declaration support
- Added prepare_element_msg() pure virtual method to meshXModelIF
- Added send_to_parent_element() common implementation to handle element
  state change and notification in one place
- Added update_element_state_change_header() virtual method for type-specific
  header casting in client/server models
- Refactored all model implementations (Config, Generic, Light) to store
  element messages as member variables and implement prepare_element_msg()
- Removed direct on_model_cb() calls from individual model implementations

This eliminates repetitive boilerplate code across 20+ model classes and
establishes a consistent pattern for element-state-to-model communication.
@pranjalchanda08 pranjalchanda08 marked this pull request as ready for review January 5, 2026 04:06
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from bb16f34 to 2d6f66f Compare January 5, 2026 04:17
@pranjalchanda08 pranjalchanda08 requested a review from a user January 5, 2026 04:21
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from b429ed7 to d4901cf Compare January 7, 2026 18:01
Remove duplicate `list_ven_models()` implementations from derived element classes
(CWWW, Relay, Root) that simply returned 0, now using default base class
implementation. Add `evt_model_id_t` type alias for `control_task_msg_evt_t` to
improve code clarity and consistency across model classes. Mark several element
getter methods as `final` to prevent overriding in derived classes. Add
documentation to model base class methods and improve code formatting
throughout model implementations.
@pranjalchanda08 pranjalchanda08 force-pushed the fr/117-fr-meshx-cpp-shift branch from d4901cf to bbddb8f Compare January 7, 2026 18:08
Move meshx component files into a more organized hierarchy under the
ble_mesh subdirectory. This restructure separates base model, common,
elements, model, and interface components into their respective
directories for better code organization and maintainability.
@ghost
Copy link
Copy Markdown

ghost commented Jan 10, 2026

install uncrustify. generate config with AI.
in vscode you can call the autoformat when you save it.

@pranjalchanda08 pranjalchanda08 linked an issue Jan 10, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature or request MeshX BLE Mesh Any BLE Mesh related issue or Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: MeshX CPP shift

1 participant