Attention is currently required from: laforge, fixeria.
Hello Jenkins Builder, laforge, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/30945
to look at the new patch set (#2).
Change subject: gsm0408_test: add unittest for gsm_gsmtime2fn()
......................................................................
gsm0408_test: add unittest for gsm_gsmtime2fn()
The function gsm_gsmtime2fn(), which is used to compute a frame number
value from given starting time values T1, T2 and T3 has no unit test.
Due to to the modulo that is used the computation can be a bit tricky.
Lets add a unit-test to make sure the function works as expected.
Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
---
M tests/gsm0408/gsm0408_test.c
1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/30945/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30945
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
Gerrit-Change-Number: 30945
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, fixeria.
Hello Jenkins Builder, laforge, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/30946
to look at the new patch set (#2).
Change subject: gsm_utils: improve gsm_gsmtime2fn()
......................................................................
gsm_utils: improve gsm_gsmtime2fn()
The function gsm_gsmtime2fn() uses a hack to account for the truncated
modulo implementation of C/C++. libosmocore offers proven modulo
functions, so lets use OSMO_MOD_FLR() instead. Also arange the formula
so that it looks more like the one in the spec.
Also add better spec references and a final modulo GSM_MAX_FN to
prevent frame number results that exceed the valid range.
Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
---
M src/gsm/gsm_utils.c
1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/46/30946/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30946
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/30946 )
Change subject: gsm_utils: improve gsm_gsmtime2fn()
......................................................................
gsm_utils: improve gsm_gsmtime2fn()
The function gsm_gsmtime2fn() uses a hack to account for the truncated
modulo implementation of C/C++. libosmocore offers proven floored modulo
functions, so lets use OSMO_MOD_FLR() instead. Also arange the formula
so that it looks more like the one in the spec.
Also add better spec references and a final modulo GSM_MAX_FN to
prevent frame number results that exceed the valid range.
Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
---
M src/gsm/gsm_utils.c
1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/46/30946/1
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 3b0ec6a..e0c3052 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -887,8 +887,19 @@
* \returns GSM Frame Number */
uint32_t gsm_gsmtime2fn(struct gsm_time *time)
{
- /* TS 05.02 Chapter 4.3.3 TDMA frame number */
- return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1));
+ uint32_t fn;
+
+ /* See also:
+ * 3GPP TS 04.08, section 10.5.2.38, GSM TS 05.02 section 4.3.3, and
+ * 3GPP TS 08.58, section 9.3.8 */
+ fn = 51 * OSMO_MOD_FLR((time->t3-time->t2), 26) + time->t3 + 51 * 26 * time->t1;
+
+ /* Note: Corrupted input values may cause a resulting frame number
+ * larger then the maximum permitted value of GSM_MAX_FN. Even though
+ * the caller is expected to check the input values beforehand we must
+ * make sure that the result cannot exceed the value range of a valid
+ * GSM frame number. */
+ return fn % GSM_MAX_FN;
}
char *osmo_dump_gsmtime_buf(char *buf, size_t buf_len, const struct gsm_time *tm)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30946
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/30945 )
Change subject: gsm0408_test: add unittest for gsm_gsmtime2fn()
......................................................................
gsm0408_test: add unittest for gsm_gsmtime2fn()
The function gsm_gsmtime2fn(), which is used to compute a frame number
value from given starting time values T1, T2 and T3 has no unit test.
Due to to the modulo that is used the computation can be a bit tricky.
Lets add a unit-test to make sure the function works as expected.
Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
---
M tests/gsm0408/gsm0408_test.c
1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/30945/1
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index a226718..4436d51 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -1760,6 +1760,27 @@
}
}
+static void test_gsm_gsmtime2fn(void)
+{
+ struct gsm_time gsm_time;
+ uint32_t fn;
+ uint32_t fn_recovered;
+
+ for (fn = 0; fn < 42432; fn++) {
+ gsm_time.t1 = (fn / 1326) % 32;
+ gsm_time.t2 = fn % 26;
+ gsm_time.t3 = fn % 51;
+
+ fn_recovered = gsm_gsmtime2fn(&gsm_time);
+
+ if (fn_recovered != fn) {
+ printf(" Wrong frame number computed! t1=%d, t2=%d, t3=%d ==> fn=%d, expected fn=%d\n",
+ gsm_time.t1, gsm_time.t2, gsm_time.t3, fn_recovered, fn);
+ OSMO_ASSERT(false);
+ }
+ }
+}
+
int main(int argc, char **argv)
{
test_bearer_cap();
@@ -1779,6 +1800,7 @@
test_range_encoding();
test_power_ctrl();
test_rach_tx_integer_raw2val();
+ test_gsm_gsmtime2fn();
return EXIT_SUCCESS;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30945
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
Gerrit-Change-Number: 30945
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmocom-bb/+/30943
to look at the new patch set (#3).
Change subject: layer23: Introduce l23_app_start() API step
......................................................................
layer23: Introduce l23_app_start() API step
This commit is a preparation towards having shared VTY infrastructure
for layer23 apps. Having 2 steps (first init(), then start()) allows
the apps easily struct allocation & initialization, and then start doing
work after VTY config has been read.
Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/common/main.c
M src/host/layer23/src/misc/app_bcch_scan.c
M src/host/layer23/src/misc/app_cbch_sniff.c
M src/host/layer23/src/misc/app_ccch_scan.c
M src/host/layer23/src/misc/app_cell_log.c
M src/host/layer23/src/modem/app_modem.c
7 files changed, 66 insertions(+), 24 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/43/30943/3
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30943
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
Gerrit-Change-Number: 30943
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30943 )
Change subject: layer23: Introduce l23_app_start() API step
......................................................................
Patch Set 2:
This change is ready for review.
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30943
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
Gerrit-Change-Number: 30943
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 12 Jan 2023 11:57:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30942 )
Change subject: layer23: Fix gcc warning sprintf() writing on too short buf
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30942
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
Gerrit-Change-Number: 30942
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 12 Jan 2023 11:39:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment