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.

(急)请教Central 使用 GATT_Notification 给 Peripheral 疑问



工程师们请问:

我将peripheral跟central这两个范例工程合并来做切换,

所以工程专案里面包含了Client和Server,

那么我要实现的是 peripheral跟central 连线后

central可以使用GATT_Notification 来通知 peripheral , 使用的 connect handle 是

simpleBLECentral.c 里面的 uint16 simpleBLEConnHandle,使用GATT_Notification发出去的回传值为

SUCCESS, 但是为什么peripheral 却没有收到 ?

但在专案预设情况下我不管怎么切换角色就只能让 peripheral GATT_Notification central 是成功的

GATT_Notification是否有什么限制呢?

Thanks your answer

  • 主从切换的代码已经有人实现了,从网上可以找到源码,要是找不到可以联系我。

    notification的返回值为success并不意味着你的数据发送成功了,它有大概5个返回值,举个例子,如果你的发送方是从机,success时只是说明你的数据正确给了从机的底层,而不是主机成功收到返回给你的值。我是这么处理的,从机给主机发包,主机收到后记录个数并返回特定值,从机cb中读取特定值然后判断。这样可以确保你的数据是否真正到了。

  • central可以使用GATT_Notification 来通知 peripheral ,这本身就有问题啊。notification是 peripheral 发个Central的啊。

  • shen renren :

    notification是 peripheral 发个Central

    GATT_Notification 这个方法它被归类在文件中的 GATT Server Sub-Procedure API Functions 里面,

    那这代表GATT Server 可以调用GATT_Notification方法,peripheral 是 Server , Central 是 Client,

    在培训视频中提到Server Client可以同时或个别存在 , 跟脚色没有关系

  • jason jason4 :

    谢谢你的答覆 , 

    目前状况是知道uuid handle后从机可以像主机做读写 亦可主机向从机做读写...

    但是notification还在找解中,可以发主从代码参考吗..?

    mail: yaocing_pccu@hotmail.com

    Thanks you !

  • TI工程师在线吗给个回应..