[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/.

Holger Hans Peter Freyther holger at freyther.de
Mon Jul 19 19:06:18 UTC 2010


On 07/10/2010 12:56 AM, Nico Golde wrote:

> 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.

Hi Nico,

I have finally applied your patch, thanks for poking me. I have
also made two modifications. The first is to separate testing of
encoding/decoding and comparing it to a byte array/string, the
second is to fix a possible off by one.

I used the current result of the encoding and there seems to
be at least one more bug with our encoding routines. We append
zero byte(s) at the end that are not touched by the encoding
routine but covered by the length.

A nice way to test this is to change the memset(something, 0 to
memset(something, 23 and see how it is going to change.

Would you be interested in changing that?




More information about the OpenBSC mailing list