I am using the code
err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)deviceName, nameLen);
I have made sure that nameLen is less than BLE_GAP_DEVNAME_MAX_LEN and that deviceName is null terminated at BLE_GAP_DEVNAME_MAX_LEN
but the err_code I get is NRF_ERROR_INVALID_PARAM when nameLen is 23
but if I set nameLen to a number less than or equal to 14, it works without any errors.
If I set nameLen to 15, it gives me NRF_ERROR_DATA_SIZE instead
BLE_GAP_DEVNAME_MAX_LEN is 31 inside ble_gap.h , is this number wrong?
I am using S110 version 5.2.1 on nRF51844