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.

CC2564: SPP Demo Client mode传输问题

Part Number: CC2564

SPP Demo Client Mode已经跟电脑配对成功了,

但是与User Guide中的显示存在存在不同,多出一句HCI Mode Change Event,且传输的东西电脑端收不到

user Guide中为:

请帮忙看看是怎么回事,感谢!

  • 请问您现在使用的开发板型号是什么?参考的哪个user guide?

    我看一下是否有相同开发板来测试一下

  • 没有使用开发版,是我们自己做的板子,STM32F407+CC2564B,参考的是swru580

    user guide中是两个SPP Demo之间互相通讯,我们是使用SPP Demo同电脑进行通讯,不知道有没有问题

  • 参考 https://processors.wiki.ti.com/index.php/CC256x_TI_Bluetooth_Stack_SPPDemo_App 

    本节介绍如何使用演示应用程序连接两个已配置的板并通过蓝牙进行通信。蓝牙 SPP 是一个简单的客户端-服务器连接过程。我们将其中一块板设置为服务器,另一块板设置为客户端。然后将启动从客户端到服务器的连接。连接后,可以通过蓝牙在两个设备之间传输数据。

    user guide中是两个SPP Demo之间互相通讯

    是的,我这边也没有合适的板子来测试。所以建议您在英文E2E上发帖,咨询相关的BU

    https://e2e.ti.com/support/wireless-connectivity/ 

  • 谢谢,现在已经可以通讯了,请问为什么使用write指令加任何信息,都会发送This is a test string,可否发送自己想发送的资料?

  • 请问为什么使用write指令加任何信息,都会发送This is a test string,

    因为在例程中,有如下代码

    #define TEST_DATA              "This is a test string."  /* Denotes the data  */
                                                             /* that is sent via  */
                                                             /* SPP when calling  */
                                                             /* SPP_Data_Write(). */

    /* The following function is responsible for Writing Data to an Open */
       /* SPP Port.  The string that is written is defined by the constant  */
       /* TEST_DATA (at the top of this file).  This function requires that */
       /* a valid Bluetooth Stack ID and Serial Port ID exist before        */
       /* running.  This function returns zero is successful or a negative  */
       /* return value if there was an error.                               */
    static int Write(ParameterList_t *TempParam)
    {
       int  ret_val;
       int  Result;
    
       /* First check to see if the parameters required for the execution of*/
       /* this function appear to be semi-valid.                            */
       if((BluetoothStackID) && (SerialPortID))
       {
          /* Simply write out the default string value.                     */
          Result = SPP_Data_Write(BluetoothStackID, SerialPortID, (Word_t)BTPS_StringLength(TEST_DATA), (Byte_t *)TEST_DATA);
    
          /* Next, check the return value to see if the command was issued  */
          /* successfully.                                                  */
          if(Result >= 0)
          {
             /* The Data was written successfully, Result indicates the     */
             /* number of bytes successfully written.                       */
             Display(("Wrote: %d.\r\n", Result));
    
             /* Flag success to the caller.                                 */
             ret_val = 0;
          }
          else
          {
             /* There was an error writing the Data to the SPP Port.        */
             Display(("Failed: %d.\r\n", Result));
    
             /* Flag that an error occurred while submitting the command.   */
             ret_val = FUNCTION_ERROR;
          }
       }
       else
       {
          /* One or more of the necessary parameters are invalid.           */
          ret_val = INVALID_PARAMETERS_ERROR;
       }
    
       return(ret_val);
    }

    您可以将TEST_DATA改成您自己需要发送的资料