hi .i use the pca10056 connect to th nrfconnect by usb .andr dun the app Bluetooth low energy.other 52840 device run the hex of \nordic
sdk\nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart.and i modify some para in the project ble_app_uart.
#define NRF_SDH_BLE_GAP_DATA_LENGTH 251 #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247 #define MIN_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS) #define MAX_CONN_INTERVAL MSEC_TO_UNITS(75, UNIT_1_25_MS) #define NRF_SDH_BLE_GAP_EVENT_LENGTH 24
and in main loopdo { err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle); if ( (err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_RESOURCES) && (err_code != NRF_ERROR_NOT_FOUND) ) { APP_ERROR_CHECK(err_code); } if (err_code == NRF_SUCCESS) { count ++; data_array[0]++; data_array[length-1]++; if(count>1678) { NRF_LOG_INFO("end send "); flag=0; break; } } } while (err_code == NRF_SUCCESS);
i discover that the rate between the device and the pac10056 is so slow that the time of send 400KB data is 1 min.
but the same hex program into the pac10056,and connected by nrfconnect of a Android phone .transfer 400KB data use 8s.
the rate looks nice,but it also not arrive the speed of 2M.
so my problem is :
No.1 :how to set the rate to 2Mbps ?
I know the device can change the rate by the callback BLE_GAP_EVT_PHY_UPDATE_REQUEST,if i want to set the rate to 2Mbps once the device init ,
if i callthe api sd_ble_gap_phy_update in the init time can do that ?
and the speed i can run is 50KB /s. it is far from the theoretical value, so what should ido continue to immprvo my data rate?
No.1 :what shuold i do to arrive the fastest ble speed by project
\nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart
and
\nRF5_SDK_16.0.0_98a08e2\examples\ble_central\ble_app_uart_c\
?