summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-03-28 17:05:40 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-08 07:44:46 +0000
commite0c65301d5786be04cf4731f1cdeed05c4442482 (patch)
tree379c1481eb20eb43970e5b4cf915285eb46d1217 /include
parentfa896abbb3c18af46aa398d6e6708a275d42a863 (diff)
gsm0808: Add utils for Channel Type
The planned support for true A over IP requires the encoding of the a Channel Type element (see also ASSIGNMENT REQUEST). This commt adds encoding/decoding functionality and tests for the element mentioned above, however, it is not yet actively used. Change-Id: Id0e2164d84b8cbcc6fe6a090fc7f40a1251421d7
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/gsm/gsm0808_utils.h8
-rw-r--r--include/osmocom/gsm/protocol/gsm_08_08.h9
2 files changed, 17 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h
index b5ddbdb7..48e737d1 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -47,3 +47,11 @@ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg,
/* Decode Speech Codec list */
int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl,
const uint8_t *elem, uint8_t len);
+
+/* Encode Channel Type element */
+uint8_t gsm0808_enc_channel_type(struct msgb *msg,
+ const struct gsm0808_channel_type *ct);
+
+/* Decode Channel Type element */
+int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct,
+ const uint8_t *elem, uint8_t len);
diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h
index 3e5514dc..e2355f68 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -438,3 +438,12 @@ struct gsm0808_speech_codec_list {
struct gsm0808_speech_codec codec[SPEECH_CODEC_MAXLEN];
uint8_t len;
};
+
+/* 3GPP TS 48.008 3.2.2.11 Channel Type */
+#define CH_TYPE_PERM_SPCH_MAXLEN 9
+struct gsm0808_channel_type {
+ uint8_t ch_indctr;
+ uint8_t ch_rate_type;
+ uint8_t perm_spch[CH_TYPE_PERM_SPCH_MAXLEN];
+ unsigned int perm_spch_len;
+};