How to increase the packet size for sd_ble_gattc_write

We are using nrf52832 with S132 for our application.

Central device connect to Peripheral using sd_ble_gap_connect() api and then uses sd_ble_gattc_write() to write the data.

We are currently able to send only 20 bytes per packet but we want to send upto 128 bytes of data.

Can anyone help me to achieve this?

Parents Reply
  • You need to initiate the data length update procedure on one of the sides (assuming the other handles the request). This is done with sd_ble_gap_data_length_update() (the same function as is used to respond). This can also be called from the SDK GATT module, if you take a look at the nrf_ble_gatt.c implementation in SDK 13. If you use that library, it will initiate a data length update procedure when handing the EVT_CONNECTED, as long as NRF_BLE_GATT_MAX_MTU_SIZE is set high. You can also take a look at the implementationin nrf_ble_gatt.c to see how you can do it manually if you do not use the SDK GATT module.

Children
Related