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.

CC256XB-BT-SP: I can not change the open port timeout of the SPP connection

Part Number: CC256XB-BT-SP
Other Parts Discussed in Thread: TM4C123GE6PZ

Dear support team

We develope an USB Stick to connect some Bluetooth devices.
I connect the devices over SPP_Open_Remote_Port.

I want to change the timout of the port open.

I use the HCI_Write_Connection_Accept_Timeout function.

I set the timeout to 16.000 dez. (10 seconds).

But when I start an SPP_Open_Remote_Port after this, the port open function times out after 5 seconds (Default).

When I read back whith HCI_Read_Connection_Accept_Timeout function, I get the right value (16.000 dez).

What ist the Problem?

I use the last stack:
www.ti.com/.../CC256XM4BTBLESW

We use an TM4C123GE6PZ to connect the CC256XB.
I start developement with SPP-Demo.

Thanks

Ronald Lilleg

  • Ronald,

    Could you please capture and attach a firmware log of this occurrence? I suspect that the HCI_Write_Connection_Accept_Timeout function may be getting called in the wrong place, and some other function is changing it back to the default before initialization completes. I will be able to confirm or deny that from the firmware logs, and will be able to continue troubleshooting from there.

  • I use an original Version of SppDemo to testing.

    I insert the follow Funktion:

    int SetLinkTime(int Time)
    // This command writes the Connection_Accept_Timeout configuration parameter,
    // which is the parameter that allows the Bluetooth hardware to automatically deny a connection
    // request after a specified time period has occurred and the new connection is not accepted.
    // Time = New Timeout value.  Values are number of baseband slots (0.625 msec), with a range of 0.625 msec (0x0001) to 40.9 sec (0xFFFF).
    {
     // Init:
     Byte_t    Status;
       int       Result;
       int       ret_val;
     Word_t Logical_Link_Accept_TimeoutResult = Time;

       // First, check that valid Bluetooth Stack ID exists:               
       if(BluetoothStackID)
       {
      Result =  HCI_Write_Connection_Accept_Timeout(BluetoothStackID, Logical_Link_Accept_TimeoutResult, &Status);
      if (!Result)
      {
       if(!Status)
       {
        // Der Befehl war erfolgreich:
        DisplayFunctionSuccess("WriteLinkAcceptTimeout Ok");
        ret_val = 0;
       }
       else
       {
        // Fehler im Status-Flag
        Display(("Error: WriteLinkAcceptTimeout: ", Status));
        ret_val = FUNCTION_ERROR;
       }
      }
      else
      {
       // Fehler im Result:                          */
       DisplayFunctionError("WriteLinkAcceptTimeout", Result);

       // Return function error to the caller.                  
       ret_val = FUNCTION_ERROR;
      }
       }
       else
       {
          // No valid Bluetooth Stack ID exists.                           
          ret_val = INVALID_STACK_ID_ERROR;
       }

       return(ret_val);
    }

    And I call the Funktion before open port:

    /* The following function is responsible for initiating a connection */
       /* with a Remote Serial Port Server.  This function returns zero if  */
       /* successful and a negative value if an error occurred.             */
    static int OpenRemoteServer(ParameterList_t *TempParam)
    {
       int       ret_val;
       int       Result;
     TimeCounter = 0;
     
     SetLinkTime(16000);

     

    I use it as Client and set it and open the remote port.

    But it does not work.

     

    Here is the log:

     

    Client>OpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1
    Device Chipset: 4.1
    BD_ADDR: 0xcc78ab32fcd9

    ******************************************************************
    * Command Options: Server, Client, Help                          *
    ******************************************************************

    Choose Mode>client

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair,            *
    *                  EndPairing, PINCodeResponse, PassKeyResponse, *
    *                  UserConfirmationResponse,                     *
    *                  SetDiscoverabilityMode, SetConnectabilityMode,*
    *                  SetPairabilityMode,                           *
    *                  ChangeSimplePairingParameters,                *
    *                  GetLocalAddress, GetLocalName, SetLocalName,  *
    *                  GetClassOfDevice, SetClassOfDevice,           *
    *                  GetRemoteName, SniffMode, ExitSniffMode,      *
    *                  Open, Close, Read, Write,                     *
    *                  GetConfigParams, SetConfigParams,             *
    *                  GetQueueParams, SetQueueParams,               *
    *                  Loopback, DisplayRawModeData,                 *
    *                  AutomaticReadMode, SetBaudRate, Send          *
    *                  Help, Quit                                    *
    ******************************************************************

    Client>inquiry

    Client>
    Inquiry Entry: 0xa0e6f8936b3f.

    Client>Inquiry Finish

    Result: 1,0xa0e6f8936b3f.


    Client>open 1 1

    WriteLinkAcceptTimeout success.

    Client>
    Time: 5133.

    Client>

     

     

     

  • I write this function:

    // -------------------------------------------------------------------------
    int SetLinkTime(int Time)
    // This command writes the Connection_Accept_Timeout configuration parameter,
    // which is the parameter that allows the Bluetooth hardware to automatically deny a connection
    // request after a specified time period has occurred and the new connection is not accepted.
    // Time = New Timeout value. Values are number of baseband slots (0.625 msec), with a range of 0.625 msec (0x0001) to 40.9 sec (0xFFFF).
    {
    // Init:
    Byte_t Status;
    int Result;
    int ret_val;
    Word_t Logical_Link_Accept_TimeoutResult = Time;

    // First, check that valid Bluetooth Stack ID exists:
    if(BluetoothStackID)
    {
    Result = HCI_Write_Connection_Accept_Timeout(BluetoothStackID, Logical_Link_Accept_TimeoutResult, &Status);
    if (!Result)
    {
    if(!Status)
    {
    // Der Befehl war erfolgreich:
    DisplayFunctionSuccess("WriteLinkAcceptTimeout Ok");
    ret_val = 0;
    }
    else
    {
    // Fehler im Status-Flag
    Display(("Error: WriteLinkAcceptTimeout: ", Status));
    ret_val = FUNCTION_ERROR;
    }
    }
    else
    {
    // Fehler im Result: */
    DisplayFunctionError("WriteLinkAcceptTimeout", Result);

    // Return function error to the caller.
    ret_val = FUNCTION_ERROR;
    }
    }
    else
    {
    // No valid Bluetooth Stack ID exists.
    ret_val = INVALID_STACK_ID_ERROR;
    }

    return(ret_val);
    }
  • I call it at the begining of OpenRemoteServer:

    // -------------------------------------------------------------------------
    /* The following function is responsible for initiating a connection */
    /* with a Remote Serial Port Server. This function returns zero if */
    /* successful and a negative value if an error occurred. */
    static int OpenRemoteServer(ParameterList_t *TempParam)
    {
    int ret_val;
    int Result;
    TimeCounter = 0;

    SetLinkTime(16000);
    ....
  • This ist the Log from SPPDemo:

    Client>OpenStack().
    HCI_VS_InitializeAfterHCIReset
    VS_Update_UART_Baud_Rate success.
    HCI_VS_InitializeAfterHCIReset Success
    Bluetooth Stack ID: 1
    Device Chipset: 4.1
    BD_ADDR: 0xcc78ab32fcd9

    ******************************************************************
    * Command Options: Server, Client, Help *
    ******************************************************************

    Choose Mode>client

    ******************************************************************
    * Command Options: Inquiry, DisplayInquiryList, Pair, *
    * EndPairing, PINCodeResponse, PassKeyResponse, *
    * UserConfirmationResponse, *
    * SetDiscoverabilityMode, SetConnectabilityMode,*
    * SetPairabilityMode, *
    * ChangeSimplePairingParameters, *
    * GetLocalAddress, GetLocalName, SetLocalName, *
    * GetClassOfDevice, SetClassOfDevice, *
    * GetRemoteName, SniffMode, ExitSniffMode, *
    * Open, Close, Read, Write, *
    * GetConfigParams, SetConfigParams, *
    * GetQueueParams, SetQueueParams, *
    * Loopback, DisplayRawModeData, *
    * AutomaticReadMode, SetBaudRate, Send *
    * Help, Quit *
    ******************************************************************

    Client>inquiry

    Client>Inquiry

    Entry: 0xa0e6f8936b3f.

    Client>Inquiry Finish

    Result: 1,0xa0e6f8936b3f.


    Client>open 1 1

    WriteLinkAcceptTimeout success.

    Client>
    etPort_Open_Confirmation: SppConnectErrorStatus: 1 = TimeOut
    TimeOut after: 5133 milliseconds

    Client>
  • Ronald,

    Could you please capture firmware logs? This will allow me to see when messages are sent back and forth, and if the timeout is incorrectly being reset before the application runs.