DSPS How to Send Multiple Packets

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
chanmi168
Offline
Last seen:3 years 7 months ago
加入:2016-09-11 04:48
DSPS How to Send Multiple Packets

Hi,

I have successfully sent 3 bytes of data per connection interval from my MCU, through DA14580, to my iOS app. Since 3 bytes is less than 20 bytes, they are considered as 1 packet. My question is then how do I send (from MCU) more than 1 packet to DA14580. Is consecutive 22 bytes to DA14580 equivalent to 2 packets? Or do I have to put a delay between the 20th and the 21st byte for DA14580 UART RX to receive data properly? Thanks in advance for your help.

Michael

Device:
MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
Hi chanmi168,

Hi chanmi168,

The packets that you send over BLE during a connection interval doesn't have anything to do with the data that you send from the MCU. The payload for each notification packet with the standard MTU selection is 20 bytes, So each notification that you send can carry up to 20 bytes. You can't control the how many packets the BLE will send during a connection interval (that is up to the master of the connection, if he doesn't want to accept the data he just wont accept it even if you indicate that you have more data to send), if you populate a notification message with 20 bytes then the device will send 20 bytes in one packet. If you would like to send more than 20 bytes of data with notifications on the same characteristic you will have to increase your MTU size, then the L2CAP will take of the rest, chop the data and fit them in two packets first having 20 bytes and the second having 2 bytes (for an MTU size larger than 20 bytes which is the defalt the subsequent packet payload will be 27 bytes).

Thanks MT_dialog