This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

It will post NRF_ERROR_RESOURCES if I send 20 bytes to pperpherial device per 30ms in BLE_GAP_PHY_1MBPS

These are Central device 52840 settings:

These are peripheral device 52810 settings:

I use official sdk16.0. Central Project is ble_app_multilink_central.Peripheral project is ble_app_blinky.Central device is 52840, peripheral device is 52810,

I change the ble service data len from 1bytes to 20 bytes.

I create a app-timer to send data to peripheral device if there is a link that has post BLE_LBS_C_EVT_DISCOVERY_COMPLETE. If 52840 send data per 30ms, 52840 will print NRF_ERROR_RESOURCES log as shown in the figure above. 

52840 send 20bytes to 52810 per 30ms, I don't think it exceeded the speed limit.

attempt:

1、52840 send data per 50ms, there is no exception.But its transmission speed doesn't near maximum;

Parents
  • Hi, 

    If you read the description of hvn_tx_queue_size you can find that it is: 


     Minimum guaranteed number of Handle Value Notifications that can be queued for transmission.

    It's not the actual queue size but the minimum guaranteed buffer you will have. It also does not directly decide the number of the packets/data you will send on each connection event. It's the NRF_SDH_BLE_GAP_EVENT_LENGTH , NRF_SDH_BLE_GATT_MAX_MTU_SIZE, and the connection interval that decide it. 

    A large queue size doesn't mean you will have a high throughput. See this case

    You can't get the number of buffer you have left, but if you queue and get NRF_ERROR_RESOURCES this meant the packet is not queued and you need to wait for a BLE_GATTS_EVT_HVN_TX_COMPLETE (for notification) or BLE_GATTS_EVT_HVC (for indication) to continue queueing. 

    It's important to have a higher throughput on BLE is to have large enough ATT_MTU, large enough NRF_SDH_BLE_GAP_DATA_LENGTH (4 byte longer that ATT_MTU), long enough EVENT LENGTH (that it cover the entire connection interval), and not too long connection interval (for example 30-50ms).

    Regards, 
    Amanda

  • Hi,

    1、My application scenario is mainly the host sending data to the slave, so like

     NRF_SDH_BLE_GAP_EVENT_LENGTH parameter, I need to change both host and slave or one of them?

    2、According to my printed log, host send data to slave once, but RTT_Viewer print eight BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE logs, it means that host  threw eight this events.Why is this happening?

    3、Host will link eight slaves in my application scene.If I decrease my connect interval to [30,50]ms,is it sosamll that host can't chandle the event timely cause by eight slaves?

    4、Do you recommend that I use queue Module in host?

Reply
  • Hi,

    1、My application scenario is mainly the host sending data to the slave, so like

     NRF_SDH_BLE_GAP_EVENT_LENGTH parameter, I need to change both host and slave or one of them?

    2、According to my printed log, host send data to slave once, but RTT_Viewer print eight BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE logs, it means that host  threw eight this events.Why is this happening?

    3、Host will link eight slaves in my application scene.If I decrease my connect interval to [30,50]ms,is it sosamll that host can't chandle the event timely cause by eight slaves?

    4、Do you recommend that I use queue Module in host?

Children
No Data
Related