完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
我正在使用 CYW20820spp Bluetooth®发送数据。 目前每20ms发送512字节的数据。我使用函数wiced_bt_spp_send_session_data(spp_handle, p_data, len);并且在调用发送函数之前调用iced_bt_spp_can_send_more_data(spp_handle)以确保可以发送下一个数据包。主机是手机SPP Bluetooth®调试助手。 我发现 SPP 缓冲区偶尔会满。我通过wiced_bt_spp_port_purge(spp_handle, PORT_PURGE_TXCLEAR)释放了缓冲区,但是没有办法解决这个问题。如何解决这个问题?CYW20820不支持这么快的传输吗?
uint8_t app_send_data(uint8_t *p_data, uint32_t len){ int i; wiced_bool_t ret; static int spp_send_fail_count = 0; static int spp_send_success_count = 0; static int count=0,disconnect_count=0; wiced_result_t result; if(count>20) { count=0; error[0]= (spp_send_fail_count * 100) / (spp_send_success_count + spp_send_fail_count); if(spp_send_fail_count>20) { fail_to_reset++; if(fail_to_reset>=5) { fail_to_reset=0;flag_spp_error=1; wiced_bt_spp_port_purge(spp_handle,PORT_PURGE_TXCLEAR); } } else { flag_spp_error=0; fail_to_reset=0; } spp_send_fail_count=0;spp_send_success_count=0; } flag_spp_autoconnect=1; if (spp_handle == 0) { return 0; } ret = wiced_bt_spp_can_send_more_data(spp_handle); if (!ret) { spp_send_fail_count++; count++; wiced_rtos_delay_milliseconds(2, ALLOW_THREAD_TO_SLEEP); return 0; } ret = wiced_bt_spp_send_session_data(spp_handle, p_data, len); if (!ret) { spp_send_fail_count++; count++; return 0; } spp_send_success_count++; count++; return 1;} |
|
相关推荐
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
NRF54L15芯片开发安装路径对vscode不生效问题解析
1962 浏览 0 评论
在修改广播内容(如名称、UUID、广播数据等)时是否需要停用当前广播功能
1923 浏览 0 评论
nRF54芯片怎么烧录程序&nrfutil的安装使用
5466 浏览 0 评论
1130 浏览 0 评论
深入比较nRF52832和Nordic新的产品nRF54L15参数对比
5123 浏览 0 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 10:35 , Processed in 0.434660 second(s), Total 39, Slave 32 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
11925