aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-16 22:41:51 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-08 20:32:56 +0000
commitafacc2be9ff2fccf6ff7c9c00849081627754ace (patch)
tree2bc2f87209101d8f0cd9bd6a229ba97409df2157 /src/gsm
parent1284c3e96170b1622106097e944e07354549bb2e (diff)
add gsm0808 channel enum to IE val conversion functions
Add: - gsm0808_current_channel_type_1() - gsm0808_permitted_speech() - gsm0808_chosen_channel() - gsm0808_channel_type_name() gsm0808_permitted_speech() is moved from osmo-bsc's bssap_speech_from_lchan(); gsm0808_chosen_channel() is moved from osmo-bsc's lchan_to_chosen_channel(); Rationale: will be re-used by inter-BSC handover, makes sense to keep with the other gsm0808 utils. Related: OS#2283 (inter-BSC handover, BSC side) Change-Id: I8a3cc5d4548e9a78d945d54c69ccced251edcec9
Diffstat (limited to 'src/gsm')
-rw-r--r--src/gsm/gsm0808_utils.c9
-rw-r--r--src/gsm/libosmogsm.map1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 8ef8e240..2c659bba 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -1273,4 +1273,13 @@ const char *gsm0808_cell_id_list_name(const struct gsm0808_cell_id_list2 *cil)
#undef APPEND_STR
#undef APPEND_CELL_ID_U
+const char *gsm0808_channel_type_name(const struct gsm0808_channel_type *ct)
+{
+ static char buf[128];
+ snprintf(buf, sizeof(buf), "ch_indctr=0x%x ch_rate_type=0x%x perm_spch=%s",
+ ct->ch_indctr, ct->ch_rate_type,
+ osmo_hexdump(ct->perm_spch, ct->perm_spch_len));
+ return buf;
+}
+
/*! @} */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index f04fd58c..8c64020a 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -188,6 +188,7 @@ gsm0808_cell_id_u_name;
gsm0808_chan_type_to_speech_codec;
gsm0808_speech_codec_from_chan_type;
gsm0808_speech_codec_type_names;
+gsm0808_channel_type_name;
gsm0858_rsl_ul_meas_enc;