Change in libosmocore[master]: add osmo_bts_features_names: short BTS feature strings

laforge gerrit-no-reply at lists.osmocom.org
Fri Apr 9 16:12:30 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/23587 )

Change subject: add osmo_bts_features_names: short BTS feature strings
......................................................................

add osmo_bts_features_names: short BTS feature strings

This will be used by osmo-bts-omldummy to parse features strings from
the cmdline.

Note that osmo_bts_feature_name() already exists to return the longer
descriptive value_strings from osmo_bts_features_descs (_descs!).
Luckily that misses the plural 'features' in the name, so that I can
still add a properly named osmo_bts_features_name() function that only
returns the name, matching the common pattern used in osmocom code.

Related: SYS#4895
Change-Id: I699cd27512887d64d824be680303e70fff3677c1
---
M include/osmocom/gsm/bts_features.h
M src/gsm/bts_features.c
M src/gsm/libosmogsm.map
3 files changed, 32 insertions(+), 1 deletion(-)

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



diff --git a/include/osmocom/gsm/bts_features.h b/include/osmocom/gsm/bts_features.h
index b174d3f..93d35f3 100644
--- a/include/osmocom/gsm/bts_features.h
+++ b/include/osmocom/gsm/bts_features.h
@@ -40,6 +40,11 @@
 const char *osmo_bts_feature_name(enum osmo_bts_features feature)
 	OSMO_DEPRECATED("Use osmo_bts_features_desc() instead");
 
+extern const struct value_string osmo_bts_features_names[];
+
+static inline const char *osmo_bts_features_name(enum osmo_bts_features val)
+{ return get_value_string(osmo_bts_features_names, val); }
+
 static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
 {
 	OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
diff --git a/src/gsm/bts_features.c b/src/gsm/bts_features.c
index c3f3667..fb3193f 100644
--- a/src/gsm/bts_features.c
+++ b/src/gsm/bts_features.c
@@ -47,8 +47,33 @@
 	{ 0, NULL }
 };
 
-/*! return string representation of a BTS feature */
+/*! return description string of a BTS feature (osmo_bts_features_descs).
+ * To get the plain feature name, use osmo_bts_features_name() instead. */
 const char *osmo_bts_feature_name(enum osmo_bts_features feature)
 {
 	return get_value_string(osmo_bts_features_descs, feature);
 }
+
+const struct value_string osmo_bts_features_names[] = {
+	{ BTS_FEAT_HSCSD, "HSCSD" },
+	{ BTS_FEAT_GPRS, "GPRS" },
+	{ BTS_FEAT_EGPRS, "EGPRS" },
+	{ BTS_FEAT_ECSD, "ECSD" },
+	{ BTS_FEAT_HOPPING, "HOPPING" },
+	{ BTS_FEAT_MULTI_TSC, "MULTI_TSC" },
+	{ BTS_FEAT_OML_ALERTS, "OML_ALERTS" },
+	{ BTS_FEAT_AGCH_PCH_PROP, "AGCH_PCH_PROP" },
+	{ BTS_FEAT_CBCH, "CBCH" },
+	{ BTS_FEAT_SPEECH_F_V1, "SPEECH_F_V1" },
+	{ BTS_FEAT_SPEECH_H_V1, "SPEECH_H_V1" },
+	{ BTS_FEAT_SPEECH_F_EFR, "SPEECH_F_EFR" },
+	{ BTS_FEAT_SPEECH_F_AMR, "SPEECH_F_AMR" },
+	{ BTS_FEAT_SPEECH_H_AMR, "SPEECH_H_AMR" },
+	{ BTS_FEAT_ETWS_PN, "ETWS_PN" },
+	{ BTS_FEAT_PAGING_COORDINATION, "PAGING_COORDINATION" },
+	{ BTS_FEAT_IPV6_NSVC, "IPV6_NSVC" },
+	{ BTS_FEAT_ACCH_REP, "ACCH_REP" },
+	{ BTS_FEAT_CCN, "CCN" },
+	{ BTS_FEAT_VAMOS, "VAMOS" },
+	{}
+};
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 0ea0678..7b2c18f 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -396,6 +396,7 @@
 gsm48_decode_lai2;
 osmo_bts_features_descs;
 osmo_bts_feature_name;
+osmo_bts_features_names;
 osmo_plmn_to_bcd;
 osmo_plmn_from_bcd;
 osmo_mcc_name;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/23587
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I699cd27512887d64d824be680303e70fff3677c1
Gerrit-Change-Number: 23587
Gerrit-PatchSet: 6
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210409/07c11d22/attachment.htm>


More information about the gerrit-log mailing list