Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending ON_OFF set message from client node when i need to

Hi,

I want to send "ON" message to server node over mesh network when a client node receives "hello" via UART from PC

I was able to merge UART example from nrf5 sdk with light switch example from mesh_sdk_v1.0.1, 

I know this function simple_on_off_client_set send on_off message to servers to change their states but the thing is how can i  use it for sending only on message when i need to (receiving "hello" from PC) ?

Any help?

best regards,

Parents
  • I don't really understand. Isn't it we call simple_on_off_client_set () when a button pressed ? inside button_event_handler(). 

    What you need to do is to check UART and when you receive "hello" you call simple_on_off_client_set () I don't see any problem with that. 

Reply
  • I don't really understand. Isn't it we call simple_on_off_client_set () when a button pressed ? inside button_event_handler(). 

    What you need to do is to check UART and when you receive "hello" you call simple_on_off_client_set () I don't see any problem with that. 

Children
  • Yes i need to call simple_on_off_set() but i' m a bit confused, do i have to remove this function from button_event_handler() and only call it when i receive "hello"? 

  • Just play with it Arji. Up to you.

    It's just a function to send a mesh packet. Call it at as many places as you wish. Just be aware it's a reliable message, so you can't call it 2nd time before the previous one get a response. 

  • Ok, I see.

    Thank you for your response