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.

Bluetopia Bluetooth Stack - PIN code Response problem



Hello,

          I am using Bluetopia stack with AM335x. Currently i am having a strange problem. When I try to pair from board's side( Sending commands to stack from serial) The device paired successfully . When i try to pair from Android 4.4 device, it stuck on "Pairing" and after 2-3 minutes it says Wrong PIN or in some cases it gets paired.

Kindly help 

  • Hi,

    Can you please share the full list of commands that you are running?
    Are you calling "RegisterAuthentication" before pairing?

    Regards,
    Gigi Joseph.
  • After opening stack I am using following commands

    GAP_Set_Connectability_Mode(BluetoothStackID, cmConnectableMode)

    GAP_Set_Discoverability_Mode(BluetoothStackID, dmGeneralDiscoverableMode, 0);

    GAP_Set_Pairability_Mode(BluetoothStackID, pmPairableMode);

     Then I try to pair from Android device by discovering Wilink8 Bluetooth.

    After entering PIN code on android side I respond

    ASSIGN_PIN_CODE(PINCode, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            0, 0, 0);

                    memcpy(&PINCode, TempParam->Params[0].strParam,
                            strlen(TempParam->Params[0].strParam));

                    /* Populate the response structure.                         */
                    GAP_Authentication_Information.GAP_Authentication_Type =
                            atPINCode;
                    GAP_Authentication_Information.Authentication_Data_Length =
                            (Byte_t) (strlen(TempParam->Params[0].strParam));
                    GAP_Authentication_Information.Authentication_Data.PIN_Code =
                            PINCode;

                    /* Submit the Authentication Response.                      */
                    Result = GAP_Authentication_Response(BluetoothStackID,
                            CurrentRemoteBD_ADDR, &GAP_Authentication_Information);

    It return success, Link key generated and stored,  but pairing never finishes on android side.

  • btsnoop��A*��A���A�M�A�%2�A��3��
    �A�
    3�A�N�A���A�V	
    
    �A��
    	�/>����A��GG�A�0D�������������?���a����A�t�Aɠ�����?[��A���A���A�5V�A�CV�A؇m�Aܳm�A���A��A�H �A�V ��A� 
    
    �A�� �A�� �A�s �A��������=�A���A�FE�ATE�A�G�A	�G�AC�AqC�A�$Z�A�$�A] �A ��A#��A's�A*���A. ��AM��AW�2���A[1R�	�Ay[R�A{� 
    
    �A~� ���A��XT108080
    /2�A�����A�DR�	XT1080�A��R�A�k&`�A��&���A�9R�	XT1080�A��R���A�8R�	XT1080�A�ER���A��R�	XT1080	�A�+R���A��R�	XT1080
    �A�`R���A��R�	XT1080
    
    �A�R$$�A�4  �A� �A�3:3���A��:�A�I�A8�A��A��A9�A�$$�A/  2�A� �A�A*(�A-��A/��A2D�AS����AVR�	XT1080
    �Aa�R���Ad�R�	XT1080
    �AmfR���Ao�R�	XT1080
    �At2R���AvWR�	XT1080
    �Az�R�A}A�A�+$$�A��  �A� �A�6�A�8�A�|�A�
    $$�A�m  �A�� �A���A�+���A�oR�	XT1080
    2�A��R		�A��3���A�C���A!�R�	XT1080
    /2�A#�R���A�/R�	XT1080
    /2�A��R���A�+R�	XT1080
    /2�A��R�A��"M��=�Y��AK/��2�r�c�	PKL-MUSALMAN-DT
    �A8$$�A8&� �A8) �A8+ �A8-� �AF(� �AF=K �AF?� �AFA� �AF]]M��=�		�AF`��AFb�
    M��=�Y��AFd��AN =M��=��AN.��M��=��AN7�
    M��=�Y��ANA��Aam!=M��=��Aa���M��=��A�]R �A�k� �A�m�
    M��=��Y��A�x��B'/�M��=�		�B'L�M��=�
    
    �B'N�M��=�
    
    �B'Q"
    M��=�		�B'SGM��=��B'U�
    M��=�123
    
    �B'W�
    
    M��=��Bkn�M��=�=��r ���^G��Ɖ0�Bkp�M��=�
    
    �Bkr� M��=��BkvE �Bk�� 
    
    �Bk�� �Bk�% 
    
    �Bk���Bk�� ��Bk���Bk�
    l��Bk� �Bk�a�Bkե ��Bk�� 
    
    �Bk���Bk���Bk��Bk�A��-���{��Bk�g�Bk�m�Bk�&�Bk� �Bk��
    M��=�Y��Bk���Bk�8#
    �Bk����Bk��Bk�A
    �Blf�		�Bl�
    �Bl��M��=��Bl� @�Bl#�Bl& B@�I��r
    M��=�Y��I����I���M��=��I�
    W A�I�-i�I�5� CA�P����P����P��$$�Q���  �Q��� �Q��9�Q���$$�Q���  �Q��� �Q����Q������Q���R�	XT1080
    /2�Q��R���Q���R�	XT1080
    /2�Q��)R���Q��OR�	XT1080
    /2�Q��R���Q�R�	XT1080
    /2�Q�
    [R$$�Q��  �Q�� �Q�/�Q�z�Q���Q�'r�Q�)� �Q�.{ �Q�0�$R�Q�5($�Q�7M�Q�;��Q�=��Q�A��Q����Q�_�

    here is bluetooth log file

  • Hi,

    Can you tell me which side this snoop log is taken from?

    Regards,
    Gigi Joseph.
  • This is from Android side.

    The strange thing to share is that when i try to connect from windows...everything goes fine. This happens only with android 4.4

  • Hi,

    Then this looks like some specific issue with Android 4.4.
    As per the Android snoop logs, the controller sends the Link key notification event to the host. It's still weird that the display shows "Pairing...".

    Regards,
    Gigi Joseph.
  • Upon contact with TI official, They have updated the libraries to resolve this issue. This was relevant to internal stack.

    Thanks

  • Hi,

    Can you please give more details?

    Regards,
    Gigi Joseph.
  • They said that they have updated Bluetooth stack. This problem was with android 4.2 and onwards. So in Latest stack release, this issue has already been resolved
    I was using previous release