完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
如您所知,当创建自定义的BLE特性时,您可以指定如下所示的应用属性
我注意到所有提供使用“写入”属性的BLE实例,这通常在StaveEnthDand程序中处理: /*当中央设备发送写入命令时接收此事件 关于属性*/ 案例: /*读取写入请求参数*/ RealErrQualPosiv=(CythStCyBulgGATSsWrdEX.CMDY-ReqQualPARAMET**) 事件参数; /*当触发此事件时,外围设备已接收到 在自定义特性上写入命令。检查是否命令 适合任何自定义属性并更新标志 发送相应服务的通知*/ 如果(滑块) = WrreReq参数-gt; { HandleWriteRequestforSlider(WrreReqQualor); } 如果(钮扣) = WrreReq参数-gt; { HandleWriteRequestforButtons(WrreReqQualor); } 如果(rgbjccccd句柄) = WrreReqQualPosivs≫ Cyle Br.RGB = WrreReq参数-gt; { HandleWriteRequestforRgb(WrreReqQualor); } /*向接收的写入请求发送响应。*/ CyrBulgGATSDS-WrrErSP(连接句柄); 断裂; 使用CysBuffggsStWrreSerp(连接句柄)回送响应; 现在我看不出WordNoSeNoSpSE选项会发生什么。我试着用一个写有GATT特性的文章来交换,但我不能让它起作用。 例如,是否有一个不同的事件处理程序,或者我需要做什么。 感谢所有帮助。 谢谢 以上来自于百度翻译 以下为原文 As you know when creating a custom BLE characteristic you can assign which property applies as shown below I've noticed all BLE examples provided use the "Write" property and this is typically handled here within the stackeventhandler routine: /* This event is received when Central device sends a Write command on an Attribute */ case CY_BLE_EVT_GATTS_WRITE_REQ: /* Read the write request parameter */ writeReqParameter = (cy_stc_ble_gatts_write_cmd_req_param_t *) eventParameter; /* When this event is triggered, the peripheral has received a write command on the custom characteristic. Check if command fits any of the custom attributes and update the flag for sending notifications by the respective service */ if (SLIDER_CCCD_HANDLE == writeReqParameter->handleValPair.attrHandle) { HandleWriteRequestforSlider(writeReqParameter); } if (BUTTON_CCCD_HANDLE == writeReqParameter->handleValPair.attrHandle) { HandleWriteRequestforButtons(writeReqParameter); } if (RGB_CCCD_HANDLE == writeReqParameter->handleValPair.attrHandle || CY_BLE_RGB_LED_RGB_LED_CONTROL_CHAR_HANDLE == writeReqParameter->handleValPair.attrHandle) { HandleWriteRequestforRgb(writeReqParameter); } /* Send the response to the write request received. */ Cy_BLE_GATTS_WriteRsp(connectionHandle); break; With the response sent back using Cy_BLE_GATTS_WriteRsp(connectionHandle); Now I cannot figure out what happens with a WriteWithNoResponse option. I tried this by swapping out Write with a WriteWithNoResponse with GATT characteristic but I could not get this to work. Is there a different event handler for this, for example, or what do I need to do. All help appreciated. Thanks |
|
相关推荐
1个回答
|
|
你好,
表演writewithoutresponse产生cy_ble_evt_gatts_write_cmd_req事件而不是cy_ble_evt_gatts_write_req在服务器端当中央(客户端)装置发出writewithoutresponse”命令对属性。 -吉安 以上来自于百度翻译 以下为原文 Hello , Performing 'WriteWithoutResponse' generates CY_BLE_EVT_GATTS_WRITE_CMD_REQ event instead of CY_BLE_EVT_GATTS_WRITE_REQ at the Server side when a Central (Client) device sends a 'WriteWithoutResponse' command on an Attribute. -Gyan |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2113 浏览 1 评论
1860 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1794 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
581浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
434浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
445浏览 2评论
393浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
1020浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-31 01:33 , Processed in 0.918855 second(s), Total 76, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号