Data transmitted twice and BLE_NUS_EVT_TX_RDY event received twice


I'm using a custom board with nrf52840 and sdk 15.1.0.

I have altered the ble central and peripheral example(ble_app_hrs_rscs_relay) to support nus central and peripheral. I'm able to send and receive data from both peripheral and central connections. 

But when I send data through a peripheral connection, the BLE_NUS_EVT_TX_RDY event in "nus_data_handler" is triggered twice and the data is send twice even though I'm calling "ble_nus_data_send" only once.

else if(p_evt->type == BLE_NUS_EVT_TX_RDY)
NRF_LOG_DEBUG("Tx Completed %d ", ++complete_count);

LOG Output is:

Tx Completed 1

Tx Completed 2

when I try to send the data repeatedly in 20 second interval, each time its transmitted twice.

Any suggestions on this will be of great help.

No Data
Reply Children