广告时期超过1秒不工作

12个帖子/ 0新
最后一篇
abhikalitra
离线
最后一次露面:2年12个月前
加入:2014-10-30 07:43
广告时期超过1秒不工作

你好支持@ Dialog.

I am using SDK 5.0.4. I have to design a BLE in advertising mode. It measures battery voltage and advertise it.For this application I am using example
SDK 5.0.4\SDK 5.0.4\DA1458x_SDK_5.0.4\DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\ble_app_barebone.

我使用以下设置设置广告时期1秒 -

#define app_addata_update_to(100)//值* 10ms = ms

.intv_min = 32, // value*0.625ms=ms

/// Maximum interval for advertising
.intv_max = 1600,

This 1 Second advertising period works perfectly for me.

但如果我设置任何值超过1秒,它就无法正常工作。甚至我在扫描应用程序中看不到ble。
For 10 Second I am doing the following settings--

#define app_add_data_update_to(1000)//值* 10ms = ms

.intv_min = 32, // value*0.625ms=ms

/// Maximum interval for advertising
.intv_max = 16000,

Device:
mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨Abhikalitra,

嗨Abhikalitra,

控制广告间隔的参数是user_adv_conf结构和.intv_min和.intv_max成员。app_adv_update_to是广告字符串的周期性更改。在.intv_max中,您将最大广告间隔设置为16000,并且我想禁用睡眠模式,并且由于禁用睡眠模式,看门狗即使您应该去睡觉时,看门狗也一直在计数,并且最终看门狗仍然存在一个nmi中断。因此,您可以禁用看门狗或启用睡眠模式。

谢谢mt_dialog.

abhikalitra
离线
最后一次露面:2年12个月前
加入:2014-10-30 07:43
亲爱的mt_dialog,

亲爱的mt_dialog,

Thank you for your reply. Actually I am a newbie with this chip. So do not have the wast idea. I assume that ble_app_barebone is a pre tested example. It should perform well for minimum adv period(20 mS) to maximum adv period(10.24 S). These sleep and watchdog things are also very well taken care by the dialog development team.

Please send me some sample code which can be used for 10 second period.

mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨Abhikalitra,

嗨Abhikalitra,

是的BLE_APP_BAREBONE是一个预测的示例,但如果您的设备广告具有10秒间隔的设备,则BLE中断(设备应开始通告的指示需要更长时间,而不是看门狗定时器)。因此,为了让您的设备使用这种间隔,您可以启用休眠功能(将冻结看门狗)只是更改App_default_sleep_mode = Arch_sleep_off;在user_config.h文件中的ARCH_EXT_SLEEP_ON,或者您可以在DA1458x_config_basic.h文件中禁用#undef the cfg_wdog的看门狗。

谢谢mt_dialog.

abhikalitra
离线
最后一次露面:2年12个月前
加入:2014-10-30 07:43
亲爱的mt_dialog,

亲爱的mt_dialog,

再次感谢你。是的,我正在寻找的东西。让我用你建议的代码设置测试。

If further I feel any problem, I will bug you again.

abhikalitra
离线
最后一次露面:2年12个月前
加入:2014-10-30 07:43
亲爱的支持@对话框,

Dear支持@ Dialog.

Thank you for you support in past. Now I am facing a new problem. If I keep data update period and advertising period both 10 seconds, everything works fine. But I want to update data every 2 second while want to advertise every 10 second. This configuration is not working, I am getting advertising data every 2 seconds. My configurations are as follows-

#define APP_ADV_DATA_UPDATE_TO (200) // value*10ms = ms

.intv_min = 32, // value*0.625ms=ms

/// Maximum interval for advertising
.intv_max = 16000,

const static sleep_state_t app_default_sleep_mode = arch_ext_sleep_on;

LC._Dialog
离线
最后一次露面:2 weeks 5 days ago
职员
加入:2016-09-19 23:20
你好阿比卡阿塔拉,

你好阿比卡阿塔拉,

Apologies for the delay in answering your question...

The data update period defines when the data must me updated. If you follow the flow, when the timer expired the Advertisement is stopped and then restarted with the new data. As per the requirement the data is being updated and then that new data is being advertised.

在后台,为了更新数据,您必须停止广告和更新数据。否则,您发送的数据可能会在旧数据和新数据之间损坏而不停止广告。一旦数据更新,就会user_app_adv_start()被称为user_app_adv_undirect_complete()callback function.

这是推荐的,因为你想transmit the as it is updated. Even, if you update the data multiple times and advertise after may be the 3rd update, only the data updated in the 3rd iteration will be advertised. If you want to advertise once every 10s only, then it makes sense to update the data only once every 10s.

Please let us know if you have any more questions.

最好的,

LC.

abhikalitra
离线
最后一次露面:2年12个月前
加入:2014-10-30 07:43
亲爱的LC,

亲爱的LC,

谢谢您的支持。我经历了你的建议。但对不起我的要求是不同的。实际上在我的项目中,我必须每2秒检查一次交换机的状态。但我必须在每10秒一次宣传最新的更新数据包。所以请建议我如何在代码中实现这一目标。

It means I have to do 5 iterations and on every 5th iteration I have to advertise data.

亲爱的LC,我在这个对话框开发中是非常新手。所以请给我解决一些代码示例的解决方案或告诉我我必须在我的代码中制作的语法更改是什么状态。

waiting for a favourable response.

LC._Dialog
离线
最后一次露面:2 weeks 5 days ago
职员
加入:2016-09-19 23:20
你好阿比卡阿塔拉,

你好阿比卡阿塔拉,

I am not sure if I understood the question correctly. So here is what I understood, please confirm.
1. In your project, you have to monitor the status of a SWITCH in your Hardware (this is the Development board that is also advertising) once every 2 seconds.
2.与此同时,您还需要每2秒更新广告数据包中的开关状态。
但是,您希望此更新的数据每10秒仅广告一次。
这是你的要求吗?

If yes, you are monitoring the switch every 2 seconds which is a separate local event from advertising and this locally stored data can be updated in the advertisement packet and transmitted every 10 seconds which is already being done.

Please let me know if I understood the question wrong.

最好的,
leepeng.

abhikalitra
离线
最后一次露面:2年12个月前
加入:2014-10-30 07:43
Dear Leepeng,

Dear Leepeng,

谢谢你的回复。是的,你是对的。这是我的确切要求。要实现此目的,我在代码中进行了遵循更改

#define APP_ADV_DATA_UPDATE_TO (200) // value*10ms = ms

.intv_min = 32, // value*0.625ms=ms

/// Maximum interval for advertising
.intv_max = 16000,

const static sleep_state_t app_default_sleep_mode = arch_ext_sleep_on;

But unfortunately data update and advertising both are happening at 2 seconds. So please suggest me what changes I have to make in code to achieve my requirement.

LC._Dialog
离线
最后一次露面:2 weeks 5 days ago
职员
加入:2016-09-19 23:20
你好阿比卡阿塔拉,

你好阿比卡阿塔拉,

在您的代码中,您将广告更新时间段设置为2秒。正如我在Provio回答中所说的那样,这也将广告时间段设定为此值以来,以便从udpate您必须停止呼叫某些回调函数的广告和广告的数据再次启动广告。需要此过程,不建议更改,因为这些都将其挂钩进入SDK。为了每2秒更新数据并每10秒浏览每10秒,请按照以下步骤操作...

Set the advertising update to 10 seconds, the advertising interval can be as you have already set.
#define app_addata_update_to(1000)// 1000 * 10ms = 10sec

Updating the data can be done in different ways..
创建一个单独的更新功能,例如
void timeout_update_cb(void)
{

// YOU READ THE STATUS OF THE SWITCH HERE AND SAVE IT
arch_set_pxact_gpio(); // This is a software cursor to visually see in the power profiler.

//设置计时器2秒钟。当计时器过期时,读取状态。
app_easy_timer(200,timeout_update_cb);
}

Call this function when you start advertising., say in function
void user_app_adv_start(void)

Note: You can save the switch status to some local variables or directly to device manufacturer information that is being updated already in the functionmnf_data_update()在上述功能中调用。

这可能不是最好的方式,而是每隔2秒更新数据的方法之一,并每10秒更新您的AdverItsement数据包。但请注意,只有最新更新的数据将被宣传。但是,如果您想利用状态来执行其他一些事情,这可以是一种方法,并更新广告数据包。

最好的,
LC.

abhikalitra
离线
最后一次露面:2年12个月前
加入:2014-10-30 07:43
亲爱的LC,

亲爱的LC,

谢谢你的支持。抱歉回复晚了。我忙于其他一些任务。我会尝试解决方案并进一步通知您。