完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嗨,大家好,
我已经通过论坛、YouTube视频和PSOC样本的100天来解决这个问题,我被卡住了。我无法得到“命令完成”事件从我的外设发送回中央,不知道为什么。我处理CyByLyEvtGATSsWRead Erq,更新GATT DB,并调用CyByLyGATSWruteSerp-但是命令完成事件永远不会被发送。我已经尝试了顺序的变化,改变了关贸总协定的参数,增加了对CyByLePraseServices的附加调用,甚至添加了随机延迟——但它从来都不起作用。我将一个调试器附加到CyPress示例代码中,逐字地查看每个调用,并对自己进行相同的调用,但仍然没有发送响应。 下面是我编写的一个示例程序的代码链接,以显示我期望的工作: http://gthub. com /iPeBelHi/pSoClinux实验/Bulb/Mrd/ Read Wrrave/Read WrreEng/Read WraveGATT。 第100行是我处理写请求的地方。任何想法,为什么不回复我预期的反应将是受欢迎的。回购应克隆和建立在BLE先锋套件。 谢谢! 以上来自于百度翻译 以下为原文 Hi All, I've gone through the forums, youtube videos, and the 100 days of PSOC samples to figure this out, and am stuck. I can't get the "command complete" event to send from my peripheral back to central, and don't know why. I handle CYBLE_EVT_GATTS_WRITE_REQ, update the GATT DB, and call CyBle_GattsWriteRsp -- but the command complete event never gets sent. I've tried variations in the order, changing the gatt parameters, adding in additional calls to CyBle_ProcessEvents, or even putting in random delays -- yet it never works. I attached a debugger to the Cypress sample code, and literally looked at each call linearly, and made the same calls on my own -- yet the response is still not sent. Here's the code link to an example program I made up to show what I expect to work: https://github.com/ipeerbhai/PSo ... teGATT.cydsn/main.c Line 100 is where I handle the Write Request. Any ideas on why this doesn't send back the response I expect would be welcome. The repo should clone and build on the BLE Pioneer kit. Thanks! |
|
相关推荐
4个回答
|
|
使用CyBle GattC编写命令的文档列出了所有事件和由它生成的响应,以及如何处理它们的快速摘要。(通过打开BLE组件的API文档,或者对函数名进行搜索,您可以看到这一点)。
同样,CyLay-EvtGaTsSWrdErgReq事件应该有与上面提到的相同的文档,关于需要和处理/应该回答什么参数和值。 以上来自于百度翻译 以下为原文 The documentation with the CyBle GattC Write command lists all of the events and response generated by it, as well as a quick summary of how they are handled. (You can see this by opening the API documentation for the BLE component, or doing a search-all for the function name). Also, the CYBLE_EVT_GATTS_WRITE_REQ event should have documentation associated with it in the same way as I mentioned above about what parameters and values are needed/handled/should be replied. |
|
|
|
yuhe82 发表于 2018-9-10 11:49 我已经问过医生了。我链接的样例代码显示了什么应该根据DOCS和谷歌中的一切工作。 下面是我希望工作的代码片段: 案例CyLeLayEvtggsStWreErgReq://获取写请求事件参数WrReqPARAM=(CyLay-GATSSAWReQueReqqPARAMYT**)EndoPARAM;(或)如果主机(WrReqPARAM-≫HANDALVALION.AtHealGrave= = CyBlayLeDistaEn.ISBLink,CARHARY句柄){GGYUBDLBLink=W),则主机是否希望编写一个新的应该闪烁标志?ReqQPARAM-&;HANDALVALION.Val.VAL(0);Blink();UpDeDigabdBeDeDeDeStEnter();CyLabyGATScript RealSerp(GyBlEnnEngRead句柄);/ /发送响应。断开; 附加调试器显示调用的BLE处理程序。LED的正确更新是基于CyScript写的。的gattdb状态是正确的,因为我可以读取DB后。但cysmart次在写请求与此代码--没有正常工作100天的PSoC代码样例,“day003_custom_profile_capsense_rgb_led”。我作出了同样的电话在同一顺序的样本。它应该只是工作。 以上来自于百度翻译 以下为原文 I've already read the docs before asking. The sample code I linked shows what should work according to everything in the docs and the Google. Here's the code snippet I expect to work:
Attaching the debugger shows the Ble Handler getting called. The LED updates correctly based on what's written by Cysmart. The GATTDB state is correct, as I can read the db later. But CySmart times out on the write request with this code -- yet works correctly with the PSoC 100 days code sample, "Day003_Custom_Profile_CapSense_RGB_LED". I'm making the same calls in the same order as the sample. It should just work. |
|
|
|
yh3091876423 发表于 2018-9-10 11:58 啊哈!我算出了错误。这是件愚蠢的事。 我不能用自己生成的句柄调用CyLygGATSWrrrSerp。我必须使用BLE生成的句柄!正确的代码必须读取: 聚伞花序柄; 它现在起作用了!耶! 以上来自于百度翻译 以下为原文 Aha! I figured out the error. It was something stupid. I can't call CyBle_GattsWriteRsp with my own generated handle. I have to use the BLE generated handle! The correct code must read: CyBle_GattsWriteRsp(cyBle_connHandle); It works now!! Yay! |
|
|
|
yh3091876423 发表于 2018-9-10 12:12 是的,除非你有必要不使用CyPress变量,否则只有一个可能的LLE连接更容易直接引用所有的数据/变量。 很高兴你发现了这个问题 以上来自于百度翻译 以下为原文 Yeah, unless you have a need not to use the cypress variables, it is easier with only one possible BLE connection to leave all of the data/variables directly referenced. Glad you found the problem though |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2069 浏览 1 评论
1826 浏览 1 评论
3639 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1760 浏览 6 评论
1510 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
508浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
358浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
855浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 00:55 , Processed in 1.077803 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号