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

adding second element to a light control server node mesh example

Hi, I'm trying to add another element with a simple onoff model to control a second LED on the same server node. I get APP_ERROR. I try declaring m_server0, m_server1, generic_get0_cb, generic_get1_cb, etc.. but in that way I would have to call simple_on_off_server_init(&m_server0, 0) and simple_on_off_server_init(&m_server1, 1) in configuration_setup(), but in header function of simple_on_off_server_init its written we should only call it once. What am I missing to add another element with the same simple on off model into it. thanks a lot. Also changed ACCESS_ELEMENT_COUNT

Parents
  • Hi Petter, I'm on client's project, assuming my server is OK. Do I need to change provisioner.c code to access 2 elements in a same node. In main.c access_setup seems ok to me without any change. I try this with 2 devkits, 1 clients(devkitA) controlling 2 servers in the same node(devkitB). I got the first LED working with button0 from devkitA, but I got APP_ERROR code 7 on ERROR_CHECK(status) at the end of button_event_handler when I try button1 to control the second LED (second element in the node). I suspect provisioning not binding the 2 elements to the clients model. I'm almost at a point to try adding a second led in the simpleOnOffModel, with more opcode and callback of opcode to control the other led, but I would prefer to understand adding a element with the same model before customising simpleOnOff model. Thank you

Reply
  • Hi Petter, I'm on client's project, assuming my server is OK. Do I need to change provisioner.c code to access 2 elements in a same node. In main.c access_setup seems ok to me without any change. I try this with 2 devkits, 1 clients(devkitA) controlling 2 servers in the same node(devkitB). I got the first LED working with button0 from devkitA, but I got APP_ERROR code 7 on ERROR_CHECK(status) at the end of button_event_handler when I try button1 to control the second LED (second element in the node). I suspect provisioning not binding the 2 elements to the clients model. I'm almost at a point to try adding a second led in the simpleOnOffModel, with more opcode and callback of opcode to control the other led, but I would prefer to understand adding a element with the same model before customising simpleOnOff model. Thank you

Children
No Data
Related