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.

CC2564MODA: cc256x HID host not re-pairing to client after successful connect

Part Number: CC2564MODA


I have a cc256x based evaluation board with a tm4c123g which I have loaded with the HIDDemo example and followed the guide http://processors.wiki.ti.com/index.php/CC256x_TI_Bluetooth_Stack_HIDDemo_App

Using the patch described in https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/p/463080/1666187#1666187 I was able to get the eval board to correctly recognize an HID gamepad and display the button outputs in hex to the serial console.

However when the HID device is powered off and then back on it tries to connect to the last paired host but the connection is never made.

Is it possible to configure the HID host to allow re-connects from previously paired clients?

  • Hi,

    Can you please attach a console log of the second connection attempt that fails?

    BR,
    Eyal
  • E���-���D������U���7R�vz�Jv*�i"P�"���<@���"V�$�
    �*ค��WsD���/8�э�"c��
    ���
    K���-"n p��[#(��3\�n��6��Wz��
    ���э	��/q@�3 �
    ��!�Ѝ�g0 5eE�0�Y�a���
    ~H���sE�v���r@�U���S��,������&'�@>9�X���gS�`$Ho���@�4  ��x��4��q��q��$q�a0�<0�����`�x��C(���" �oP �B���&�����;��D�`��#���D2�������A�EE���Z�����"��+(������F���������� ��E���ĭ"�ĨF�+��Ĵ���"�+�� ��E��DC"ĭ"��@"���"�(�D�,�@�X��X"���L������",�(@�,P�Pxg������" ����������������@�
    +�(��-D�������������������"(ĊD*�D��]��X"����X���-"�Q��Q������(�D��Z��qc@�ɁNP�e�����PR�������� �E��������Ѐ�����0$�x�������1EE��"�( ���PA�e¸q�,�&�K��� ������j������@��`P#@q@� z�����!�2@�_���������$��������������ZT��'���ޟ� ���������d��������������������M*��,d�Q�������� ��t���������������������*<�����������t:���������������������*����X@�H��?������d����������������������%`���@�|���������4������������������������ ���S���V��������������������������g� �������P��t�Ќ�������������Ύ�����������t:��������������_�d�������@ͅ���R��������Z�����"���Z���M�D)�Z��+���Q���"����������"�Z����-"���������X�㨈���Z���Z��P����������
    D��������P��-������Q���b��-��P�������-��E���-��������U���Z����������������E���Z��P��X���]�D��Z�������������+��Z���Z��D�����(�������Z��
    ��
    OpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1.
    Device Chipset Version: 4.1
    Bluetooth Device Address: 0xcc78ab414052
    GAP_Set_Connectability_Mode(cmConnectabOpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1.
    Device Chipset Version: 4.1
    Bluetooth Device Address: 0xcc78ab414052
    GAP_Set_Connectability_Mode(cmConnectable).
    GAP_Set_Discoverability_Mode(dmGeneralDiscoverable, 0).
    GAP_Set_Pairability_Mode(pmPairableMode).
    GAP_Register_Remote_Authentication() Success.
    
    ************************** Command Options **************************
    * Command Options: Host, Device                                     *
    *********************************************************************
    
    Select Mode>host
    HID_Register_Host_Server: Function Successful.
    ************************** Command Options **************************
    *  Inquiry                                                          *
    *  DisplayInquiryList                                               *
    *  Pair [Inquiry Index] [Bonding Type]                              *
    *  EndPairing [Inquiry Index]                                       *
    *  PINCodeResponse [PIN Code]                                       *
    *  PassKeyResponse [Numeric Passkey]                                *
    *  UserConfirmationResponse [Confirmation Flag]                     *
    *  SetDiscoverabilityMode [Discoverability Mode]                    *
    *  SetConnectabilityMode [Connectability Mode]                      *
    *  SetPairabilityMode [Pairability Mode]                            *
    *  ChangeSimplePairingParameters [I/O Capabilities] [MITM Flag]     *
    *  GetLocalAddress                                                  *
    *  GetLocalName                                                     *
    *  SetLocalName [Local Device Name (no spaces allowed)]             *
    *  GetClassOfDevice                                                 *
    *  SetClassOfDevice [Class of Device]                               *
    *  GetRemoteName [Inquiry Index]                                    *
    *  ConnectRemoteHIDDevice [Inquiry Index]                           *
    *  CloseConnection                                                  *
    *  ControlRequest [Control Operation]                               *
    *  GetReportRequest [Size] [ReportType] [ReportID] [BufferSize]     *
    *  SetReportRequest [ReportType]                                    *
    *  GetProtocolRequest                                               *
    *  SetProtocolRequest [Protocol]                                    *
    *  GetIdleRequest                                                   *
    *  SetIdleRequest [IdleRate]                                        *
    *  DataWrite [ReportType]                                           *
    *  EnableDebug [Enable/Disable] [Log Type] [Log File Name]          *
    *  Help                                                             *
    *  Quit                                                             *
    *********************************************************************
    
    HID Host>ConnectRemoteHIDDevice 2
    Usage: ConnectRemoteHIDDevice [Inquiry Index].
    Function Error.
    
    HID Host>inquiry
    Return Value is 0 GAP_Perform_Inquiry() SUCCESS.
    
    HID Host>
    GAP Inquiry Entry Result: 0x0090e1185622.
    
    HID Host>
    GAP Inquiry Entry Result: 0x1002b56e18b9.
    
    HID Host>
    GAP_Inquiry_Result: 2 Found.
    GAP Inquiry Result: 1, 0x0090e1185622.
    GAP Inquiry Result: 2, 0x1002b56e18b9.
    
    HID Host>ConnectRemoteHIDDevice 1
    Open Remote HID Device(BD_ADDR = 0x0090e1185622)
    HID_Connect_Remote_Device: Function Successful (ID = 0001).
    
    HID Host>
    HID Open Confirmation, ID: 0x0001, Status: 0x0000
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 3, 
    Report: 0x02 0x80 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Data Indication, ID: 0x0001, ReportType: rtInput, ReportLength: 11, 
    Report: 0x07 0x80 0x80 0x80 0x80 0x88 0x00 0x00 0x00 0x00 0x00 
    
    HID Host>
    HID Close Indication, ID: 0x0001
    
    HID Host>
    The first log "BT_tiva.log " is a text log of the tm4c123g serial console where I interface with the example program.

    After setting the device into host mode and inquiring, I connect to 0x0090e1185622) which is the gamepad to which the HID data is reported. The connection was made while the gamepad was in pairing mode.

    When "HID Close Indication, ID: 0x0001" appears it is because I have manually powered down the gamepad, after approximately 2 seconds I power on the device and wait, nothing happens and the gamepad self powers off after a while.

    The second log file "BT_tx1v8_dbg.log" is a binary log file from the "TX_DBG" pin 24 on the module. Under an oscilloscope I measured period of the smallest pulse and calculated the bits/second to be 102585 which has a next closest baud of 115200 which was the baud the log was recorded at. 

  • Found the solution, it was to set the pairability mode to Secure Simple Pairing.

    SetPairabilityMode 2

    then change the simple pairing parameters 

    ChangeSimplePairingParameters

    I chose display yes/no and no MITM and was able to reconnect after powering off and then on the gamepad.