1 Reply Latest reply on Nov 7, 2019 2:30 AM by DheerajP_41

    some  questions about bt  mesh

    mawu_4270096

      as  we know, a bt mesh device may include more than one elements, and a element may include many models

      take light ctl server as example. the  mesh  light ctl server includes two elements:  WICED_BT_MESH_MODEL_LIGHT_CTL_SERVER   and  WICED_BT_MESH_MODEL_LIGHT_CTL_TEMPERATURE_SERVER

       

      the  WICED_BT_MESH_MODEL_LIGHT_CTL_SERVER   includes  many models :

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_DEFTT_SRV, wiced_bt_mesh_model_default_transition_time_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SRV, wiced_bt_mesh_model_scene_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCENE_SETUP_SRV, wiced_bt_mesh_model_scene_setup_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCHEDULER_SRV, wiced_bt_mesh_model_scheduler_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_SCHEDULER_SETUP_SRV, wiced_bt_mesh_model_scheduler_setup_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_TIME_SRV, wiced_bt_mesh_model_time_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_TIME_SETUP_SRV, wiced_bt_mesh_model_time_setup_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_SRV, wiced_bt_mesh_model_onoff_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_POWER_ONOFF_SRV, wiced_bt_mesh_model_power_onoff_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_POWER_ONOFF_SETUP_SRV, wiced_bt_mesh_model_power_onoff_setup_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_SRV, wiced_bt_mesh_model_level_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LIGHTNESS_SRV, wiced_bt_mesh_model_light_lightness_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV,  wiced_bt_mesh_model_light_lightness_setup_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_CTL_SRV, wiced_bt_mesh_model_light_ctl_server_message_handler, wiced_bt_mesh_model_light_ctl_server_scene_store_handler, wiced_bt_mesh_model_light_ctl_server_scene_recall_handler }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_CTL_SETUP_SRV, wiced_bt_mesh_model_light_ctl_setup_server_message_handler, NULL, NULL  }

       

      the WICED_BT_MESH_MODEL_LIGHT_CTL_TEMPERATURE_SERVER includes models:

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_SRV, wiced_bt_mesh_model_level_server_message_handler, NULL, NULL }, \

          { MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_LIGHT_CTL_TEMPERATURE_SRV, wiced_bt_mesh_model_light_ctl_temperature_server_message_handler, NULL, NULL }

       

      the  mesh  light ctl devices have three functions:

         1.  on/off

        2.  level

      3.  light temperature

       

      as  I  know, the  device can receive the on/off command in the  message  handler of   the WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_SRV model

      the  device can receive the level  command in the  message  handler of   the WICED_BT_MESH_CORE_MODEL_ID_GENERIC_LEVEL_SRV model

      the  device can receive the  temperature command in the  message  handler of   the WICED_BT_MESH_CORE_MODEL_ID_LIGHT_CTL_TEMPERATURE_SRV model

       

      however the  sdk  use  the  Library Functions  wiced_bt_mesh_model_light_ctl_temperature_server_message_handler,wiced_bt_mesh_model_onoff_server_message_handler,wiced_bt_mesh_model_level_server_message_handler. 

       

       

      wiced_bt_mesh_model_light_ctl_server_init(MESH_LIGHT_CTL_SERVER_ELEMENT_INDEX, mesh_app_message_handler, is_provisioned);

       

      the  sdk code support  only one  app  message handlermesh_app_message_handler

      I  want to know if  the different models message which are on/off ,level , light temperature can be  received in the  mesh_app_message_handler!

       

      if  i can receive these message and  process the  messages in the  message handler of   the  according models !

       

       

      thanks!

       

      mandy

        • 1. Re: some  questions about bt  mesh
          DheerajP_41

          According to the spec: Implementation of the a model will be completed only if we include the all associated models and it's initiation.

           

          The Light CTL Server model extends the Light Lightness Server model (see Section 6.4.1). When this model is present on an Element, the corresponding Light CTL Temperature Server model (see Section 6.4.4) and the corresponding Light CTL Setup Server model (see Section 6.4.5) shall also be present.

           

          All valid mesh messages will be received by the app_message_handler, since we are initializing the primary model in the mesh_app_init () function. The depended models will be initialized by the core.

           

          Thanks,

          -Dheeraj

          1 of 1 people found this helpful