Hello All
during developmenmt we meet some strange phenomen.
the device send to PC 135 bytes on responce command READ.
During transmitrion 135 bytes the softdevice generate ble read event (<debug> nrf_sdh_ble: BLE event: 0x51.)
five time though it should be one.
We add the custom service
custom_serv_add_char(WRITE_CHAR, m_ble_measurements_service.service_handle,
MEASUREMENTS_WHITE_REF_CHAR, m_ble_measurements_service.uuid_type,
&m_ble_measurements_service.white_ref_char_handle, CHAR_EMPTY_SIZE,
135
);
static void custom_serv_add_char(custom_char_t char_type, uint16_t service_handle, uint16_t uuid,
uint16_t p_uuid_type, ble_gatts_char_handles_t *p_handles,
uint16_t init_len, uint16_t max_len)
{
ble_uuid_t ble_char_uuid;
ble_gatts_char_md_t char_md;
ble_gatts_attr_t attr_char_value;
ble_gatts_attr_md_t attr_md;
memset(&char_md, 0, sizeof(char_md));
char_md.char_props.read = 1;
char_md.char_props.write = 0;
ble_char_uuid.type = p_uuid_type;
ble_char_uuid.uuid = uuid;
memset(&attr_md, 0, sizeof(attr_md));
attr_md.rd_auth = 1;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&attr_md.read_perm);
if (char_type == READ_ONLY)
{
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&attr_md.write_perm);
}
else
{
char_md.char_props.write = 1;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&attr_md.write_perm);
}
attr_md.vloc = BLE_GATTS_VLOC_STACK;
attr_md.vlen = ALLOW_VOLATILE_CHAR_LENGTH;
memset(&attr_char_value, 0, sizeof(attr_char_value));
attr_char_value.p_uuid = &ble_char_uuid;
attr_char_value.p_attr_md = &attr_md;
attr_char_value.init_len = init_len;
attr_char_value.max_len = max_len;
attr_char_value.p_value = 0;
APP_ERROR_CHECK(sd_ble_gatts_characteristic_add(service_handle,
&char_md,
&attr_char_value,
p_handles));
}
Body function which send the data on responce to theread event
ble_gatts_rw_authorize_reply_params_t auth_reply = {0};
auth_reply.type = BLE_GATTS_AUTHORIZE_TYPE_READ;
auth_reply.params.read.gatt_status = BLE_GATT_STATUS_SUCCESS;
auth_reply.params.read.update = 1;
auth_reply->params.read.p_data = get_calibraion_buff;
auth_reply->params.read.len = 135;
DEBUG_MSG("Size Of Spectrum = %d", auth_reply->params.read.len);
sd_ble_gatts_rw_authorize_reply(conn_handle, auth_reply);
The MTU is
INFO ATT MTU updated for device E4:28:FA:49:40:AB, new value is 31
Softdevice 132
SoC is nRF52832
Why softdevice generate five 5 although it should generate only one?
Best regards
Andrii