<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/23587">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">add osmo_bts_features_names: short BTS feature strings<br><br>This will be used by osmo-bts-omldummy to parse features strings from<br>the cmdline.<br><br>Note that osmo_bts_feature_name() already exists to return the longer<br>descriptive value_strings from osmo_bts_features_descs (_descs!).<br>Luckily that misses the plural 'features' in the name, so that I can<br>still add a properly named osmo_bts_features_name() function that only<br>returns the name, matching the common pattern used in osmocom code.<br><br>Related: SYS#4895<br>Change-Id: I699cd27512887d64d824be680303e70fff3677c1<br>---<br>M include/osmocom/gsm/bts_features.h<br>M src/gsm/bts_features.c<br>M src/gsm/libosmogsm.map<br>3 files changed, 32 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gsm/bts_features.h b/include/osmocom/gsm/bts_features.h</span><br><span>index b174d3f..93d35f3 100644</span><br><span>--- a/include/osmocom/gsm/bts_features.h</span><br><span>+++ b/include/osmocom/gsm/bts_features.h</span><br><span>@@ -40,6 +40,11 @@</span><br><span> const char *osmo_bts_feature_name(enum osmo_bts_features feature)</span><br><span>     OSMO_DEPRECATED("Use osmo_bts_features_desc() instead");</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+extern const struct value_string osmo_bts_features_names[];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static inline const char *osmo_bts_features_name(enum osmo_bts_features val)</span><br><span style="color: hsl(120, 100%, 40%);">+{ return get_value_string(osmo_bts_features_names, val); }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)</span><br><span> {</span><br><span>    OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);</span><br><span>diff --git a/src/gsm/bts_features.c b/src/gsm/bts_features.c</span><br><span>index c3f3667..fb3193f 100644</span><br><span>--- a/src/gsm/bts_features.c</span><br><span>+++ b/src/gsm/bts_features.c</span><br><span>@@ -47,8 +47,33 @@</span><br><span>  { 0, NULL }</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*! return string representation of a BTS feature */</span><br><span style="color: hsl(120, 100%, 40%);">+/*! return description string of a BTS feature (osmo_bts_features_descs).</span><br><span style="color: hsl(120, 100%, 40%);">+ * To get the plain feature name, use osmo_bts_features_name() instead. */</span><br><span> const char *osmo_bts_feature_name(enum osmo_bts_features feature)</span><br><span> {</span><br><span>   return get_value_string(osmo_bts_features_descs, feature);</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+const struct value_string osmo_bts_features_names[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+    { BTS_FEAT_HSCSD, "HSCSD" },</span><br><span style="color: hsl(120, 100%, 40%);">+        { BTS_FEAT_GPRS, "GPRS" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { BTS_FEAT_EGPRS, "EGPRS" },</span><br><span style="color: hsl(120, 100%, 40%);">+        { BTS_FEAT_ECSD, "ECSD" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { BTS_FEAT_HOPPING, "HOPPING" },</span><br><span style="color: hsl(120, 100%, 40%);">+    { BTS_FEAT_MULTI_TSC, "MULTI_TSC" },</span><br><span style="color: hsl(120, 100%, 40%);">+        { BTS_FEAT_OML_ALERTS, "OML_ALERTS" },</span><br><span style="color: hsl(120, 100%, 40%);">+      { BTS_FEAT_AGCH_PCH_PROP, "AGCH_PCH_PROP" },</span><br><span style="color: hsl(120, 100%, 40%);">+        { BTS_FEAT_CBCH, "CBCH" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { BTS_FEAT_SPEECH_F_V1, "SPEECH_F_V1" },</span><br><span style="color: hsl(120, 100%, 40%);">+    { BTS_FEAT_SPEECH_H_V1, "SPEECH_H_V1" },</span><br><span style="color: hsl(120, 100%, 40%);">+    { BTS_FEAT_SPEECH_F_EFR, "SPEECH_F_EFR" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { BTS_FEAT_SPEECH_F_AMR, "SPEECH_F_AMR" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { BTS_FEAT_SPEECH_H_AMR, "SPEECH_H_AMR" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { BTS_FEAT_ETWS_PN, "ETWS_PN" },</span><br><span style="color: hsl(120, 100%, 40%);">+    { BTS_FEAT_PAGING_COORDINATION, "PAGING_COORDINATION" },</span><br><span style="color: hsl(120, 100%, 40%);">+    { BTS_FEAT_IPV6_NSVC, "IPV6_NSVC" },</span><br><span style="color: hsl(120, 100%, 40%);">+        { BTS_FEAT_ACCH_REP, "ACCH_REP" },</span><br><span style="color: hsl(120, 100%, 40%);">+  { BTS_FEAT_CCN, "CCN" },</span><br><span style="color: hsl(120, 100%, 40%);">+    { BTS_FEAT_VAMOS, "VAMOS" },</span><br><span style="color: hsl(120, 100%, 40%);">+        {}</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span>diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map</span><br><span>index 0ea0678..7b2c18f 100644</span><br><span>--- a/src/gsm/libosmogsm.map</span><br><span>+++ b/src/gsm/libosmogsm.map</span><br><span>@@ -396,6 +396,7 @@</span><br><span> gsm48_decode_lai2;</span><br><span> osmo_bts_features_descs;</span><br><span> osmo_bts_feature_name;</span><br><span style="color: hsl(120, 100%, 40%);">+osmo_bts_features_names;</span><br><span> osmo_plmn_to_bcd;</span><br><span> osmo_plmn_from_bcd;</span><br><span> osmo_mcc_name;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/23587">change 23587</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/libosmocore/+/23587"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I699cd27512887d64d824be680303e70fff3677c1 </div>
<div style="display:none"> Gerrit-Change-Number: 23587 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>