fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/28177 )
Change subject: coding: separate gsm0503_tch_a[fh]s_decode_inband()
......................................................................
coding: separate gsm0503_tch_a[fh]s_decode_inband()
These functions can be re-used for parsing in-band data from DTX
specific frames like SID_FIRST, SID_UPDATE, SID_ONSET, etc.
Change-Id: I0106de7a7f87517006e323299b2dc08457d1c6cf
Related: OS#5570
---
M src/coding/gsm0503_coding.c
1 file changed, 46 insertions(+), 26 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index 168e120..6f33b78 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -2115,6 +2115,26 @@
return 0;
}
+/* TCH/AFS: parse codec ID (CMI or CMC/CMR) from coded in-band data (16 bit) */
+static uint8_t gsm0503_tch_afs_decode_inband(const sbit_t *cB)
+{
+ unsigned int id = 0, best = 0;
+ unsigned int i, j, k;
+
+ for (i = 0; i < 4; i++) {
+ /* FIXME: why not using remaining (16 - 8) soft-bits here? */
+ for (j = 0, k = 0; j < 8; j++)
+ k += abs(((int)gsm0503_afs_ic_sbit[i][j]) - ((int)cB[j]));
+
+ if (i == 0 || k < best) {
+ best = k;
+ id = i;
+ }
+ }
+
+ return id;
+}
+
/*! Perform channel decoding of a TCH/AFS channel according TS 05.03
* \param[out] tch_data Codec frame in RTP payload format
* \param[in] bursts buffer containing the symbols of 8 bursts
@@ -2157,7 +2177,7 @@
{
sbit_t iB[912], cB[456], h;
ubit_t d[244], p[6], conv[250];
- int i, j, k, best = 0, rv, len, steal = 0, id = -1;
+ int i, rv, len, steal = 0, id = -1;
*n_errors = 0; *n_bits_total = 0;
static ubit_t sid_first_dummy[64] = { 0 };
sbit_t sid_update_enc[256];
@@ -2236,18 +2256,8 @@
}
}
- for (i = 0; i < 4; i++) {
- for (j = 0, k = 0; j < 8; j++)
- k += abs(((int)gsm0503_afs_ic_sbit[i][j]) - ((int)cB[j]));
-
- if (i == 0 || k < best) {
- best = k;
- id = i;
- }
- }
-
- /* Check if indicated codec fits into range of codecs */
- if (id >= codecs) {
+ /* Parse codec ID (CMI or CMC/CMR) and check if it fits into range of codecs */
+ if ((id = gsm0503_tch_afs_decode_inband(&cB[0])) >= codecs) {
/* Codec mode out of range, return id */
return id;
}
@@ -2578,6 +2588,26 @@
return -1;
}
+/* TCH/AHS: parse codec ID (CMI or CMC/CMR) from coded in-band data (16 bit) */
+static uint8_t gsm0503_tch_ahs_decode_inband(const sbit_t *cB)
+{
+ unsigned int id = 0, best = 0;
+ unsigned int i, j, k;
+
+ for (i = 0, k = 0; i < 4; i++) {
+ /* FIXME: why not using remaining (16 - 4) soft-bits here? */
+ for (j = 0, k = 0; j < 4; j++)
+ k += abs(((int)gsm0503_ahs_ic_sbit[i][j]) - ((int)cB[j]));
+
+ if (i == 0 || k < best) {
+ best = k;
+ id = i;
+ }
+ }
+
+ return id;
+}
+
/*! Perform channel decoding of a TCH/AFS channel according TS 05.03
* \param[out] tch_data Codec frame in RTP payload format
* \param[in] bursts buffer containing the symbols of 8 bursts
@@ -2622,7 +2652,7 @@
{
sbit_t iB[912], cB[456], h;
ubit_t d[244], p[6], conv[135];
- int i, j, k, best = 0, rv, len, steal = 0, id = -1;
+ int i, rv, len, steal = 0, id = -1;
static ubit_t sid_first_dummy[64] = { 0 };
/* only unmap the stealing bits */
@@ -2738,18 +2768,8 @@
}
}
- for (i = 0; i < 4; i++) {
- for (j = 0, k = 0; j < 4; j++)
- k += abs(((int)gsm0503_ahs_ic_sbit[i][j]) - ((int)cB[j]));
-
- if (i == 0 || k < best) {
- best = k;
- id = i;
- }
- }
-
- /* Check if indicated codec fits into range of codecs */
- if (id >= codecs) {
+ /* Parse codec ID (CMI or CMC/CMR) and check if it fits into range of codecs */
+ if ((id = gsm0503_tch_ahs_decode_inband(&cB[0])) >= codecs) {
/* Codec mode out of range, return id */
return id;
}
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28177
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0106de7a7f87517006e323299b2dc08457d1c6cf
Gerrit-Change-Number: 28177
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/28186 )
Change subject: contrib/jenkins.sh: skip upload if nothing new
......................................................................
contrib/jenkins.sh: skip upload if nothing new
The contrib/jenkins.sh script gets triggered daily. Do not upload new
files unless a new commit was added (then the filename changes).
Otherwise the binary and timestamp change on the server each day, which
is confusing and potentially makes catching regressions harder.
I've also considered disabling the daily trigger for this repository,
but I think it's better to keep it so we notice without much delay if
changes in libosmocore or the toolchain cause a build failure.
Change-Id: I3f70d6149b29ec2ff7f185dfae8bc8d4a1953dc2
---
M contrib/jenkins.sh
1 file changed, 16 insertions(+), 8 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 7877dcf..961acf1 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -71,14 +71,22 @@
[ftp.osmocom.org]:48 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8iivY70EiR5NiGChV39gRLjNpC8lvu1ZdHtdMw2zuX
EOF
SSH_COMMAND="ssh -o 'UserKnownHostsFile=/build/known_hosts' -p 48"
- rsync --archive --copy-links --verbose --compress --delete --rsh "$SSH_COMMAND" \
- $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.{bin,elf} \
- binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/latest/
- rsync --archive --verbose --compress --rsh "$SSH_COMMAND" \
- --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.bin \
- --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.elf \
- $TOPDIR/sysmoOCTSIM/gcc/*-*.{bin,elf} \
- binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/all/
+ LATEST_BIN="$(cd "$TOPDIR"/sysmoOCTSIM/gcc/; ls -1 sysmoOCTSIM-*-*.bin)"
+
+ echo "LATEST_BIN: $LATEST_BIN"
+
+ if rsync --rsh "$SSH_COMMAND" binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/all/ | grep -q "$LATEST_BIN"; then
+ echo "Skipping upload, $LATEST_BIN has already been uploaded."
+ else
+ rsync --archive --copy-links --verbose --compress --delete --rsh "$SSH_COMMAND" \
+ $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.{bin,elf} \
+ binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/latest/
+ rsync --archive --verbose --compress --rsh "$SSH_COMMAND" \
+ --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.bin \
+ --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.elf \
+ $TOPDIR/sysmoOCTSIM/gcc/*-*.{bin,elf} \
+ binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/all/
+ fi
fi
echo
--
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/28186
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: I3f70d6149b29ec2ff7f185dfae8bc8d4a1953dc2
Gerrit-Change-Number: 28186
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28162 )
Change subject: pySim-shell: catch exceptions from walk() while exporting
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
File pySim-shell.py:
https://gerrit.osmocom.org/c/pysim/+/28162/comment/750ca161_b9e8a458
PS2, Line 679: except Exception as e:
Does pySim-shell support multi-line comments in a script file? If so, I would do:
try:
...
except e:
...
import traceback
print("'''")
print(traceback.format_exc())
print("'''")
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28162
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3edc250ef2a84550c5b821a72e207e4d685790a5
Gerrit-Change-Number: 28162
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: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 26 May 2022 20:18:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28169 )
Change subject: pySim-shell: match SW in apdu command
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
File pySim-shell.py:
https://gerrit.osmocom.org/c/pysim/+/28169/comment/6e3f8559_23824a41
PS1, Line 249: expect_sw
I would avoid mixing '-' and '_' in command options, '--expect-sw' looks more natural to me.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28169
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic5a52d7cf533c51d111850eb6d8147011a48ae6c
Gerrit-Change-Number: 28169
Gerrit-PatchSet: 1
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: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 26 May 2022 20:06:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28170 )
Change subject: filesystem: also return the encoded FCP from probe_file
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28170
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia5659e106fb0d6fb8b77506a10eba309e764723e
Gerrit-Change-Number: 28170
Gerrit-PatchSet: 1
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: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 26 May 2022 19:42:17 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment