This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2564MODN: L2CAP transfer

Part Number: CC2564MODN
Other Parts Discussed in Thread: WL1837

HI,

I have integrated Bluetopia on TM4C1297NZAD. I am using GATT

I am trying to use L2CAP to do bigger chunk of data transfer. I do not have much info or guide on how to use this L2CAP. 

My device will connect to iOS. I will not be able to use any SPP profiles in this case. 

Where should i start?

Thanks

  • Hi Suzanne,

    I'll follow up with more suggestions later this week.

    Thanks,
    Jacob

  • HI Jacob,

    Thanks. I dig deeper into the architecture and code and realized L2CAP is the underlying data encapsulation services.

    I am getting a slow transfer rate due to the data transfer size. I am trying to increase the MTU size by changing BTPS_CONFIGURATION_GATT_MAXIMUM_SUPPORTED_MTU_SIZE in BTPSCFG.h. However, it did not increased the data transfer size. Is this the correct parameter to change the ATT_MTU size? 

  • Hi Suzanne,

    Thank you for the update, I will provide some feedback here tomorrow.

    Best regards,
    Jacob

  • Hi Suzanne,

    Sorry for the delay. How are you measuring your transfer size? Is there a specific function you call to check?

    Unfortunately, I think the Bluetopia stack is limited to an ATT MTU size of 517 bytes. What value are you trying to set ATT MTU to?

    Thanks,
    Jacob

  • Hi Jacob,

    Though it is set to 517, I can only see incoming of 112 bytes. As per my understanding, this transfer size is agreed between both host and device  whereby the lower supported transfer size is agreed upon. As the host is actually an iOS device, i do not think it is only capable of 112bytes. 517 bytes is fine for me if this is achievable. However, this is not the case at this moment. What can i do to increase this? This is quite urgent for me to resolve. Thanks. 

  • Hi Suzanne,

    I do not see an API readily available to increase ATT MTU. I will reach out to another expert and get back to you by Wednesday.

    Best regards,
    Jacob

  • HI Jacob,

    Do you have any update?

  • Hi Suzanne,

    Sorry for the delay. I plan to try to find the default MTU size to see if I also only achieve 112 bytes. I'll try to do this test tomorrow.

    Thanks,

    Jacob

  • HI Jacob,

    Did you have any luck in your test?

  • Hi Suzanne,

    Unfortunately, I have not been able to take logs and view the MTU size yet. I should be able to do so later this week. In the meantime, can you share the logs where you observed a transfer size of 112 bytes?

    Thanks,
    Jacob

  • Hi Suzanne,

    I was able to connect with a Bluetooth Classic connection (BR/EDR) but not BLE yet. Here is a screenshot of the MTU size I found with the Bluetooth Classic connection:

    Just to make sure, you need to find the ATT MTU specifically for BLE?

    I can provide a BLE connection next week if you would like. I believe the MTU size will be limited by the iPhone.

    Thanks,
    Jacob

    btsnoop��A�n�s�A�n�>�A�n��:3���A�n��:�A�nҶ�A�n��A�n��#
    
    �A�n�#$�A�n�$$�A�n�$�A�����A���v�A���8�A��C
    
    �Bh�I
    �P��I�z�Bh��	�P��I��Bh�=	�Bio��P��I��Bir�
    
    �Biwd
    
    �Biy� �P��I��Bi|B�Bi}��Bi��
    �P��I��Bi���Bi���P��I�JBRU �m�Bi�5�Bi��#
    �Bi�� ��Bi�� 
    
    �Bi����Bj#I�Bj5� 
    
    �Bj7��BjJb�BjW� �BjZ���Bj\I���Bj]w7}		�Bjb�7�Bjȧ�Bj��8@�Bj׮ 	��Bj�4	
    �Bj�� 
    ����Bj�F�Bj�` �5
    ;;�Bk,62-*5(	
    	5	
    	5		
    	�BkG�Bki� �55	99�Bkl40+(5&5	5555	555�Bk} �Bk�� �55	&&�Bk��!55	555�Bk��Bl� �55	&&�Bl�!55	555�Blq��Bl�� 
    ��Bl��
    ��Bl���Bl�|8}�Bl�2	�P��I�		�Bl��1�P��I�
    
    �Bl��+	�P��I�
    
    �Bl��
    +�P��I�
    
    �BnIn3
    �P��I��
    
    �BnR�,�P��I�
    
    �Bn[U
    ,�P��I�
    
    �B�u6�P��I��B�&��P��I�}�x�boPH�)�,
    �B����B��W �B��N��B����B�k�B�~�8@�B��� ��B��9
    �B��� 
    ���B�F��B�_� 
    
    �B�c�
    �
    �B�h:
    �
    �B�j�
    ��
    
    �B�n� �?
    
    �B�q�s��B��a�B�ٝ�B��I ���B��
    
    ��B��v 
    ����B��-�B��b �����p�B�Y������B�&� 	�B�(��	�B�*	���B�+D�B�>�
    
    �B�M �?Y
    
    �B�O�s��B�Qv�	�
    ��B�T ��B�V	
    	�B�Wp 
    ����B�d�B�f�B��� ��	��p�B��!�	����B��� ��	�
    p�B��		�\�B�à �5
    ;;�B�Ş62	-*5(	
    	5	
    	5		
    	�B�� 	�B����	�B�ʏ�	�B�˺	���B��(�B����B��� 	�����B��m	�AT+BRSF=255
    @�B����B�� �55	99�B��o40	+(5&5	5555	555�B���B�P�B�9 ���B��
    	��B�W 
    ����B��&�B��� ��
    +BRSF:4079
    ��B�� 
    ��
    
    OK
    ��B���	�AT+BAC=1,2
    \�B��� �55	&&�B��?!	55	555�B�� ��B���
    	 �B����B��y�B�̓ 
    ��
    
    OK
    ��B��	�AT+CIND=?
    \�B��: �55	&&�B��b!	55	555�B��� � �B��	"?�
    P�B���B��  �	�B����	�B������B��� ����
    +CIND: ("service",(0-1)),("call",(0-1)),("callsetup",(0-3)),("battchg",(0-5)),("signal",(0-5)),("roam",(0-1)),("callheld",(0-2))
    ��B���B�U 
    ��
    
    OK
    ��B��	�AT+CIND?
    \�B���B�< �0!
    5�B��	2�B�!� �HX�B�-I%%�B�/&  ��1
    +CIND: 1,0,0,5,3,0,0
    ��B�1� 
    ��
    
    OK
    ��B�2�	�!AT+CMER=3,0,0,1
    \�B�?� �@�B�Ar	B�B�C�B�R��B�W� 
    ��
    
    OK
    ��B�Z+	�AT+CHLD=?
    \�B�a� 
    �B�c��
    �B�eT	
    ��B�f��B�{c''�B�}% "��5
    +CHLD: (0,1,1x,2,2x,3)
    ��B��� 
    ��
    
    OK
    ��B��� ����B���
    
    ��B�a� 	
    ���B���		�B�|��

    Here is the log I used. It can be viewed with Ellisys or Frontline Viewer.

  • HI Jacob,

    It would be good if you can provide the BLE part. Yes, the ATT MTU is correct. Thanks

  • Hi Suzanne,

    I'll have more updates for you this week.

    Best regards,

    Jacob

  • Hi Suzanne,

    I have some updates for you. I took the logs for an iPhone 13 paired with a WL1837 with a BLE connection. In my case, the iPhone served as the central and the WL1837 was the peripheral. In the logs, I see the ATT_EXCHANGE_MTU_REQ was sent from the peripheral to the central with an MTU of 185.

    I think there are two possibilities here:

    1. The iPhone is limited to an MTU size of 185 bytes. This seems to match information I found online here and here.   

    2. The Bluetopia stack sets a limit of 185 bytes based off of HCI communication with the iPhone. I need to look into the stack further to see if this is the case. 

    You can refer to my logs attached here to see if you notice anything else. If possible, can you try connecting with an Android phone to see if you see a different MTU size?

    btsnoop�$$�A�]   9#�@sB�\A~}��A�]4� $$�A�]6B	  	WL18xx Device�A�]9	 �A�]:  �@�A�]<� �A�]=j
     �A�]B
     �A�J�>mbx��OH�A�L�$��A�L�5��A�M̽$��(  �A�M�@D
    �A�MӍ�A�NFA�A�N�@$��(�A�N��	
    �A�O���A�O�6$@D*�A�O�	BWL18xx Device�A�P�!$(�A�P��	
    �A�QuO�A�Qw6$(�A�Qy
    		P*�A�R`�$(�A�Rd�
    		*�A�SK:�A�SN�$
    �A�SRR
    �A�U�\

    (This file can be viewed with Frontine or Teledyne LeCroy Wireless Protocol Suite)

    Thanks,
    Jacob

  • HI Jacob,

    Unfortunately i inheritted this code and the application that works with this code is developeed on iphone. i do not have a way to test it with Android. Let me dig deeper on the iphone and also the logs

    Thanks. 

  • HI Jacob,

    Can you let me know how did you capture the logs? Thanks

  • Hi Suzanne,

    Yes, I was able to capture the logs according to our guide on taking HCI logs.

    Best regards,
    Jacob  

  • Hi Suzanne,

    After reaching out to an expert, I can confirm that the max ATT size on our CC256x devices is 27 octets (bytes). Since our devices do not support the LE Data Packet Length Extension feature, the negotiated MTU size is fragmented at the baseband into 27-octet frames, regardless of increasing the MTU size in the stack. 

    Thanks,
    Jacob

  • HI Jacob, 

    Does this means that the max data transfer is only 216 bytes? This means only 189 bytes (excluding 27bytes header) maximum data is allowed ?

    I have also found this page (http://software-dl.ti.com/lprf/simplelink_cc2640r2_latest/docs/blestack/ble_user_guide/html/ble-stack-3.x/l2cap.html?highlight=mtu)

    In this page, it explains how to set the MTU. I have found the config in Bluetopia to set the  MTU as following. Is this correct? 
    /* GATT Configuration. */
    #define BTPS_CONFIGURATION_GATT_MAXIMUM_SUPPORTED_MTU_SIZE (131)

    If I want to set to 512bytes, should i use the value of 508 here?

    Thanks

  • Hi Suzanne,

    That page refers to a different Bluetooth Low Energy stack. TI offers a Dual-mode Bluetooth stack (Bluetopia) and a BLE-only stack (CC13x2_26x2). The information on the page you found is not applicable to Bluetopia.

    Can you explain how your rationale behind the 216 bytes? 

    Thanks,
    Jacob

  • HI Jacob,

    I might have misunderstood u when u meant 27 octets when you actually meant 27 bytes. 216 was 27*8.

    Anyway, for Bluetopia, do you know if the following is correct to set the MTU limit?

    * GATT Configuration. */
    #define BTPS_CONFIGURATION_GATT_MAXIMUM_SUPPORTED_MTU_SIZE (131)

    I think i need to set this to 512 in order for negotiation with higher packet size to be successful. 

    Can you confirm this?

  • Hi Suzanne,

    You can try this, but I believe the MTU size will still be limited to 27 bytes based on the limitations on our Bluetopia stack. Please let me know if you are able to increase the MTU size.

    Thanks,

    Jacob