Change in libosmocore[master]: BSSMAP: tweaks

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Apr 10 17:50:46 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13577


Change subject: BSSMAP: tweaks
......................................................................

BSSMAP: tweaks

Change two instances of Speech Version values to enum gsm0808_permitted_speech.
It is often not trivial to find the right values for a uint8_t member, giving
the enum name makes it a lot easier/safer to use.

In gsm0808_create_handover_required(), use msgb_tv_put() so that the enum's
storage size doesn't matter. (Already used for handover_performed)

Fix typo in doc of gsm0808_create_handover_required().

Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112
---
M TODO-RELEASE
M include/osmocom/gsm/gsm0808.h
M src/gsm/gsm0808.c
3 files changed, 6 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/13577/1

diff --git a/TODO-RELEASE b/TODO-RELEASE
index 7c81e32..db3be49 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -19,3 +19,5 @@
 		osmo_quote_str_buf()	  truncated string. This is no longer the case. e.g. a string 'truncated' in a
 					  9-char buffer used to print '"trunca"\0', which now becomes '"truncat\0'.
 libosmocore	osmo_quote_str_buf2()	New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND().
+libosmogsm	gsm0808_handover_required	Storage size changed, speech_version_used now an enum.
+		gsm0808_handover_performed	Storage size changed, speech_version_chosen now an enum.
diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h
index a1345c3..0f2bf1f 100644
--- a/include/osmocom/gsm/gsm0808.h
+++ b/include/osmocom/gsm/gsm0808.h
@@ -133,7 +133,7 @@
 	uint8_t current_channel_type_1;
 
 	bool speech_version_used_present;
-	uint8_t speech_version_used;
+	enum gsm0808_permitted_speech speech_version_used;
 
 	bool old_bss_to_new_bss_info_present;
 	struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info;
@@ -196,7 +196,7 @@
 	uint8_t chosen_encr_alg;
 
 	bool speech_version_chosen_present;
-	uint8_t speech_version_chosen;
+	enum gsm0808_permitted_speech speech_version_chosen;
 
 	bool speech_codec_chosen_present;
 	struct gsm0808_speech_codec speech_codec_chosen;
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 4873076..3307a5d 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -822,7 +822,7 @@
 
 /*! Create BSSMAP HANDOVER REQUIRED message.
  * \param[in] params  All information to be encoded.
- * \returns newly allocated msgb with BSSMAP REQUIRED message. */
+ * \returns newly allocated msgb with BSSMAP HANDOVER REQUIRED message. */
 struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_required *params)
 {
 	struct msgb *msg;
@@ -846,7 +846,7 @@
 
 	/* Speech Version (Used), 3.2.2.51 */
 	if (params->speech_version_used_present)
-		msgb_tv_fixed_put(msg, GSM0808_IE_SPEECH_VERSION, 1, &params->speech_version_used);
+		msgb_tv_put(msg, GSM0808_IE_SPEECH_VERSION, params->speech_version_used);
 
 	if (params->old_bss_to_new_bss_info_present)
 		put_old_bss_to_new_bss_information(msg, &params->old_bss_to_new_bss_info);

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112
Gerrit-Change-Number: 13577
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190410/9ba28208/attachment-0001.html>


More information about the gerrit-log mailing list