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.

CC2540/CC2541双向通信自定義字符串问题

Other Parts Discussed in Thread: CC2541, CC2540

各位好,最近初学BLE,只想实现主从双向传输接收自定义的字符串

也就是不要用串口下指令传输(不想再外接MCU)

而是在CC2540/CC2541设定一个简单的字符串传输就好

请问这样我应该怎么修正呢?

  • Sco ,

    这个你可以看一下SimpleBLEPeripheral工程,看一下安装好后的SDK中的SimpleBLEPeripheral和SimpleBLECentral的使用方法,应该对你有所启发。

  • 谢谢您,不知道我的理解有没有错

     

    主机是用GATT_WriteCharValue实现,从机是用GATT_Notification实现

     

    范例的主机是把自定义的值放0在simpleBLECharVal内,然后通过simpleBLEDoWrite=true送出讯号

     

    那什么时候simpleBLEDoWrite=true呢?