[MERGED] libosmocore[master]: Add function to check TA validity

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
Sat Jul 16 21:00:01 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: Add function to check TA validity
......................................................................


Add function to check TA validity

Check if given Timing Advance is valid according to 3GPP TS 44.018 §
10.5.2.40.

Change-Id: I5cb6149d6e36fda8cb3f557e4d6d3a724da805a5
Related: OS#1545
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h
index e442c7f..7efd7e8 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -947,6 +947,16 @@
 	return (hdr->proto_discr & 0xf0) >> 4;
 }
 
+/*! \brief Check if TA is valid according to 3GPP TS 44.018 § 10.5.2.40
+ *  \param[in] ta Timing Advance value
+ *  \returns true if ta is valid, false otherwise
+ *  Note: Rules for GSM400 band are ignored as it's not implemented in practice.
+ */
+static inline bool gsm48_ta_is_valid(uint8_t ta)
+{
+	return (ta < 64);
+}
+
 static inline uint8_t gsm48_hdr_trans_id_flip_ti(const struct gsm48_hdr *hdr)
 {
 	return gsm48_hdr_trans_id(hdr) ^ 0x08;

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

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



More information about the gerrit-log mailing list