⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
7 posts / 0 new
Last post
dmueller.
Offline
最后一次露面:3 years 10 months ago
加入:2017-04-12 10:04
Timer about val1

亲爱的mt_dialog,

我使用示例程序“ble_app_peripheral”。现在我想在没有激活特征“控制点”的情况下使用特征istik“Val 1”。

1.我做到了,定时器是独立于“控制点”的功能。但值仍然显示,如果我通过特征“控制点”发送“0x01”。我该怎么办,我可以在没有激活“控制点”的情况下使用“val1”的通知?

2.I start the timer in the function "user_custs1_adc_val_1_cfg_ind_handler". Now it seems, that the timer is faster as when the timer was start "user_custs1_ctrl_wr_ind_handler". I use the same "APP_PERIPHERAL_CTRL_TIMER_DELAY"-delay. What can be the reason?

Kind regards.

Device:
mt_dialog.
Offline
最后一次露面:3 months 3 days ago
Staff
加入:2015-06-08 11:34
Hi Dmueller,

Hi Dmueller,

1.我不确定我明白你所做的事情,但你必须以某种方式触发计时器,以便开始计数(写入的控制点特征是什么,只触发计时器),您将在哪里放置触发计时器?如果您没有得到任何通知值,那么显然将永远不会触发计时器。例如,如果您调用timer_used = app_easy_timer(app_peripheral_ctrl_timer_delay,app_adcval1_timer_cb_handler);在user_custs1_adc_val_1_cfg_ind_handler()在第二个问题或连接回调时,设备应根据计时器超时更新值。

2.Regarding that you see the timer running faster when triggered in the mentioned function, i dont see anything like this, you can use the Power Profiler and arch_set_pxact_gpio() (triggers a cursor in the power profiler) in order to measure the distance between the different timer timeouts.

谢谢mt_dialog.

dmueller.
Offline
最后一次露面:3 years 10 months ago
加入:2017-04-12 10:04
Hi MT_dialog,

Hi MT_dialog,

1. i start the timer in the function "user_custs1_adc_val_1_cfg_ind_handler". The timer works. This i can see, if i read the value without notification. If i start the notification nothing will be show in the smartphone display. First if i send "0x01" in the "control point"-characteristic the value will be updated with notification. I think there is a connection beetween the notification-function and the "control point"-characteristic, but i don't know where.

2.我有一个新的知识:如果我在“user_custs1_ctrl_wr_ind_handlll_wr_ind_handler”中使用计时器,则值均匀增加。如果我在“user_custs1_adc_val_1_cfg_ind_handler”中使用计时器,则三个值快速发送。然后有点突破。然后是三个值快速发送。也许你有一个想法,为什么会发生这种情况?
(我已经制作了两个视频。遗憾的是,这些是超过10 MB。但如果你给我一个电子邮件地址,我可以发给你这些视频)

Kind regards.

mt_dialog.
Offline
最后一次露面:3 months 3 days ago
Staff
加入:2015-06-08 11:34
Hi DMueller,

Hi DMueller,

1) Since you are placing the timer in the user_custs1_adc_val_1_cfg_ind_handler() function that means that you dont have to trigger the timer via the control point characteristic but once you enable notifications (from the central) the user_custs1_adc_val_1_cfg_ind_handler() will trigger, activate the timer and start generating notifications. So the fact that you dont get notifications but you see an increment to the characteristic when read, i can assume that you are activating the control point characteristic but you dont enable the notifications on the central. The example as is implements the control point characteristic as a general switch for the notifications. As soon as you execute a write to the control point the user_custs1_ctrl_wr_ind_handler() function gets triggered, if the value is proper !=0 then the timer is enabled. The timer on his turn it sends notification commands towards the stack and the notifications are send when the time for the arranged connection interval arrives. Also in order to get notifications on you central you need to enable them from the central, and as soon as you enable them, the user_custs1_adc_val_1_cfg_ind_handler() will be triggered.

2) In your second founding i can only assume that you are triggering multiple timers one from the control point and an additional one from the user_custs1_adc_val_1_cfg_ind_handler() or perhaps even more (in case you rewrite the control point characteristic or keep enabling disabling the notifications) and all of them when elapsing they push a notification towards the stack.

谢谢mt_dialog.

dmueller.
Offline
最后一次露面:3 years 10 months ago
加入:2017-04-12 10:04
Hi MT_dialog,

Hi MT_dialog,

1. Yes, that is correct. I don' want to trigger the timer via the control point characteristic. I have enable the notification from the central. But first if i send a 0x01 via the control point characteristic, i see the values on the smartphone. I will do some tests once more.

2.我将展示在定时器。但我知道w, that i don't start a timer from the control point characteristic.

Thank you for the helb.

Kind regards.

mt_dialog.
Offline
最后一次露面:3 months 3 days ago
Staff
加入:2015-06-08 11:34
Hi DMueller,

Hi DMueller,

1. If you dont want to trigger the timer from the control point characteristic, then dont perform a write at that characteristic and just place the timer start function in the user_custs1_adc_val_1_cfg_ind_handler() function, so by enabling the notifications at the ADC value 1 characteristics this handler will occur and start the timer that will trigger the notification send function.

2.Regarding the second case and that the timers are counting faster when placed in different code sections, the only logical explanation for this is that you enable more than 1 timer and each timer goes through the same notification function (same timer callback) so it updates and send more notifications that one each time.

谢谢mt_dialog.

dmueller.
Offline
最后一次露面:3 years 10 months ago
加入:2017-04-12 10:04
Hi MT_dialog,

Hi MT_dialog,

我很抱歉迟到的重播。

1. Yes i have start the timer from user_custs1_adc_val_1_cfg_ind_handler().

2.I have now delete the control charachteristic. Now all is function.

Thank you very much for the help.

Kind regards.