Hi,
When I used nRF52840 dongle (connectivity_5.1.0_usb_with_s132_5.1.0.uf2 firmware) to receive peripheral device notifications, nRF52840 dongle can only receive 20 bytes. The peripheral device has been configured to send 240 bytes notification and Iphone received 240 bytes notifications correctly.
static uint32_t ble_cfg_set(uint8_t conn_cfg_tag)
{
...
memset(&ble_cfg, 0, sizeof(ble_cfg));
ble_cfg.gap_cfg.role_count_cfg.periph_role_count = 0;
ble_cfg.gap_cfg.role_count_cfg.central_role_count = 1;
ble_cfg.gap_cfg.role_count_cfg.central_sec_count = 0;
error_code = sd_ble_cfg_set(m_adapter, BLE_GAP_CFG_ROLE_COUNT, &ble_cfg, ram_start);
if (error_code != NRF_SUCCESS)
{
printf("sd_ble_cfg_set() failed when attempting to set BLE_GAP_CFG_ROLE_COUNT.\n");
return error_code;
}
memset(&ble_cfg, 0x00, sizeof(ble_cfg));
ble_cfg.conn_cfg.conn_cfg_tag = conn_cfg_tag;
ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = 240;
error_code = sd_ble_cfg_set(m_adapter, BLE_CONN_CFG_GATTC, &ble_cfg, ram_start);
if (error_code != NRF_SUCCESS)
{
printf("sd_ble_cfg_set() failed when attempting to set BLE_CONN_CFG_GATTC. \n");
return error_code;
}
...
}
static void on_hvx(const ble_gattc_evt_t *const p_ble_gattc_evt)
{
if (p_ble_gattc_evt->params.hvx.handle >= m_hrm_char_handle ||
p_ble_gattc_evt->params.hvx.handle <= m_hrm_cccd_handle)
{
printf("Received data length: %d\n", p_ble_gattc_evt->params.hvx.len);//Received data length:20
}
}