Hi, I would like read a long characteristic. I know that I have to use sd_ble_gattc_read and I have to multiple call this function. But I don't know where I have to call this function? After service discovery in this block? In some 'for loop' ?
if (p_evt->evt_type == BLE_DB_DISCOVERY_COMPLETE &&
p_evt->params.discovered_db.srv_uuid.uuid == BLE_DEUFOL_SERVICE_UUID &&
p_evt->params.discovered_db.srv_uuid.type == p_deufol->uuid_type)
{
counter++;
for(uint16_t x=0;x<25;x++)
err_code = sd_ble_gattc_read(p_deufol->conn_handle,p_chars[i].characteristic.handle_value , x * 20);
}
You don't have any central example for long read.
When I tried use volatile global variable as counter, but counter is still zero. I increased counter in that block too. Why this variable is not hold in memory ?