<p style="white-space: pre-wrap; word-wrap: break-word;">Did you check the way how MOs and FSMs work in abis_om2000.c? I really like about that code that the MO is turned into a 'first class citizen', and that 'struct om2k_mo' encapsulates all the MO parameters (like its address) and the FSM instance in one.  Also, there's one shared enumeration of externalevents going into those MO.  So all in all, there's more encapsulation which makes the "user" of those FSMs more generic.  Receiving an OML message basically consists only of resolving the MO by its addres, and sending the event related to that OML message to the MO, all in a generic function (abis_om2k_rcvmsg in that case).</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20400">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20400/3/include/osmocom/bsc/bts.h">File include/osmocom/bsc/bts.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20400/3/include/osmocom/bsc/bts.h@429">Patch Set #3, Line 429:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">struct osmo_fsm_inst *fi;<br>               bool opstart_sent;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">see my comment about making those part of the gsm_abis_mo</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20400/3/include/osmocom/bsc/nm_bts_sm_fsm.h">File include/osmocom/bsc/nm_bts_sm_fsm.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20400/3/include/osmocom/bsc/nm_bts_sm_fsm.h@36">Patch Set #3, Line 36:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">NM_BTS_SM_EV_SW_ACT_REP,<br>   NM_BTS_SM_EV_STATE_CHG_REP,<br>   NM_BTS_SM_EV_OPSTART_ACK,<br>     NM_BTS_SM_EV_OPSTART_NACK,<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">also, those four first events could be common events</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20400">change 20400</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/20400"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ic001ce6ebeff6f51470ef58140b0235f4a30265e </div>
<div style="display:none"> Gerrit-Change-Number: 20400 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Sat, 03 Oct 2020 07:34:19 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>