完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我chandresh和我使用cyble-014008-00 BLE psoc-4单片机。在我的项目中,该cyble单片机的Android装置进行通信,发送25-30字节的数据每250毫秒。但是如果我让Android设备上,cyble测试更长一段时间,我的联系被几个小时后无故掉线。 用这个BLE API发送数据, 空隙sDeDATA(空隙*有效载荷,int siZeOffSeaLoad) { CyBLY-GATSH-HANDLY ValueEntfft瞬变; temphandle.attrhandle = cyble_tapservice_tapdata_char_handle; TyPHANDEL.ValueVal=(Uti8*)有效载荷; TyPHANDEL.Value.Le= SiZeFoePosiLoad; cyble_gattswriteattributevalue(&;temphandle,0,&;cyble_connhandle,cyble_gatt_db_locally_initiated); / *发送通知客户如果通知启用和手指的位置改变了*/ CyBLY-GATS通知(CysLyCon句柄,and MAMPANDLE); } 这是我所面对的日志, 在0:初始化的硬件/ / T = 0秒,我打开的硬件 在0:CyBLY-EVTH Staskon 在0:CyLay-EvtggppiAdvultEngStestStut-Sturt 在46:CyBLY-EVTGGATTA连接器 46:cyble_evt_gap_device_connected / / 46秒钟后,它被连接到Android设备 20600:cyble_evt_gatt_disconnect_ind /后20600秒以后的正常运行时间,它断开,当可断开,首先给堆栈忙 在20600:CyBeLyEvtgGAPI DEVICESY断开 在20600:CyLay-EvtggppiAdvultEngStestStut-Sturt 在20602:CyBLY-EVTGGATTA连接器 在20602:cyble_evt_gap_device_connected / /在20602秒以来的正常运行时间,再连接到Android设备 24444:cyble_evt_stack_busy_status / /在24444秒的时间以来,它得到的堆栈忙事件 24462:cyble_evt_stack_busy_status / / 18秒后,又收到BLE堆栈忙碌的事件,这一次它会断开连接。 在24462:CyBLY-EVTA GATTHI隔离连接器 在24462:CyBeLyEvtgGAPI DEVICESY断开 24462:cyble_evt_gapp_advertisement_start_stop / BLE开始广告几秒钟后再接收连接事件和连接 在24477:cyble_evt_gatt_connect_ind 24477:cyble_evt_gap_device_connected 24477:cyble_evt_gap_connection_update_complete 24477:cyble_evt_gap_connection_update_complete 52698:cyble_evt_stack_busy_status / /在52698秒以后的正常运行时间,又收到堆栈忙事件 52716:cyble_evt_stack_busy_status / / / / 18秒后,又收到BLE堆栈忙碌的事件,这一次它会断开连接。 52716:cyble_evt_gatt_disconnect_ind 52716:cyble_evt_gap_device_disconnected 52716:cyble_evt_gapp_advertisement_start_stop 52941:cyble_evt_gatt_connect_ind 52941:cyble_evt_gap_device_connected 52941:cyble_evt_gap_connection_update_complete 在52942:cyble_evt_gap_connection_update_complete 所以这是发生了什么,每次当我收到堆栈忙事件,18秒钟后我收到一堆忙碌的事件,它会断开连接。然后再连接,几个小时后我收到一堆忙碌的事件,18秒钟后我收到一堆忙碌的事件和非常第二它会断开连接。 谁能帮助这是怎么发生的,我该如何解决这个问题?断开和重联的预计情况稳定后几个小时? 谢谢, 钱德雷什 以上来自于百度翻译 以下为原文 Hello, I am chandresh and i am using CYBLE-014008-00 BLE Psoc-4 MCU. In my project, The CYBLE MCU communicates with an android device and sends 25-30 bytes of data every 250 msec. However if i keep both the android device and CYBLE on for testing for longer period of time, My Connection gets dropped after few hours for no reason. To send the data i use this BLE API, void senddata(void *payload, int sizeofPayload) { CYBLE_GATTS_HANDLE_VALUE_NTF_T tempHandle; tempHandle.attrHandle = CYBLE_TAPSERVICE_TAPDATA_CHAR_HANDLE; tempHandle.value.val = (uint8 *) payload; tempHandle.value.len = sizeOfPayload; CyBle_GattsWriteAttributeValue(&tempHandle,0,&cyBle_connHandle,CYBLE_GATT_DB_LOCALLY_INITIATED); /* send notification to client if notifications are enabled and finger location has changed */ CyBle_GattsNotification(cyBle_connHandle,&tempHandle); } Here is the log of what i have been facing, At 0: Initializing BLE Hardware // At t=0 seconds, i have turned on the BLE hardware At 0: CYBLE_EVT_STACK_ON At 0: CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP At 46: CYBLE_EVT_GATT_CONNECT_IND At 46: CYBLE_EVT_GAP_DEVICE_CONNECTED // After 46 seconds, it gets connected to the android device At 20600: CYBLE_EVT_GATT_DISCONNECT_IND // After 20600 secs since uptime,it gets disconnected,Now when BLE gets disconnected, it first gives STACK BUSY At 20600: CYBLE_EVT_GAP_DEVICE_DISCONNECTED At 20600: CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP At 20602: CYBLE_EVT_GATT_CONNECT_IND At 20602: CYBLE_EVT_GAP_DEVICE_CONNECTED // At 20602 seconds since uptime, It again connects to the android device At 24444: CYBLE_EVT_STACK_BUSY_STATUS // At 24444 seconds since uptime, it gets BLE STACK BUSY EVENT At 24462: CYBLE_EVT_STACK_BUSY_STATUS // 18 seconds later, again it receives BLE STACK BUSY EVENT, this time it gets disconnected. At 24462: CYBLE_EVT_GATT_DISCONNECT_IND At 24462: CYBLE_EVT_GAP_DEVICE_DISCONNECTED At 24462: CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP // BLE STARTS advertising and again after few seconds it receives connect event and connects At 24477: CYBLE_EVT_GATT_CONNECT_IND At 24477: CYBLE_EVT_GAP_DEVICE_CONNECTED At 24477: CYBLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE At 24477: CYBLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE At 52698: CYBLE_EVT_STACK_BUSY_STATUS // AT 52698 seconds since uptime, it again receives STACK BUSY event At 52716: CYBLE_EVT_STACK_BUSY_STATUS //// 18 seconds later, again it receives BLE STACK BUSY EVENT, this time it gets disconnected. At 52716: CYBLE_EVT_GATT_DISCONNECT_IND At 52716: CYBLE_EVT_GAP_DEVICE_DISCONNECTED At 52716: CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP At 52941: CYBLE_EVT_GATT_CONNECT_IND At 52941: CYBLE_EVT_GAP_DEVICE_CONNECTED At 52941: CYBLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE At 52942: CYBLE_EVT_GAP_CONNECTION_UPDATE_COMPLETE So this is what happends, everytime when i receive STACK BUSY event, 18 seconds later i receive another STACK BUSY event and it gets disconnected. then it connects again and after few hours i receive STACK BUSY event once, 18 seconds later i receive another STACK BUSY event and on that very second it gets disconnected. Can anyone help on how this is happening and how can i resolve this? disconnection and reconnection is expected in case of BLE after few hours? Thanks, Chandresh |
|
相关推荐
6个回答
|
|
你好,Chandresh,
请分享这个项目。 谢谢, 心理医生。 以上来自于百度翻译 以下为原文 Hello Chandresh, Please share the project. Thanks, PSYU. |
|
|
|
你好, 请查找附件项目 谢谢, 钱德雷什 DHTAPCEPRESS.CYWRK.SARVEVE01.ZIP 3.2兆字节 以上来自于百度翻译 以下为原文 Hello, Please find attached project Thanks, Chandresh |
|
|
|
你好,Chandresh, 请参阅修改后的项目。 在项目中,cydelay(250)不推荐使用在无限循环,因为我们要打电话给cyble_processevents()功能没有任何延迟。我们可以使用看门狗定时器(其时间价值应250msec)和调用函数senddatatoedge(有效载荷,sizeof(有效载荷))在这。 我们要打电话给cyble_gattswritersp(cyble_conn_handle_t connhandle)API后每成功写因为这个函数发送一个写响应从服务器到客户端的关贸总协定关贸总协定。这个函数必须响应一个有效的写请求从客户端调用事件的关贸总协定(cyble_evt_gatts_write_req)承认的属性已成功写入。 请告诉我,如果这对你有帮助。 谢谢, 心理医生。 DHTAPCEPRESS.CYWRK.SARVEVE02.ZIP 3.2兆字节 以上来自于百度翻译 以下为原文 Hello Chandresh, Please refer through the modified project. In the project, CyDelay(250) is not recommended to use in infinite loop because we have to call the CyBle_ProcessEvents() Function continuously without any delay. We can use WDT timer (whose time value should be 250msec) and call the function sendDataToEdge(payload, sizeof(payload)) in it. We have to call CyBle_GattsWriteRsp (CYBLE_CONN_HANDLE_T connHandle) API after every successfully write because this function sends a Write Response from a GATT Server to the GATT Client. This function has to be invoked in response to a valid Write Request event from the GATT Client (CYBLE_EVT_GATTS_WRITE_REQ) to acknowledge that the attribute has been successfully written. Please let me know if this helps you. Thanks, PSYU. |
|
|
|
yu1004402274 发表于 2018-8-16 03:15 谢谢你的回复, 在我建立成功后可连接的Android设备,可与前几个小时的Android应用适当的沟通。在柏树的发送数据和接收数据的安卓Android,但我接受这整个运行过程中的事件只有这些, 在0:CyBLY-EVTH Staskon 在0:CyLay-EvtggppiAdvultEngStestStut-Sturt 在8:CyBLY-EVTGGATTA连接器 在8:CyLay-EvtgGAPI DeVice连接 <;这期间=====,它与Android设备进行通信===== & gt; 在81:CyBLY-EVTA GATTHI隔离连接器 在81:CyBeLyEvtgGAPI DEVICESY断开 在81:CyLay-EvtggppiAdvultEngStestStut-Sturt 111:cyble_evt_gatt_connect_ind 111:cyble_evt_gap_device_connected 你可以在这里看到,在通信与Android设备,我没有收到任何“cyble_evt_gatts_write_req”事件,我可以调用这个函数cyble_gattswritersp。我的理解是,每一个成功的写作cyble_gattswriteattributevalue API调用属性和cyble_gattsnotification API应该产生“cyble_evt_gatts_write_req”事件后,但我不是我的整个连接期间接受“cyble_evt_gatts_write_req”事件。 请你告诉我当“cyble_evt_gatts_write_req”事件产生,为什么不接受这一事件。 谢谢, 钱德雷什 以上来自于百度翻译 以下为原文 Thanks for your reply, In my set up, After BLE succesfully connected with the android device, BLE communicates properly with the android application for first few hours. In that Cypress BLE sends data to android and Android receives data also, but The event i receive during this entire operation is only these, At 0: CYBLE_EVT_STACK_ON At 0: CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP At 8: CYBLE_EVT_GATT_CONNECT_IND At 8: CYBLE_EVT_GAP_DEVICE_CONNECTED <===== During this period, it communicates with the android device=====> At 81: CYBLE_EVT_GATT_DISCONNECT_IND At 81: CYBLE_EVT_GAP_DEVICE_DISCONNECTED At 81: CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP At 111: CYBLE_EVT_GATT_CONNECT_IND At 111: CYBLE_EVT_GAP_DEVICE_CONNECTED As you can see here, During its communication with the android device, i am not receiving any "CYBLE_EVT_GATTS_WRITE_REQ" event where i can call this function CyBle_GattsWriteRsp. My understanding here is that after every successful writing of attribute by CyBle_GattsWriteAttributeValue API and calling of CyBle_GattsNotification API should generate "CYBLE_EVT_GATTS_WRITE_REQ" event but i am not receiving "CYBLE_EVT_GATTS_WRITE_REQ" event during my entire connection. Could you please tell me when "CYBLE_EVT_GATTS_WRITE_REQ" event gets generated and why am not not receiving this event. Thanks, Chandresh |
|
|
|
zhan81411 发表于 2018-8-16 03:29 你好, 在我的设置中,CyPress BLE MCU没有生成“CyLay-EvtgGATSsWORIGEY-Req”事件。我观察到,即使在建立连接或建立连接和通信发生时,也不会生成此事件。 综上所述,CyLay-EvtgGATSsWrdErgReq事件永远不会生成,并且与此事件相关的切换实例永远不会被执行。 请告诉我你的意见。 钱德雷什 以上来自于百度翻译 以下为原文 Hello, In my Setup, The Cypress BLE MCU is not generating the "CYBLE_EVT_GATTS_WRITE_REQ" event. I have observed that this event is not being generated even when the connection is established or when the connection is established and the communication is happening. In summary, CYBLE_EVT_GATTS_WRITE_REQ event never gets generated and switch case related to this event never gets executed. Please let me know your comments. Chandresh |
|
|
|
zhan81411 发表于 2018-8-16 03:46 你好,Chandresh, 每当有来自中央(Android设备)的写入请求时,在外围侧仅生成此事件CyByLyEvtGATSs*Read ErqReq。在您的项目中,没有从中央建立这样的写入请求,在建立连接之后,直接从外围设备向中心发送数据。 谢谢, 心理医生。 以上来自于百度翻译 以下为原文 Hello Chandresh, Whenever there is a write request from the central( android device) then only this event CYBLE_EVT_GATTS_WRITE_REQ is generated at the peripheral side. In your project there is no such write request from central you are directly sending the data from peripheral to central after establishing the connection. Thanks, PSYU. |
|
|
|
只有小组成员才能发言,加入小组>>
751个成员聚集在这个小组
加入小组2063 浏览 1 评论
1823 浏览 1 评论
3631 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1759 浏览 6 评论
1507 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
501浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
353浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
408浏览 2评论
353浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
850浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 14:53 , Processed in 1.076085 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号