My project is modify form DSPS project.
当我把intv\u min和intv\u max设置为10000时,间隔变长了,但是我发现很难连接。
1.如何解决问题?
2.一次唤醒后发送多少个广告包?我能修改吗?我想如果值越大,连接起来就越容易。
3.How big can this value is set to?
4.What is the effect ,if the two values is deffient?
Device:
Hi RandyYu,
1. You ve changed the intv_min and intv_max to 10000ms ? If you ve changed it in about 10 seconds thats what happens, after your device sees the advertising message of the peripheral device the central will have to wait to listen on the second advertising message in order to send the connection request and if there is trafic (fails to see the next advertising message) it might wait for longer as well.
2.广告命令在唤醒并发送广告命令后不会超时,只要您不取消该命令,它将进行广告。只有在定向广告有一个超时。广告包仅通过间隔集定义,如果将其设置为10秒,则每10秒发送3条广告消息(每个广告频道一条)。
3. Its about 10.24 seconds, you can check the BLE specification for this.
4. Check the answer on this threadhttp://support.dialog-semiconductor.com/help-help-help-cant-go-deep-slee...在10号岗位上。
Thanks MT_dialog
1.如果我修改了设备central to paired,does the time will be decreased for connecting and send data.If it is ,can you give me a example for pairing.
2.你说的间隔?我不太明白,我能改一下吗?如果我想改成每10秒发10条广告信息。我需要改哪个参数。
3.对不起,我的英语不是很好。我是说intv的参数,它能设定的最大值。因为我想让它睡10分钟左右
thank you
Hi RandyYu,
1.为了建立连接(配对或不配对),设备必须处于唤醒状态并侦听请求(在您的情况下为连接请求),因此如果您的扫描仪侦听一个广告事件并启动连接,则主机将在外围设备的下一个广告事件中发送连接请求,如果适合您,您可以尝试定向广告,在这种情况下,您的设备将向扫描仪发送定向广告事件,以便连接(此过程耗电,您只能直接向具有allready已知蓝牙地址的特定中心发送广告)。因此,一个想法可能是在大量时间内无方向地发布广告,虽然您没有可用的中心bd地址,但当中心找到您的设备时,您可以建立连接(由于我上面解释的原因,初始连接将非常耗时)。之后,每次你是不连接你将直接广告到该中心,你会得到连接速度比无向广告程序。但我重复一遍定向推进是耗电的,1.28秒后自动停止,没有任何广告数据(没有广告数据意味着您将无法连接到DSPS android和ios应用程序,您将不得不重新配置580主机以接受定向广告请求,并且您必须知道您的中心地址)。您可以在有或没有安全性的情况下实现上述功能。根据您的设备的使用情况,上述方法可能是一种解决方案。另外,因为我可以告诉你,你关心的是低功耗,你可以做的是保持无方向性的广告,并逐渐增加广告间隔,而没有活动(有一段时间没有连接)或,如果有可能,您可以在设备上放置一个按钮以增加广告间隔,这样用户就可以强制重新连接,而不会出现延迟。
2.If you set in the .intv_min and .intv_max the value of MS_TO_BLESLOTS(10000) your advertising interval将set in 10 seconds, that means that the device will be sleeping for about 10 seconds and then exit sleep mode advertise and sleep again automatically. You cant control the number of the advertising packets by the advertising command you will have to implement a counter in order to count the advertising messages emmited from your device.
3. The maximum value of the advertising is 10.24 seconds by the specification, if you want more than this you will have to implement a custom advertising scheme via using a ke_timer. The timer can take as maximum value of 300s (5 minutes) but you can wake up and reset that timer and fall back to sleep.
Thanks MT_dialog
2.因为我想让我的设备可以工作3年battery,so the directly advertise does not suit to me.vertise
You said I can "implement a counter in order to count the advertising messages emmited".
I think it is good idea to slove my problem,but I don't know in which position can changes it.
**************************************
I have tried to change it ,
a.close the sleep
b.open printf console
c.add a adv_counter++;in app_easy_gap_undirected_advertsie_start()
and write a arch_printf
but I found the function has only execute once.
奇怪的是,我的android应用程序也可以扫描它。有没有其他的位置和功能
发送广告?
3.how can I implement a custom advertise scheme?
can you give me a detailed descriptions or a example.
thank you very much
亲爱的dialog
我想用另一个定时器来解决上面提到的问题,代码粘贴在这里
void adv\u timer\u fsm(无效)
{
static uint8_t adv_state = ADV_INIT_STATE;
arch_printf("adv_timer_fsm\r\n\r\n");
switch(adv_state)
{
case ADV\ U INIT\ U状态:
arch_printf(“ADV_INIT_STATE\r\n\r\n”);
spss_env.adv_tmr_hndl = app_easy_timer(10, spss_env.adv_timer_cb );
adv_state = ADV_MODIFY_STATE;
break;
案例高级修改状态:
arch_printf("stop advtise\r\n\r\n");
app_easy_gap_advertise_stop();
spss_env.adv_tmr_hndl=app_easy_timer(6000,spss_env.adv_timer_cb)//第一季度
adv_state = ADV_CYCLE_STATE;
break;
case ADV_CYCLE_STATE:
arch_printf("ADV_CYCLE_STATE\r\n\r\n");
默认_播发_操作();
spss_env.adv_tmr_hndl=app_easy_timer(300,spss_env.adv_timer_cb);第2季度
adv_state = ADV_MODIFY_STATE;
break;
default:
break;
}
}
我的问题是:
Q1:the code at Q1 postion(code above) does this can stop the advertise and sleep for 60s? after 60s ,device wakeup by the
spss_env.adv_tmr_hndl计时器
Q2:Q2位置的代码(上面的代码)此位置的代码是否可以开始播发并持续3s?(我已将播发间隔修改为100,
and what's the minimum of this value)?
I have a test,but the result does not very ideal.when connected ,my slave send packets to master,and the master have ack.after I received
the ack,I called app_easy_gap_disconnect(spss_env.con_info.conidx), it's have a little disconnect(actually,I'm only sure that user_on_disconnect had executed).but after a short time
it;s connected again(I want it sleep 1 minute,and wake up by the timer spss_env.adv_tmr_hndl = app_easy_timer(6000, spss_env.adv_timer_cb ); ).
你能给我一个修改的建议吗。
thank you very much
Hi RandyYu,
I dont get what you are trying to do with the above code.
我不明白如何衡量你的广告信息将有助于你更快地连接,应用程序\u容易\u差距\u无向\u广告\u开始(),它只执行一次,然后设备广告的时间间隔,你已经设置。为了统计您收到的广告消息,您可以遵循beacon项目中的示例。请检查app\u asynch\u trm()函数中的实现,该实现将检查BLE的最后一个状态,如果它是一个BLE\u END\u EVT,并将递增app\u advertise\u计数器,您可以使用此实现来统计您的消息。
Thanks MT_dialog
我有你说的变化,但计数器不准确,我设置了最大计数器=20,但我有嗅探器49。
Hi RandyYu,
I am not sure if comparing with the sniffer is a reliable comparison, as far as i know that method is quite accurate if implemented correctly since you are tracking the end of each BLE event. Just remember that in order to track the advertising messages you should be in advertising state, if not, the counter will measure the connected events as well. Regarding the sniffer comparison with the method i ve mentioned, the counter will measure once for advertising on every channel (37, 38, 39) this will count as 3 advertising messages on the sniffer, also the sniffer as far as i know, wont show the advertising messages if there is any advertising packet collision on air.
Thanks MT_dialog