完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好!
我正在开发一个基于CyBLE 214000到9000模块的低功耗BLE设备的应用程序,以及使用Cype的Windows程序和从已发布的示例开始的CyStAPI API。 大部分的应用程序是编写和工作的,包括阅读和设置端口,获取A/D信息既读又通知,我现在(迟到!)探索器件的低功耗行为。固件和软件都有点大,所以我不打算张贴整个事情,但如果有人想要更多关于一些方面的细节,请让我知道,我会尝试减少到一个可管理的大小,仍然证明这方面。 我有两个问题,一个围绕CySMART的行为,一个是关于C.*的行为。 1)当外围设备超时时,CyScript应用程序删除“连接”的tiC。 我想做同样的事情来管理链接的优美程度,并显示用户(我!)发生了什么事。然而,我无法找到任何方法来直接使用CyStAPI API来询问连接的状态。是否有一个优雅的方式来做到这一点,还是必须使用定时器实现,然后以某种方式监视分组请求的返回? 2)我希望部分应用程序功能允许用户从扫描列表中指定一个特殊的设备地址,然后当扫描列表中看到该设备时,该设备将自动连接。 编写代码是为了获取一个集中的设备地址,并将其放置在托管中。当按下一个按钮来启动扫描的代码比较各装置是在托管设备地址扫描。如果发现匹配,则扫描继续完成。另一个按钮是用来把托管地址和创建连接。这所有的作品,但如果我移动连接的创作分为扫描码,我结束了与空指针或者锁在悬而未决的等待状态,可怕的问题。我曾经尝试过,作品的按钮强制按钮单击,嵌入代码的扫描程序或在不同的地方进一步下行线从这一点,甚至利用全球旗帜试图迫使它从主程序循环......所有的失败都有同样的问题。 这是因为“blemanager电话连接(新cyconnectinfo(peer_device_bd_addr,新cybleconnectionsettings()));“结果”blemanagercallback在回调。connectionhandler”(即“套”的重要autoresetevent)如果代码运行从一个窗体控件的事件,但如果T他的例行公事是从别的地方打来的。我不能按照程序执行这是隐藏在API。我知道这是一位特殊的但任何一般的思想或意见,或许会让我重新开始! 任何和所有意见或建议非常欢迎! 以上来自于百度翻译 以下为原文 Hi I am developing an application using a low power BLE device based on the CyBLE 214009-000 module, and a windows program using c# and the CySmart API Started from the published example). Most of the app is written and works, including reading and setting ports, getting A/D info both reading and by notification and I am now (belatedly!) exploring the low power behavior of the device. Both firmware and software are getting a bit sizeable, so I am not going to post the entire thing, but if someone wants more details about some aspect please let me know and I will try and reduce to a managable size and still demonstrate that aspect. I have two problems, one around the behaviour of CySmart, and one on the behavior of C#. 1) The CySmart application removes the "connected" tic when the peripheral is timed out. I would like to do the same in order to manage the graceful degredation of the link, and show the user (me!) what is going on. However I cannot find any way of achieving this directly using the CySmart API to interrogate the status of the connection. Is there an elegant way to do this or does it have to be achieved using timers and then monitoring the return of a packet request somehow? 2) I want part of the app functionaliy to allow a user to nominate a specic device address from the scan list, after which that device will automatically be connected when it it is seen in the scan list. The code has been written to take a focused device address and place it in escrow. When a button is pressed to restart the scan the code compares each device as it is scanned with the device address in escrow. If a match is found the scan continues to completion. Another button is then used to take the escrow address and creates the connection. All this works, but if I move the creation of the connection into the scanning code I end up in horrible issues with null pointers or getting locked in unresolved wait states. I have tried forcing a button click for the button that works, embedding the code into the scan routine or at various places further down line from that point, and even using global flags to try and force it from the main program loop...... all failed with the same problems. This seems to be because the call to "BLEManager.Connect(new CyConnectInfo(PEER_DEVICE_BD_ADDR, new CyBleConnectionSettings()));" results in a callback to the "BLEManagerCallBack.ConnectionHandler" (which "sets" an essential AutoResetEvent) if the code is run from a Form control event, but not if the routine is called from any other place. I cannot follow the program execution here as it is hidden inside the API. I know this is a bit specific but any general thoughts and or comments might get me started again! Any and all comments or suggestions very welcome! |
|
相关推荐
1个回答
|
|
1)BLE具有监督超时,并在窗口间隔内传输数据,用于标准的BLE连接。我假设CyStAPI API有某种API /信令来支持这一点。请参阅监视超时、连接丢失时发生断开事件或与连接定时有关的一些事情。丢失的通信的检测是无线应用的基础,并且应该被构建到API中,而不管它是哪种协议/介质。
2)在启动连接之前,首先需要停止扫描。尝试结束扫描,然后连接到托管设备。 BLE收音机的功能是:扫描,广告,连接,闲置。扫描只能过渡到/从空闲,广告可以过渡到连接和来自空闲,并且连接只能过渡到空闲。 你所调用的连接()函数应该有一个API返回值,它告诉你你是否试图做一个无效的操作(至少在PSoC API上,它为函数做了)。对于CyStAPI API来说,API可能是不同的,但我不希望它们与PSoC芯片本身有明显不同的代码体系结构。 以上来自于百度翻译 以下为原文 1) BLE has a supervision timeout and transmits data within windowed intervals for standard BLE connections. I would assume there is some sort of API/signaling for the CySmart API to support this. Try looking at Supervision Timeout, Disconnection Event occurring when connection is lost, or something related to Connection Timing. The detection of lost communications is fundamental to wireless applications and should be built into APIs regardless of which protocol/medium it is. 2) You first need to stop scanning before you can initiate a connection. Try ending the scanning, THEN connecting to the escrowed device. The BLE radio functions as: Scanning,Advertising, Connected, Idle. Scanning can only transition to/from Idle, Advertising can transition to Connected and from Idle, and Connected can only transition to Idle. The Connect() function you are calling should have an API return value that tells you if you are trying to do an invalid operation (at least on the PSoC API it does for the functions). The API might be different for the Bluetooth for the CySmart APIs, but I wouldn't expect them to have significantly different code architecture from the PSoC chips themselves. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2069 浏览 1 评论
1824 浏览 1 评论
3633 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1760 浏览 6 评论
1509 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
507浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
357浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
854浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 08:58 , Processed in 0.646432 second(s), Total 45, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号