[PATCH] rewritten gsm 7 bit encoding

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/OpenBSC@lists.osmocom.org/.

Nico Golde openbsc at ngolde.de
Fri Jul 9 16:56:30 UTC 2010


Hi,
* Holger Hans Peter Freyther <holger at freyther.de> [2010-07-09 13:00]:
> On 07/09/2010 04:58 AM, Sylvain Munaut wrote:
> >> (even though what could be properly decoded before
> >> also can be properly decoded now, no change for this).
> > 
> > Well, I think that before
> > 
> > encode(decode(x)) == x
> 
> if the decoder is too much work right now, you can change the test to
> only test encoding. So make it encode(x) == expected_result and add one
> test case for the string that was failing, convert the old decoding to
> decode(x) == expected_result as well. and you might feel like adding an
> expected failure (because the code is missing).
> 
> The benefit of changing the test is that you can more easily convince me
> that the new code can do everything the old promised and is fixing
> something that didn't work with the old one.

Alright, cleaned up the previous code a bit, implemented the
decoder and added a test case which the previous code
encoded incorrect. Please note that just using the new test
case string in the old code will also pass the test even
though the encoding is wrong. You need to compare the
encoded values to e.g. output of pduspy[0]. Patch attached.

Cheers
Nico
[0] http://www.nobbi.com/download/pduspy.zip



More information about the OpenBSC mailing list