完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我已经实现了扫描或广告以及作为1个主设备的从属设备的连接,同时实现了2个从设备的主设备。
现在我需要同时扫描和放大做广告(无论是否作为奴隶或主人),但无法实现。 请有人请指出一个实现此目的的示例或显示一些适合他们的代码片段? 我遵循en.DM00141271 BlueNRG Prog Man Rev 2016年12月6日的指导原则,第4章:BlueNRG多连接时序策略 特别是wrt建议4: 每次开始做广告时: b)如果不是直接广告,请选择Advertising_Interval_Min = Advertising_Interval_Max,使得(Advertising_Interval_Min + 5ms)是最短分配连接间隔的整数倍 我得到的错误是0x85:BLE_STATUS_INTERVAL_TOO_LARGE 工作顺序: 0.初始化Mode4: uint8_t DataMode = 4; aci_hal_write_config_data(CONFIG_DATA_MODE_OFFSET,CONFIG_DATA_MODE_LEN,& DataMode)); 当然还有双重差距 uint8_t GapRole = GAP_PERIPHERAL_ROLE_IDB05A1 | GAP_CENTRAL_ROLE_IDB05A1; aci_gap_init_IDB05A1(GapRole,1,strlen(DeviceName),& gapRoleHdl,& devNameHdl,& devAppearHdl)); 1.永远开始扫描: aci_gap_start_selective_conn_establish_proc(ACTIVE_SCAN,96,16,PUBLIC_ADDR,true,2,白名单); (所以扫描间隔为60毫秒,扫描窗口为10毫秒) 2.从白名单中的两个从属中的一个获取广告并连接: aci_gap_create_connection(96,16,AddrType,Addr,PUBLIC_ADDR,48,48,2,72,16,16); (因此扫描参数与上述相同,60毫秒conn间隔,10毫秒conn长度) 3.尝试开始广告(先前开始扫描继续寻找白名单中的第二个奴隶): aci_gap_set_discoverable(ADV_IND,44,44,PUBLIC_ADDR,NO_WHITE_LIST_USE,0,NULL,0,NULL,0,0))) (所以55毫秒的广告间隔,遵守建议甚至间隔为(60毫秒 - 5毫秒) 上述调用的返回值始终为0x85。 #simultaneous-scan-& -advertise #ble_status_interval_too_large 以上来自于谷歌翻译 以下为原文 I have achieved scanning or advertising as well as a connection as a slave to 1 master and simultaneously a master of 2 slaves. Now I need simultaneous scan & advertise (whether or not in connection as a slave or master), but cannot achieve it. Would someone please point me to an example which achieves this or show some code snippets that worked for them? I am following guidelines of en.DM00141271 BlueNRG Prog Man Rev 6 Dec 2016, Chapter 4: BlueNRG multiple connections timing strategy Specifically wrt advice 4: Every time you start Advertising: b) If not Direct Advertising, choose Advertising_Interval_Min = Advertising_Interval_Max such that (Advertising_Interval_Min + 5ms) is an integer multiple of the shortest allocated connection interval The error I am getting is 0x85: BLE_STATUS_INTERVAL_TOO_LARGE Order of work: 0. initialize Mode4: uint8_t DataMode = 4; aci_hal_write_config_data(CONFIG_DATA_MODE_OFFSET, CONFIG_DATA_MODE_LEN, &DataMode)); and of course dual gap role uint8_t GapRole = GAP_PERIPHERAL_ROLE_IDB05A1 | GAP_CENTRAL_ROLE_IDB05A1; aci_gap_init_IDB05A1(GapRole, 1, strlen(DeviceName), &gapRoleHdl, &devNameHdl, &devAppearHdl)); 1. start scanning forever: aci_gap_start_selective_conn_establish_proc(ACTIVE_SCAN, 96, 16, PUBLIC_ADDR, true, 2, whitelist); (so 60-msec scan interval, 10-msec scan window) 2. get advertisement from one of the two slaves in the whitelist and connect: aci_gap_create_connection(96, 16, AddrType, Addr, PUBLIC_ADDR, 48, 48, 2, 72, 16, 16); (so same scan parameters as above and 60-msec conn interval, 10-msec conn length) 3. attempt to start advertising (while previously started scan continues looking for second slave in the whitelist): aci_gap_set_discoverable(ADV_IND, 44, 44, PUBLIC_ADDR, NO_WHITE_LIST_USE, 0, NULL, 0, NULL, 0, 0))) (so 55-msec advertising interval, obeying advice to be even interval of (60-msec - 5-msec) Return value of above call is always error 0x85. #simultaneous-scan-&-advertise #ble_status_interval_too_large |
|
相关推荐
5个回答
|
|
嗨斯科特,
也许这个相关的线程( https://community.st.com/0D50X00009XkfB9SAJ )可以帮助你。最好的问候, 安东尼奥 注意:原始帖子包含大量线程对话,只能迁移到第9级 以上来自于谷歌翻译 以下为原文 Hi Scott, maybe this related thread ( https://community.st.com/0D50X00009XkfB9SAJ ) could help you.Best regards, Antonio Note: the original post contained a large number of threaded conversations and was only able to be migrated to the 9th level |
|
|
|
安东尼奥 - 感谢您的帮助,但由于我是该主题的主要贡献者,甚至在您之前,您认为哪一部分对我有帮助?也许你建议看看这个:
/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fen%2Fembedded-software%2Ffp-net-blestar1.html 再次感谢,但它对我没有帮助 - 该示例应用程序使用Mode-3,因为您肯定知道并且具有非常具体,详细的代码,通过保持状态变量来管理广告或扫描,而不是两者。 注意:原始帖子包含大量线程对话,只能迁移到第9级 以上来自于谷歌翻译 以下为原文 Antonio - thanks for trying to help, but since I am a major contributor to that thread, even before you did, what part do you think would help me? Perhaps your suggestion to look at this: /external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fen%2Fembedded-software%2Ffp-net-blestar1.html Thanks again, but it doesn't help me - that sample app uses Mode-3 as you are surely aware and has very specific, detailed code that manages either advertising or scanning, never both, by keeping a state variable. Note: the original post contained a large number of threaded conversations and was only able to be migrated to the 9th level |
|
|
|
|
|
|
|
除了这个问题,我已经花了整整两天的时间,设计了一组同时用于扫描和广告的值,并希望将来作为主人的连接,但现在我有一个问题,无法连接扫描作为奴隶或在该连接结束后(我必须重置BlueNRG-MS) - 但这是一个新线程。
无论如何,我大量使用了aci_hal_get_anchor_period(uint32_t * anchor_period,uint32_t * max_free_slot)来解决这个非常繁琐的数字选择。 以上来自于谷歌翻译 以下为原文 I have spent two full days on nothing but this issue and have designed a set of values that is working for scanning and advertising simultaneously and hopefully for the future connections as a master, but now I have an issue not being able to scan while in connection as a slave or after that connection ends (I have to reset the BlueNRG-MS) - but that is for a new thread. Anyway, I made heavy use of aci_hal_get_anchor_period(uint32_t *anchor_period, uint32_t *max_free_slot) in order to resolve this very tedious number picking. |
|
|
|
谢谢安东尼奥 - 我只在这个帖子中犯了错误,而不是代码,对不起。
以上来自于谷歌翻译 以下为原文 Thanks Antonio - I only made the error in this thread, not the code, sorry. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2735 浏览 1 评论
3241 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1810 浏览 1 评论
3650 浏览 6 评论
6039 浏览 21 评论
1339浏览 4评论
201浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
353浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
444浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
274浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 20:51 , Processed in 1.669229 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号