From 407df02e7c5c64ce7d7c2bf9756834d6727faade Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 25 May 2018 18:20:06 +0200 Subject: add osmo_fsm_inst_state_chg_keep_timer() Change-Id: I3c0e53b846b2208bd201ace99777f2286ea39ae8 --- include/osmocom/core/fsm.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/osmocom') 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 -- cgit v1.2.3