summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/trxcon.h
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-05-31 09:28:40 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commit423aeefc4047038417b8da49aa5887553ffcfad3 (patch)
tree5e583cbe442670b550e85883303dddb38c8b789f /src/host/trxcon/trxcon.h
parent83a9c9ef50caf133df810587f645b70d11129919 (diff)
host/trxcon: integrate osmo-fsm framework
This change introduces the following state machines: - trxcon_app_fsm - main application state machine. This state machine handles different events, raised from program modules (such as trx_if.c or l1ctl.c). - l1ctl_link_fsm - L1CTL server state machine. - trx_interface_fsm - TRX interface state machine. The program modules (such as trx_if.c or l1ctl.c) should be as much independent from each other as possible. In other words, one module should not call methods from another, e.g. L1CTL handlers are not able to send any command to transceiver directly. Instead of that, they should use shared event set to notify the main state machine about something. Depending on current state and received event, main state machine 'decides' what to do. This approach would allow to easily reuse the source code almost 'as is' anywhere outside the project. Change-Id: I7ee6fc891abe5f775f5b7ebbf093181a97950dea
Diffstat (limited to 'src/host/trxcon/trxcon.h')
-rw-r--r--src/host/trxcon/trxcon.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/host/trxcon/trxcon.h b/src/host/trxcon/trxcon.h
new file mode 100644
index 00000000..a7a3a65f
--- /dev/null
+++ b/src/host/trxcon/trxcon.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#define GEN_MASK(state) (0x01 << state)
+
+enum trxcon_fsm_states {
+ TRXCON_STATE_IDLE = 0,
+ TRXCON_STATE_MANAGED,
+};
+
+enum trxcon_fsm_events {
+ /* L1CTL specific events */
+ L1CTL_EVENT_CONNECT,
+ L1CTL_EVENT_DISCONNECT,
+
+ /* TRX specific events */
+ TRX_EVENT_RESET_IND,
+ TRX_EVENT_RSP_ERROR,
+ TRX_EVENT_OFFLINE,
+};