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

Using ble_nus module in central role

I'm currently developing a concurrent central/peripheral application using the nRF51, S130 and SDK 9.0.0. It uses the Nordic UART Service, and it would be nice to make use of the ble_nus module supplied in the SDK.

The ble_peripheral/ble_app_uart example in the SDK does use the ble_nus module. However, the central example in github (at github.com/.../ble_app_uart_c_S120 ) does not use ble_nus at all; instead it has its own custom code in a file called ble_uart_c.c .

Can the ble_nus module in the SDK be used in both central and peripheral applications, or is it only suitable for a peripheral role?

Thanks.

Parents
  • ble_app_uart_c_S120 is a central example with a nus client.

    There is no connection between client/server and peripheral/central, as you can see here.

    This means that it should be a problem to implement a nus server on a central device, but then you need the nus client on the peripheral device.

    Just implement it the same way as on the peripheral device, and it should work. There is an central+client example here. Or you can have a look at \examples\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay

Reply
  • ble_app_uart_c_S120 is a central example with a nus client.

    There is no connection between client/server and peripheral/central, as you can see here.

    This means that it should be a problem to implement a nus server on a central device, but then you need the nus client on the peripheral device.

    Just implement it the same way as on the peripheral device, and it should work. There is an central+client example here. Or you can have a look at \examples\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay

Children
Related