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

Change The Subscription Addresses Of Client In Mesh

Hi,

I am working on light switch example. I am broadcasting a message from client to servers using the API access_model_publish() with the opcode SIMPLE_ON_OFF_OPCODE_SET_UNRELIABLE. there are 3 servers in total, 0x105, 0x106, 0x107. Even though message is delivered in all three servers, I am getting the status of only  two servers (0x105, 0x106). I am taking this status from the function handle_status_cb() of the simple_on_off_client.c code. Why I am not able to get the status of the third server? I guess this is because client is only subscribed to 0x105 and 0x106. I need status of two more servers. In order get the status of remaining servers what configuration should I change?  

Parents
  • Arya said:
    I want to make several servers to send message to client. Client should receive their uni-cast address too. I looked through node_setup.c and found that I have to change a whole lot to make that happen. I don't need group cast, just uni-cast method. Each server should send message to client with their unicast address. Is that possible?

     Yes, you can use unicast address for sending messages to a particular node. You can find out how the light switch client node sends unicast messages to the server by taking a look at the button_event_handler() in the main.c file. The simple_on_off_client_set() function will send a unicast message to the first provisioned & configured server when button 1 is pressed on the client. 

    The simple_on_off_client_set() then calls access_model_reliable_publish(), which is where the unicast address of the server gets retrieved via the dsm_address_get() function.

    The unicast address also gets displayed in the provisioner during the app_health_event_callback() function in main.c

Reply
  • Arya said:
    I want to make several servers to send message to client. Client should receive their uni-cast address too. I looked through node_setup.c and found that I have to change a whole lot to make that happen. I don't need group cast, just uni-cast method. Each server should send message to client with their unicast address. Is that possible?

     Yes, you can use unicast address for sending messages to a particular node. You can find out how the light switch client node sends unicast messages to the server by taking a look at the button_event_handler() in the main.c file. The simple_on_off_client_set() function will send a unicast message to the first provisioned & configured server when button 1 is pressed on the client. 

    The simple_on_off_client_set() then calls access_model_reliable_publish(), which is where the unicast address of the server gets retrieved via the dsm_address_get() function.

    The unicast address also gets displayed in the provisioner during the app_health_event_callback() function in main.c

Children
No Data
Related