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

multiple NUS with NCS

Is it possible to use multiple NUS client with NCS ?

One of the problem i see is that nus client callback (bt_nus_client_cb) don't have information about the connection.

This is weird because in the case of the nus callback (bt_nus_cb), it has a parameter "struct bt_conn *conn".

Parents
  • Hi,

    You can’t do multiple connection with the nus.c without making any changes.

    The default implementation seems to be designed just for one connection. You need to implement the connected callback for nus and save the conn reference in the main.c so that when you do a send or receive you can add an if condition to see that the connection you want to send/receive matches.

Reply
  • Hi,

    You can’t do multiple connection with the nus.c without making any changes.

    The default implementation seems to be designed just for one connection. You need to implement the connected callback for nus and save the conn reference in the main.c so that when you do a send or receive you can add an if condition to see that the connection you want to send/receive matches.

Children
Related