完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我用psoc4 BLE和发送通知给同伴时,我的设备关闭,用原因代码使同伴知道为什么我被关闭的设备(如用户行为,闲置超时、电池低等等)。显然,在关机后cyble_gattsnotification()我需要循环cyble_processevents(),但我也要避免不必要的循环太长。
那么有没有办法知道如果/当我通知了吗?这是一个迹象,所以我不在乎同伴不会/不能处理它,所以没有必要使用指示和等待同伴的确认。所有我想知道的是,如果是送我的消息,而如果同伴得到它或不。 谢谢, 卡洛里 以上来自于百度翻译 以下为原文 I am using the PSoC4 BLE and sending a notification to the peer when my device shuts down, with a reason code so that the peer knows why my device was turned off (e.g. user action, inactivity timeout, battery low and so on). Obviously on shutdown after CyBle_GattsNotification() I need to loop on CyBle_ProcessEvents(), but I also want to avoid looping too long unnecessarily. So is there a way to know if / when my notification was put on air? This is an indication so I don't care if the peer doesn't / cannot process it, so there is no need to e.g. use indication and wait for the peer to confirm. All I want to know is if my message was sent, irrespective if the peer got it or not. Thx, Karoly |
|
相关推荐
5个回答
|
|
你好,
检查API CyBygGATSnNoTIFICTION()的返回值。当它返回CyByEyrRoRoxOK时,发送通知。您可以使用UART调试打印或切换任何LED。 伪代码--- “”“”选项“” 当(CyByyReloRook)!= CyBLY-GATSSENTIFITCION() { cyble_processevents(); } UARTUDUBG(“通知发送”); “”“”选项“” -吉安 以上来自于百度翻译 以下为原文 Hello, Check the return value of API CyBle_GattsNotification(). When it returns CYBLE_ERROR_OK, the notification is sent. You can use either UART debug print or toggle any LED. Pseudo code--- """""""""""""""""""""""""""""" while(CYBLE_ERROR_OK!=CyBle_GattsNotification()) { CyBle_ProcessEvents(); } UART_DEBUG("Notification Sent"); """""""""""""""""""""""""""""""""" -Gyan |
|
|
|
YHYDZ 发表于 2018-8-31 08:16 我想当它返回CyByEyrRoRoxOK时,它只意味着通知已经成功地在栈内排队。你确信当它返回CyByEyrRoRoSok时,是否意味着通知已经在空中发送到那个时候? 以上来自于百度翻译 以下为原文 I thought when it returns CYBLE_ERROR_OK it only means the notification has been successfully queued inside the stack. Are you sure when it returns CYBLE_ERROR_OK it means the notifications has already been sent on the air by that time? |
|
|
|
asp60399 发表于 2018-8-31 08:23 您好,KPY2418181, 这只检查确认通知数据包已成功进入双栈的应用层之后,堆栈应该照顾在空中发送数据。你的理解是正确的。正如你已经知道,在通知分组情况不会有从对等设备的ACK任何因此我们(的应用)永远不会知道已接到通知对端设备或不。 -吉安 以上来自于百度翻译 以下为原文 Hello kp_2418181 ,, This check only confirms that the Notification data packet has been successfully pushed into the BLE stack from the application layer and after that the stack should take care of sending the data over the air. Your understanding is correct. As you already know that in case of Notification packet there would not be any kind of ACK from the peer device and hence we ( The application) will never come to know that the Notification has been received by the peer device or not. -Gyan |
|
|
|
YHYDZ 发表于 2018-8-31 08:30 嗨,我知道,我已经写在原来的问题。我不是在寻找来自同行的ACK。我正在寻找一种方法来知道通知是否被发送,而不管它是否到达对等点。 以上来自于百度翻译 以下为原文 Hi, I know that, I have written that in the original question. I am not looking for an ACK from the peer. I am looking for a way to know if the notification was sent, irrespective if it arrived at the peer or not. |
|
|
|
asp60399 发表于 2018-8-31 08:44 您好,KPY2418181, 正如你提到的“CyLygGATSnNoTrimeCuffic()),我需要在CyByl PraseServices()上循环,但我也希望避免不必要的循环太长。 答:第一个回答回答了这个问题。一旦应用程序确认数据已被推入堆栈,就可以从循环中出来。之后,所有的东西都在堆栈的控制之下,应用程序永远不会知道数据是通过空中发送的,或者是由对等设备接收的。 -吉安 以上来自于百度翻译 以下为原文 Hello kp_2418181 , -> As you mentioned " CyBle_GattsNotification() I need to loop on CyBle_ProcessEvents(), but I also want to avoid looping too long unnecessarily." Ans: The first response answers this query. Once the application confirms that the data has been pushed into the stack, you can just come out of the loop. After that everything is under the control of stack and the application will never come to know that the data has been sent over the air or has been received by the peer device etc.. -Gyan |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2070 浏览 1 评论
1826 浏览 1 评论
3639 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1761 浏览 6 评论
1512 浏览 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 15:03 , Processed in 0.863253 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号