summaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-05-25 18:20:06 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-31 21:01:33 +0000
commit407df02e7c5c64ce7d7c2bf9756834d6727faade (patch)
tree0500821a52296263469125bf6014374e5240d550 /include/osmocom
parent36c7b33ccc66eee29efa98120e00952532c8e122 (diff)
add osmo_fsm_inst_state_chg_keep_timer()
Change-Id: I3c0e53b846b2208bd201ace99777f2286ea39ae8
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/fsm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h
index 174396a7..67e00ad7 100644
--- a/include/osmocom/core/fsm.h
+++ b/include/osmocom/core/fsm.h
@@ -182,6 +182,21 @@ int _osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state,
unsigned long timeout_secs, int T,
const char *file, int line);
+/*! perform a state change while keeping the current timer running.
+ *
+ * This is useful to keep a timeout across several states (without having to round the
+ * remaining time to seconds).
+ *
+ * This is a macro that calls _osmo_fsm_inst_state_chg_keep_timer() with the given
+ * parameters as well as the caller's source file and line number for logging
+ * purposes. See there for documentation.
+ */
+#define osmo_fsm_inst_state_chg_keep_timer(fi, new_state) \
+ _osmo_fsm_inst_state_chg_keep_timer(fi, new_state, \
+ __BASE_FILE__, __LINE__)
+int _osmo_fsm_inst_state_chg_keep_timer(struct osmo_fsm_inst *fi, uint32_t new_state,
+ const char *file, int line);
+
/*! dispatch an event to an osmocom finite state machine instance
*
* This is a macro that calls _osmo_fsm_inst_dispatch() with the given