This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to message-passing between models

Dear

 

I increated a Generic Level module to main elements which have a Generic ONOFF module on Mesh example Light Switch Server project base on PCA10056 DK board for nrf52840 chips.(SES + nrf5_SDK_for_Mesh_v4.0.0_src+ nRF5_SDK_16.0.0_98a08e2)

Right now The Generic Level module works well that The Brightness can be change by app of nRF mesh app on cell phone. Because the Generic Level module be implemented by PWM base on PWM model of the nrf52840, the pin of LED0 which be connected to PWM model do not be controlled by GPIO, which mean the Generic ONOFF module do not work and LED do not flash when the reset or for other situation.

My questions is

  1. I believe there must be a way to accomplish message-passing between models within elements and between models within different elements within nodes. How do I implement that?
  2. As mentioned in the first paragraph, the pin of the LED0 have to be controlled by PWM model and gpio model. Do you have any good idea for that.

 

Thanks,

 

B,Rs

 

Di-sheng

Parents
  • Hi Mttrinh

    Thanks for your repaly.

    The answer of the second question is what I want. I will change the control power by connect or disconnect the pin to PWM(PSEL.OUTàCONNECT).

    About the first question, I thinks I may not have made the first question clear. Let me take a different approach and ask specific questions:

    Q1: After a message is received by hardware RF, it is processed by SD because the RF module is not available to the user (as described in the SD manual). Then, the interrupt service routine for RF hardware interrupt should be completed by SD. My question is what does SD do when it receives this message and what is the output?

    Q2: There are two callbacks in each model definition (for example, the Generic Level Module, which defines 2 callback functions:void app_level_server_set_cb(....)  and void app_level_server_get_cb (...).). My question is by whom and where are these callbacks called?

    Q3: I think SD belongs to the Mesh stack, not to the BLE stack. My question is if an application does not use SD, what is the interrupt service routine for RF?

    Thanks

    B,Rs

    Di-sheng

  • Hi,

    1. The application should open radio session and register signal handler at the beginning of every new timeslot that SD provided to the app. Furthermore, it is up to the application to configure RF registers and provide memory for raw data. SD just generates a signal if an interrupt happens. It is up to the application of how to handle and interpret them. It is better to read SD documentation. Looks like I just rewrite it briefly.    

    2. These handlers are called by the behavioral part of the model. That happens according to model specification and depends on the appropriate model state and transition parameters. For instance, for the level model it is implemented here './examples/common/src/app_level.c'.

    3. SD and Mesh stack are autonomic software and do not belong to each other. Mesh stack reuses some functional of SD for example the timeslot system to coexist with SD or GATT. 

Reply
  • Hi,

    1. The application should open radio session and register signal handler at the beginning of every new timeslot that SD provided to the app. Furthermore, it is up to the application to configure RF registers and provide memory for raw data. SD just generates a signal if an interrupt happens. It is up to the application of how to handle and interpret them. It is better to read SD documentation. Looks like I just rewrite it briefly.    

    2. These handlers are called by the behavioral part of the model. That happens according to model specification and depends on the appropriate model state and transition parameters. For instance, for the level model it is implemented here './examples/common/src/app_level.c'.

    3. SD and Mesh stack are autonomic software and do not belong to each other. Mesh stack reuses some functional of SD for example the timeslot system to coexist with SD or GATT. 

Children
No Data
Related