aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2021-09-14 10:27:05 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2021-09-29 13:31:52 +0200
commit57220a076b94332d52f588ed7e9584e39cee5274 (patch)
tree559895c59d706dda12ee045a1c048a758caea70a
parent21052aa5b156b6f920c73493c4ebe71b918c5c43 (diff)
new_fsm for time_ccneels/misc
-rwxr-xr-xcontrib/new_fsm.py48
1 files changed, 13 insertions, 35 deletions
diff --git a/contrib/new_fsm.py b/contrib/new_fsm.py
index 5e836f33..9301194e 100755
--- a/contrib/new_fsm.py
+++ b/contrib/new_fsm.py
@@ -168,46 +168,24 @@ static __attribute__((constructor)) void {{prefix}}_fsm_register(void)
return template.render(**vars(s))
-fsm = FSM(head='#include <osmocom/bsc/lcs.h>',
- prefix = 'lcs_loc_req',
- priv = 'lcs_loc_req',
+fsm = FSM(head='#include <osmocom/bsc/time_cc.h>',
+ prefix = 'time_cc',
+ priv = 'time_cc',
states = (
- State('init',
- ('start',),
- ('wait_location_response',),
+ State('disabled',
+ ('false', 'true'),
+ ('counting_false', 'counting_true',),
onenter=False,
),
- State('wait_location_response',
- ('rx_le_perform_location_response',),
- ('got_location_response', ),
+ State('counting_false',
+ ('false', 'true'),
+ ('counting_false', 'counting_true', 'disabled'),
),
- State('got_location_response',
- (),
- (),
+ State('counting_true',
+ ('false', 'true'),
+ ('counting_false', 'counting_true', 'disabled'),
),
)
)
-with open('lcs_loc_req.c', 'w') as f:
- f.write(fsm.to_c())
-
-fsm = FSM(head='#include <osmocom/bsc/lcs.h>',
- prefix = 'lcs_ta_req',
- priv = 'lcs_ta_req',
- states = (
- State('init',
- ('start',),
- ('wait_ta', 'got_ta'),
- onenter=False,
- ),
- State('wait_ta',
- ('ta',),
- ('got_ta', ),
- ),
- State('got_ta',
- (),
- (),
- ),
- )
- )
-with open('lcs_ta_req.c', 'w') as f:
+with open('time_cc.c', 'w') as f:
f.write(fsm.to_c())