Data is losing in my attempts with this codes.
If i try to upload more than "BUF_SIZE" it chrashed instantly. Even if this "BUF_SIZE" discard some bytes.
Code: Select all
static const int BUF_SIZE = 112640;
uint8_t* rxdata = (uint8_t*) malloc(BUF_SIZE + 1);
while (1) {
const int rxBytes = SerialBT.readBytes(rxdata, BUF_SIZE);
if (rxBytes > 0) {
rxdata[rxBytes] = 0;
ESP_LOGI(btTAG, "Read %d bytes: '%s'", rxBytes, rxdata);
Serial1.write(rxdata, rxBytes);
}