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

BLE could not receive data when i use BLE_EVT_TX_COMPLETE to send data

Hello: I am use nrf51822 to transfor data (BLE <->UART),i need a faster rate in ble , and i found a way in the zone,that to use BLE_EVT_TX_COMPLETE to send data, the send data rate raised but if i du that i can not receive data from ble anymore,the device could only send data through ble and can not receive. i gass if ble could not send data and receive data at same time.or the priority send data and receive data can not break each other.

the environment i used is nrf51822 and nRF51_SDK_8.1.0_b6ed55f_6 and s110_nrf51_8.0.0

Parents
  • FormerMember
    0 FormerMember

    The method that is used to transfer data from a peripheral (server) to a central (client) is notifications, and they are transferred using the function sd_ble_gatts_hvx(..). When the data that was added to that function has been transmitted, the event BLE_EVT_TX_COMPLETE will occur.

    Note that in order for the peripheral (server) to be able to use notifications, the central will have to enabled it. The central enables notification by writing to the CCCD for the characteristic in the peripheral that wants to use notifications.

    Update 14.06.16: What do you mean by transferring data through BLE_EVT_TX_COMPLETE, do you mean that you call sd_ble_gatt_hvx(..) from there? Could you please show a code snippet?

    When the UART priority is set to APP_IRQ_PRIORITY_HIGH, it will have higher priority than the software BLE events, but lower priority than radio BLE events, see the Interrupt priority level section in the Softdevice specification.

    If your device is always running in the BLE_EVT_TX_COMPLETE event, you will not see any of the received data from the phone, because the BLE software generated events have the same interrupt level as BLE_EVT_TX_COMPLETE. Since they have the same interrupt priority, the RX BLE software interrupts will be in the queue behind BLE_EVT_TX_COMPLETE..

  • thanks for your answer,i know that how to enable notification,and the phone has already write the CCCD characteristic.my problem is when power up ,i (the device )can received data from phone,but when the device send data to the phone through BLE_EVT_TX_COMPLETE event,the device could not receive data anymore.my uart priority is APP_IRQ_PRIORITY_HIGH, and in BLE_EVT_TX_COMPLETE i have a while(1),so that i can transfer data faster,i thought if the while(1) do not return in BLE_EVT_TX_COMPLETE event,that block the Rx from BLE.

Reply
  • thanks for your answer,i know that how to enable notification,and the phone has already write the CCCD characteristic.my problem is when power up ,i (the device )can received data from phone,but when the device send data to the phone through BLE_EVT_TX_COMPLETE event,the device could not receive data anymore.my uart priority is APP_IRQ_PRIORITY_HIGH, and in BLE_EVT_TX_COMPLETE i have a while(1),so that i can transfer data faster,i thought if the while(1) do not return in BLE_EVT_TX_COMPLETE event,that block the Rx from BLE.

Children
No Data
Related