<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/20976">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vty: auto-generate cmd and doc strings for cfg_filler_type_cmd<br><br>Change-Id: I7fb228c63f3246f443ece67106abba0432b1659e<br>---<br>M CommonLibs/trx_vty.c<br>1 file changed, 21 insertions(+), 14 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/76/20976/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c</span><br><span>index 507d7b3..e672928 100644</span><br><span>--- a/CommonLibs/trx_vty.c</span><br><span>+++ b/CommonLibs/trx_vty.c</span><br><span>@@ -67,6 +67,15 @@</span><br><span>  { 0,                    NULL }</span><br><span> };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static const struct value_string filler_docs[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+  { FILLER_ZERO,          "Send an empty burst (default)" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { FILLER_DUMMY,         "Send a Dummy Burst on C0 (TRX0) and empty burst on other channels" },</span><br><span style="color: hsl(120, 100%, 40%);">+      { FILLER_NORM_RAND,     "Send a GMSK modulated Normal Burst with random bits (spectrum mask testing)" },</span><br><span style="color: hsl(120, 100%, 40%);">+    { FILLER_EDGE_RAND,     "Send an 8-PSK modulated Normal Burst with random bits (spectrum mask testing)" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { FILLER_ACCESS_RAND,   "Send an Access Burst with random bits (Rx/Tx alignment testing)" },</span><br><span style="color: hsl(120, 100%, 40%);">+        { 0,                    NULL }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> </span><br><span> struct trx_ctx *trx_from_vty(struct vty *v)</span><br><span> {</span><br><span>@@ -330,19 +339,11 @@</span><br><span>         return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-DEFUN(cfg_filler, cfg_filler_type_cmd,</span><br><span style="color: hsl(0, 100%, 40%);">-      "filler type (zero|dummy|random-nb-gmsk|random-nb-8psk|random-ab)",</span><br><span style="color: hsl(120, 100%, 40%);">+#define CFG_FILLER_DOC_STR \</span><br><span>  "Filler burst settings\n"</span><br><span style="color: hsl(0, 100%, 40%);">-     "Filler burst type (default=zero)\n"</span><br><span style="color: hsl(0, 100%, 40%);">-  "Send an empty burst when there is nothing to send (default)\n"</span><br><span style="color: hsl(0, 100%, 40%);">-       "Send a dummy burst when there is nothing to send on C0 (TRX0) and empty burst on other channels.\n"</span><br><span style="color: hsl(0, 100%, 40%);">-  "Send a GMSK modulated Normal Burst with random bits when there is nothing to send."</span><br><span style="color: hsl(0, 100%, 40%);">-  " Use for spectrum mask testing. Configure 'filler tsc' to set training sequence.\n"</span><br><span style="color: hsl(0, 100%, 40%);">-  "Send an 8-PSK modulated Normal Burst with random bits when there is nothing to send."</span><br><span style="color: hsl(0, 100%, 40%);">-        " Use for spectrum mask testing. Configure 'filler tsc' to set training sequence.\n"</span><br><span style="color: hsl(0, 100%, 40%);">-  "Send an Access Burst with random bits when there is nothing to send. Use for Rx/Tx alignment."</span><br><span style="color: hsl(0, 100%, 40%);">-       " Configure 'filler access-burst-delay' to introduce artificial delay.\n"</span><br><span style="color: hsl(0, 100%, 40%);">-)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN(cfg_filler, cfg_filler_type_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+      "AUTO-GENERATED", "AUTO-GENERATED")</span><br><span> {</span><br><span>   struct trx_ctx *trx = trx_from_vty(vty);</span><br><span>     // trx->cfg.filler is unsigned, so we need an interim int var to detect errors</span><br><span>@@ -359,7 +360,7 @@</span><br><span> </span><br><span> DEFUN(cfg_test_rtsc, cfg_filler_tsc_cmd,</span><br><span>      "filler tsc <0-7>",</span><br><span style="color: hsl(0, 100%, 40%);">-     "Filler burst settings\n"</span><br><span style="color: hsl(120, 100%, 40%);">+   CFG_FILLER_DOC_STR</span><br><span>   "Set the TSC for GMSK/8-PSK Normal Burst random fillers. Used only with 'random-nb-gmsk' and"</span><br><span>      " 'random-nb-8psk' filler types. (default=0)\n"</span><br><span>    "TSC\n")</span><br><span>@@ -373,7 +374,7 @@</span><br><span> </span><br><span> DEFUN(cfg_test_rach_delay, cfg_filler_rach_delay_cmd,</span><br><span>        "filler access-burst-delay <0-68>",</span><br><span style="color: hsl(0, 100%, 40%);">-     "Filler burst settings\n"</span><br><span style="color: hsl(120, 100%, 40%);">+   CFG_FILLER_DOC_STR</span><br><span>   "Set the delay for Access Burst random fillers. Used only with 'random-ab' filler type. (default=0)\n"</span><br><span>     "RACH delay in symbols\n")</span><br><span> {</span><br><span>@@ -736,6 +737,12 @@</span><br><span> </span><br><span> int trx_vty_init(struct trx_ctx* trx)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+    cfg_filler_type_cmd.string = vty_cmd_string_from_valstr(trx, filler_types,</span><br><span style="color: hsl(120, 100%, 40%);">+            "filler type (", "|", ")", 0);</span><br><span style="color: hsl(120, 100%, 40%);">+  cfg_filler_type_cmd.doc = vty_cmd_string_from_valstr(trx, filler_docs,</span><br><span style="color: hsl(120, 100%, 40%);">+                CFG_FILLER_DOC_STR "What to do when there is nothing to send "</span><br><span style="color: hsl(120, 100%, 40%);">+              "(filler type, default=zero)\n", "\n", "", 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>       g_trx_ctx = trx;</span><br><span>     install_element_ve(&show_trx_cmd);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/20976">change 20976</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-trx/+/20976"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I7fb228c63f3246f443ece67106abba0432b1659e </div>
<div style="display:none"> Gerrit-Change-Number: 20976 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>