How to indicate an application parameter in the timer

3 posts / 0 new
Last post
brian
Offline
Last seen:5年11个月前
Expert Master
加入:2014-10-16 18:10
How to indicate an application parameter in the timer

我使用了app_timer_set method to start a timer on a connection attempt. However, if I am connecting to two devices at the 'same' time there is no way to indicate in the app_timer_set call a parameter that would indicate which connection attempt timed out. Thus if I get a timeout (the app_conn_timer_handler gets signaled), I do not know which device signaled the timeout. Is there a way one can pass some type of application parameter into the timer so I know which timeout was signaled (if any)?

Thanks

PY_Dialog
Offline
Last seen:2 years 7 months ago
Staff
加入:2014-08-25 09:59
Hi Brian,

Hi Brian,

If you use different timers for different connecting process, then you will be able to know which connecting timeout. If you use one timer for different connecting process, it already conflict when you kick the timer off.

Regards!
PY

brian
Offline
Last seen:5年11个月前
Expert Master
加入:2014-10-16 18:10
As far as I can tell the only

As far as I can tell the only control I have over what timer is used is in the APP_CONN_TIMER parameter which must be mapped to a function. So is one to create several such ids mapping each to the same function, for example int app_conn_timer_handler(ke_msg_id_t const msgid, ...) and use a switch statement in the callback using msgid to identify the caller?