This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The packet division by setting of ATT_MTU and DLE?

Hello,

We try to use "ATT_MTU" and "Data length extension (DLE)" to expand a packet in S132 SDK 14.0.0. When we set "ATT_MTU" > "DLE", please tell me what happens?

We thought data was sent by 1 packet when I set "ATT_MTU"=158 and "DLE"= 137. But, I confirmed the packet was divided when I set "ATT_MTU"=158 and "DLE"= 137. Additionally, division of a packet doesn't occur anytime.

We checked consumption current from an oscilloscope. The data was sent by 2 packets. But the packet interval of this data is very short. And the data was sent by 1 packet at receiving side. image description

1.Why does division of a packet occur?

2.The 2nd packets is empty?

Parents
  • The maximum length of a logical ATT PDU is ATT_MTU long (so for HVN, the actual data payload is ATT_MTU-3 long due to handle + opcode).

    The maximum length of an on-air PDU is DLE_LEN long. Since 4 bytes are used for the L2CAP header (length + channel identificator), you should set DLE to be ATT_MTU+4.

    In your setup, MTU is 158 and DLE is 137. For an HVN or write command, that will be divided into two PDUs as follows:

    PDU #1: L2CAP Header (4) | ATT Header (3) | ATT payload (130)
    PDU #2: ATT payload (28)
    

    So you get some saving with high ATT_MTU by not sending multiple headers, but by increasing the DLE length it should be sent as one PDU.

  • The DLE Length must be at least ATT_MTU + 4. Then any ATT payload will be sent as a single PDU. The length of the data you send cannot exceed (ATT_MTU - ATT_Header), as the API call will fail. ATT_Header size depends on the PDU type, and can be seen in the Bluetooth Spec. It's 3 bytes for HVN/HVI, Write Command and Write Request, but 5 for Prepare Write Request.

Reply Children
No Data
Related