Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I'm trying to figure out how to process LC Server messages in BT Mesh. I'm using Modus Toolbox 2 with wiced-btsdk 2.1, and the Mesh EZ-BT Kit. I started with the mesh-demo light smart program. The mesh_app_message_handler() function is setup to process WICED_BT_MESH_LIGHT_LIGHTNESS_SET messages for the light lightness server, and this works as expected. But it doesn't seem to process any other message type. Per the Mesh spec, LC Server is supposed to be able to process LC messages such as:
Adding cases for these in the function doesn't help, and they would hit the default case anyway if they were making it to the message handler function. So my question is, how can I setup a message handler for LC Server messages?
In the current implementation, the over the air messages are processed by mesh model library. Application is notified only if HW needs to access, for example, if brightness of the bulb needs to be changed.
I guess there are multiple ways you can proceed. First you can completely bypass mesh_models library. See mesh_app_lib/mesh_application.c
// Application can set this handler to process if it implements models layer.
to return the message handler based on the opcode that has been received over the air. You can see the loop in the function that goes through all elements, and all models and it asks each model if this opcode is for this model. You can probably provide your callback for the situation if opcode is WICED_BT_MESH_OPCODE_SENSOR_STATUS. If you want your functionality in addition to the standard LC functionality, you can call