app_easy_gap_advertise_stop

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
5 posts / 0 new
最后一篇
ohmi.
离线
Last seen:1 year 11 months ago
加入:2019-03-28 08:21
app_easy_gap_advertise_stop

你好支持团队,

我正试图了解SDK如何工作。

Using example ble_app_barebone.

我正在尝试在2个州运行的设备:

state 0 : advertising
state 1 : doing nothing

为了实现这一目标,我以这种方式修改了上述项目:
在函数adv_data_update_timer_cb() - 定时器回调:我正在基于内部计数器切换状态
当计数器达到预期值时,我更改状态并询问ADV STOP:

mystatus是一个全局变量

UINT8_T MyStatus __Attribute __((部分(“保留_MEM_AREA0”),ZERO_INIT));// @保留内存uint8_t nb __attribute __((部分(“Retention_mem_area0”),Zero_Init));// @保留内存静态void void avd_data_update_timer_cb(){nb ++;if(nb == 2){mystatus = 1;// evite la rescess app_easy_gap_advertise_stop();}如果(nb> = 4){mystatus = 0;nb = 0;} //如果MND_DATA_INDEX具有MSB集,制造商数据存储在扫描响应中uint8_t * mnf_data_storage =(mnf_data_index&0x80)?storage_scan_rsp_data:storage_add_data;//更新制造商数据Mnf_data_update(); // Update the selected fields of the advertising data (manufacturer data) memcpy(mnf_data_storage + (mnf_data_index & 0x7F), &mnf_data, sizeof(struct mnf_specific_data_ad_structure)); // Update advertising data on the fly app_easy_gap_update_adv_data(stored_adv_data, stored_adv_data_len, stored_scan_rsp_data, stored_scan_rsp_data_len); // Restart timer for the next advertising update app_adv_data_update_timer_used = app_easy_timer(APP_ADV_DATA_UPDATE_TO, adv_data_update_timer_cb); }

而不是在user_app_adv_start时,我不会在mystatus == 1时调用app_easy_gap_undircted_advertise_start

void user_app_adv_start(void){// ARCH_PRINTF(“user_app_adv_start”);/ * sb * ///trystry下一个广告数据更新app_add_data_update_timer_used = app_easy_timer(app_addata_update_to,adv_data_update_timer_cb);/ * sb * / if(mystatus == 1){return;} struct gapm_start_advertise_cmd * cmd;cmd = app_easy_gap_undirected_advertise_get_active();//如果有足够的空间app_add_ad_struct(cmd,&mnf_data,sizefof(struct mnf_specific_data_ad_structure),1),将制造商数据添加到初始广告或扫描响应数据。app_easy_gap_undircated_advertise_start();}

结果不是我在nmi_handlerc完成时的预期。

你能帮我理解我做错了什么

谢谢

设备:
PM_Dialog
离线
Last seen:10 hours 35 min ago
职员
加入:2018-02-08 11:03
Hi ohmi,

Hi ohmi,

停止广告时,触发User_App_Adv_Undirect_Complete()回调函数。如果检查此函数的源代码,则会触发User_App_Adv_Start(),因此设备将再次启动广告。请在调试模式下运行代码,并且您将看到“status”等于Gap_err_Canceled(= 0x44)。因此,当user_app_adv_start再次触发时,MyStatus变量等于1,并将执行“返回”。结果是代码被困,看门狗超时,你得到了一个nmi。如果删除if(mystatus == 1){return;},在停止广告后,user_app_adv_start()将被正确粗uenceumed,设备将重新启动广告。在名为BLE_APP_SLEEPMODE示例中有一个示例,其中设备启动广告,在预定义的时间停止广告之后,进入扩展睡眠模式,当您按下设备唤醒并重新启动广告时。如果您与我们的产品和我们的SDK为新手,我会建议您查看雷电竞官网登录以下文件,这将帮助您了解我们的API和SDK的体系结构。

请阅读UM-B-080文档的支柱5(睡眠模式)部分。此外,我强烈建议您从我们的支持网页查看我们的教程和我们的软件示例。

https://www.dialog-seminile.com/produ雷电竞官网登录cts/connectivity/bluetooth-low-energy/smartbond-da14585-and-da14586.

谢谢, PM_Dialog

ohmi.
离线
Last seen:1 year 11 months ago
加入:2019-03-28 08:21
是的,我是你的新手

是的,我是你的产品和SDK。雷电竞官网登录
I was trying to understand the SDK via UM-B-080/079, but it is hard to step in.
感谢与芭托托的联系,我会经过他们。

PM_Dialog
离线
Last seen:10 hours 35 min ago
职员
加入:2018-02-08 11:03
Hi ohmi,

Hi ohmi,

I would recommend you to read the UM-B-080/079, run and debug all the SDK’s example an then read the tutorials. If you have any other question or issue, please create another forum thread. Thank you for accepting my answer.

谢谢, PM_Dialog

ohmi.
离线
Last seen:1 year 11 months ago
加入:2019-03-28 08:21
嗨支持,

嗨支持,

我经历了这样的例子,但我发现教程更有用(特别是讨论睡眠模式的人)。
我设法发送乱发广告预期行为tisement during a short period of time, than have the device sleeping for a while before restarting the advertisement.

谢谢你的指导。