I'm working on SPP (serial profile) service with NimBLE stack, and I have a question about buffer size.
Maximum buffer size that I can send is 79 bytes, even though my MTU size is set to 150 bytes.
So my question is, how does the stack or BLE in general, handle notification writes/reads? Why do I only receive 79 bytes on the other device, even if I send 140 bytes for example?
I read that maximum characteristic size is 512 bytes so that should not be a problem.
What I expected to happen was that the stack would automatically broke down the message if the size is larger than MTU size, and I could see that by multiple notification events, however this does not seem to happen.
Here is a code snippet. I generate array of numbers and copy it to a string. Size is defined via terminal command.
Code: Select all
char txbuf[size];
int index = 0;
char tx[size];
for(int i = 0; i < size; i++) {
txbuf[i] = i;
index += sprintf(tx + index, "%d", txbuf[i]);
}
spp_send(tx);