OnOff example model state changing in the server

Hi!,

I am trying to create an application with BT Mesh using the nrF52840 DK and two nrF52840 Dongles with an OnOff Model Server and an OnOff Model Client respectively. The example from the SDK (I have taken that as the base code) turns the LED On in the DK when the button in the Dongles is pressed (and the Dongle also turns its LED On). I want to be able to use the button on the DK to turn its LED Off and change the status of its OnOff model. When this happend, I would also like the Dongle to turn its LED off because of a state message from the DK. In summary, I want to change the OnOff model server state form the DK and I want the Dongle to know it.

I I dont know what function I should use. I was thinking about led_set, but it has paremters from the message received from the Dongle and I supossed that it is not the correct way to do it. I have noticed about a function called led_work, but I dont understand exactly what is the purpose of it. ¿Do you know what is the correct way to implement this functionality?

Another question:

I have looked for the interrup callbak of the four buttons on the DK, and I have found button_pressed(), and the different paremeter between the four buttons on the DK was "pins". This parameter is the only one which change the value between the four buttons on the DK, so I use it to differentiate which button I have touched. Mi question is: is this correct paramenter to use? It has the following values depending on the button:

Button 1: 2048

Button 2: 4096

Button 3: 16777216

Button 4: 33554432

Thank you for your time.

 

Parents Reply Children
No Data
Related