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

When ble_nus_data_send does not work???

As below, BLE Data RX works fine, but TX doesn't.
When does this happen?

Currently BLE connect/disconnect and RX is working fine.
The power does not turn off due to this phenomenon.

Not all products exhibit the above symptoms. This was the first time this happened (1 sample).

After receiving, the green LED turns on/off and it is judged that the received data has been received well.

Also, when Rx Data is received, Rx Data is immediately returned (APP) to Tx.

Thank you.

* SDK15.2.0 , nRF52840

static void nus_data_handler (ble_nus_evt_t * p_evt)
{
    uint32_t err_code;
    if (p_evt-> type == BLE_NUS_EVT_RX_DATA)
    {
        if (p_evt-> params.rx_data.p_data [2] == BLE_FACTORY_START) / * * /
        {
            ble_test_mode = true;
            send_data_battery [2] = p_evt-> params.rx_data.p_data [2];
            err_code = ble_nus_data_send (& m_nus, send_data_battery, &length, m_conn_handle);
         }

       ....

}

* Abnormal sample and normal working sample

Related