[MERGED] libosmocore[master]: gsm: add gsm0808_speech_codec_type_names

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Jan 12 13:03:02 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: gsm: add gsm0808_speech_codec_type_names
......................................................................


gsm: add gsm0808_speech_codec_type_names

Used for logging Speech Codec List entries in osmo-bsc, during handover
decision.

Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832
---
M include/osmocom/gsm/protocol/gsm_08_08.h
M src/gsm/gsm0808.c
M src/gsm/libosmogsm.map
3 files changed, 20 insertions(+), 0 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h
index 6ae6855..ba347ef 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -6,6 +6,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <osmocom/core/linuxlist.h>
+#include <osmocom/core/utils.h>
 
 /*
  * this is from GSM 03.03 CGI but is copied in GSM 08.08
@@ -420,6 +421,10 @@
 	GSM0808_SCT_CSD	= 0xfd, /*!< CSData (see also TS 26.103) */
 };
 
+extern const struct value_string gsm0808_speech_codec_type_names[];
+static inline const char *gsm0808_speech_codec_type_name(enum gsm0808_speech_codec_type val)
+{ return get_value_string(gsm0808_speech_codec_type_names, val); }
+
 /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */
 enum gsm0808_chosen_enc_alg {
 	GSM0808_ALG_ID_A5_0	= 0x01,
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index abf3d25..c0be374 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -842,4 +842,18 @@
 	return get_value_string(gsm0808_bssap_names, msg_type);
 }
 
+const struct value_string gsm0808_speech_codec_type_names[] = {
+	{ GSM0808_SCT_FR1, "FR1" },
+	{ GSM0808_SCT_FR2, "FR2" },
+	{ GSM0808_SCT_FR3, "FR3" },
+	{ GSM0808_SCT_FR4, "FR4" },
+	{ GSM0808_SCT_FR5, "FR5" },
+	{ GSM0808_SCT_HR1, "HR1" },
+	{ GSM0808_SCT_HR3, "HR3" },
+	{ GSM0808_SCT_HR4, "HR4" },
+	{ GSM0808_SCT_HR6, "HR6" },
+	{ GSM0808_SCT_CSD, "CSD" },
+	{ 0, NULL }
+};
+
 /*! @} */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 5611ba3..985ec83 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -172,6 +172,7 @@
 gsm0808_dec_cell_id_list;
 gsm0808_chan_type_to_speech_codec;
 gsm0808_speech_codec_from_chan_type;
+gsm0808_speech_codec_type_names;
 
 gsm0858_rsl_ul_meas_enc;
 

-- 
To view, visit https://gerrit.osmocom.org/5767
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list