I'am actually trying to develop a BLE based remote, with NRF52832, S132.
This remote must be configured by a smartphone (the remote act as peripheral) and be able to control one equipement (and act as Central).
As i only need to use uart on each side, i've started mixing demo programs ble_app_uart_c.c (central) and ble_app_uart.c (peripheral) without success.
As peripheral: The board advertise correctly, i can connect to it on my smartphone with the app nRF UART v2.0 but the NUS_data_handler seems not receive any message.
As central: When the board try to connect with another board flashed with ble_app_uart.c, the conn_handle indicate 65532 and the role is BLE_GAP_ROLE_INVALID instead of BLE_GAP_ROLE_CENTRAL.
RAM configuration: start: 0x20003DB0, size: 0xC250
My program: ble_app_uart_c.zip
Thanks a lot for your advice to correct these errors !!!
It does not look like you are handling received advertising reports in your application.
When your central receives an advertising packet, the role will be set to BLE_GAP_ROLE_INVALID, but the event ID will indicate BLE_GAP_EVT_ADV_REPORT.
You should dispatch such events to the on_ble_central_evt() handler. Have a look at for instance the BLE Relay Example (concurrent central/peripheral) for more details about how this is done.
Thanks a lot for your help Jørgen, it works perfectly with this !
And for the peripheral function we must add ble_nus_on_ble_evt(&m_nus, p_ble_evt); on the dispatch peripheral to retreive the messages.