Hi,
I am trying to write 64 bytes to a characteristic as a client and am getting the error NRF_ERROR_DATA_SIZE
. The infocenter is not very helpful at indicating where the issue of size may originate from. I control both the peripheral and central so I am initialising the characteristic on the peripheral like so:
ble_gatts_attr_t attr_char_value;
memset(&attr_char_value, 0, sizeof(ble_gatts_attr_t));
attr_char_value.p_uuid = &char_uuid;
attr_char_value.p_attr_md = &attr_md;
// Set characteristic length in number of bytes
attr_char_value.max_len = SIGNED_LEN_BYTES;
attr_char_value.init_len = SIGNED_LEN_BYTES;
attr_char_value.p_value = 0;
and I write to it on the central like so:
ble_gattc_write_params_t ble_gattc_write_params;
uint8_t write_handle;
write_handle = m_serv.signed_char_handles.value_handle;
uint8_t p_write[SIGNED_LEN_BYTES];
memcpy(p_write, p_signed_write, SIGNED_LEN_BYTES);
ble_gattc_write_params.write_op = BLE_GATT_OP_WRITE_REQ;
ble_gattc_write_params.flags = BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE;
ble_gattc_write_params.handle = write_handle;
ble_gattc_write_params.offset = 0;
ble_gattc_write_params.len = SIGNED_LEN_BYTES;
ble_gattc_write_params.p_value = p_write;
ret_code_t err_code = sd_ble_gattc_write(m_conn_handle_central, &ble_gattc_write_params);
APP_ERROR_CHECK(err_code);
Any advice as to where the error might be originating from would be much appreciated.
I am using the nRF52832 with SD s132 v4.0.2 and SDK13.0.0 on both sides.
Thanks,