嗨,对话框中,
In SPS example, if i send 100 bytes at a time ,it will send all 100 bytes in one attempts or it will send by 5 attempts like by splitting into 20 bytes.( i.e. in the function user_ble_pull ()).
请耐心ase clarify me the packet size for each transmission?
Device:
Hi RatheeshT,
The maximum size of a BLE packet is 27 bytes, but 7 bytes are reserved for the L2CAP and ATT (4 bytes for the L2CAP and 4 for 3 bytes for the ATT) headers, so the actual data payload is limited to 20 bytes with the default MTU of 23 - 3 the ATT header. The DSPS upon connection performs an MTU exchange to 160 for setting the maximum transmition unit, that resuts in a first packet of 20 bytes of actual payload (since the headers for the L2CAP and ATT are included) and the rest of the packets in multiples of 27 bytes of payload (the headers for the L2CAP and ATT are ommited) therefore in a 100 byte transmition the device will send the first packet of 20 bytes two packets of 27 bytes of payload and the last packet of 26 bytes of payload.
Thanks MT_dialog