Hi everyone,
The task is as follows. I set up data transfer using notification. I transmit ~ 83 kB in ~ 10 sec. The connection interval parameters are as follows:
MIN_CONN_INTERVAL MSEC_TO_UNITS(11.25, UNIT_1_25_MS) MAX_CONN_INTERVAL MSEC_TO_UNITS(11.25, UNIT_1_25_MS)
The stack and mtu options are as follows:
BLE_GAP_DATA_LENGTH_DEFAULT 251 NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
Transmission is by the following principle:
for (;;) { ... for (i = 0; i < amount_packets; i++) { while (tx_buffer_event != FREE) { } send_data_fun(&m_our_service, send_arr); tx_buffer_event = BUSY; } ... } static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context) { ... case BLE_GATTS_EVT_HVN_TX_COMPLETE: { tx_buffer_event = FREE; } break; }
Note: one packet contains 230 bytes. Total 360 packages.
Data is transferred from the peripheral device to the central device (Android device).
The minimum and maximum connection intervals specified above are set to minimum for my smartphone.
1) The main question is as follows. Is it possible to increase the data transfer rate?
2) There is also the question of the number of transmitting packets per 1 connection interval. Using the functions described above, I checked that only 1 packet is sent per connection interval. When I was looking for information on this issue, I was faced with the fact that, working with Android devices, you can transfer up to 4 packets per 1 connection interval. How to do it ?
Another observation. If you write the transfer function in the following form:
for (;;) { ... for (i = 0; i < amount_packets; i++) { send_data_fun(&m_our_service, send_arr); nrf_delay_ms(15); } ... }
Then the transfer will be much faster and there were no errors on the peripheral side, but significant packet loss is observed on the central side.
Chip: SKB501 (analog nRF52840);
SDK: nRF5_SDK_15.2.0;
Softdevice: s132_nrf52_6.1.1_softdevice;
Thanks in advance for your help.