如果我自己定义了一个notify,可以使用GATT_Notification()这个函数发送么?
SimpleProfile_SetParameter()也可以发送通知吧??
Barbara Wu:
可以的
WIND JXC:
回复 Barbara Wu:
SimpleProfile_SetParameter()也可以发送通知吧??
我定义了一个新的characteristic6,但是手机扫描出来的还是之前那些characteristic,没有我新定义的,是什么地方漏了么??
Barbara Wu:
回复 WIND JXC:
不要修改示例代码已经有UUID的,尝试添加自己的UUID和characteristic
WIND JXC:
回复 Barbara Wu:
没有修改已有的,新添加的···
Barbara Wu:
在协议栈的代码里模仿已经有的UUID和characteristic添加一个新的,然后要在SimpleProfile_SetParameter 和 SimpleProfile_GetParameter里面添加case来处理,一样的模仿已有的来添加。Attribute也是一样需要添加新的case,然后可以调用SimpleProfile_SetParameter来发送通知
Li Cheng1:
回复 Barbara Wu:
修改SimpleProfile_SetParameter后,协议里面具体发送时调用哪个任务和函数来实现蓝牙发送数据呢?
wenzhong shen:
SimpleProfile_SetParameter() 里 最终是调用这个函数 GATTServApp_ProcessCharCfg来发送数据的,你可以参考一下下面的帖子http://www.deyisupport.com/question_answer/wireless_connectivity/bluetooth/f/103/t/61009/reply.aspx
需要注意的是 GATTServApp_ProcessCharCfg,这个函数需要调用simpleProfile_ReadAttrCB(),所以发送的数据长度 必须在simpleProfile_ReadAttrCB()中设置好。