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

sd_ble_tx_buffer_count_get

We used sd_ble_tx_buffer_count_get() to get maximum tx message can be sent in nrf51. However, this api is removed from nrf52840. 

Is it equal to the setting of NRF_SDH_BLE_GAP_EVENT_LENGTH?  If not, does nrf52840 has api with the same function?

  • Hi,

    The API was updated in s140_nrf52840_5.0.0 version. From the migration guide document:

    "The SV call sd_ble_tx_packet_count_get() is removed. Instead, the application can now configure packet counts per link, using the SV call sd_ble_cfg_set() with the cfg_id parameter set to BLE_CONN_CFG_GATTC and BLE_CONN_CFG_GATTS."

    sd_ble_tx_buffer_count_get was renamed to sd_ble_tx_packet_count_get() in an earlier softdevice update.

    regards

    Jared 

  • Thanks. I set queue size by the following code

    ble_cfg_t ble_cfg;
    memset(&ble_cfg, 0, sizeof(ble_cfg));
    ble_cfg.conn_cfg.conn_cfg_tag = APP_BLE_CONN_CFG_TAG;
    ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = MAX_HVN_TX_QUEUE_SIZE;
    err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTS, &ble_cfg, &ram_start);
    APP_ERROR_CHECK(err_code);

    However, I also read that it can be done by changing NRF_SDH_BLE_GAP_DATA_LENGTH and NRF_SDH_BLE_GAP_EVENT_LENGTH. 

    Is it possible to provide the relationship between them?

  • Hi,

    NRF_SDH_BLE_GAP_EVENT_LENGTH specifies the time set aside for the connection on every connection interval, while the NRF_SDH_BLE_GAP_DATA_LENGTH specifies the length of each radio packet. The larger the packet is, the more data can be sent in one packet. Which would require a lesser queue size. With Data Length Extension you can increase the packet payload from 27 bytes to 251. 

    regards

    Jared 

Related