EliasOenal / multimon-ng

GNU General Public License v2.0
923 stars 206 forks source link

Properly decode alphanumeric POCSAG messages #179

Closed girst closed 2 years ago

girst commented 2 years ago

Previously, the last character was truncated if the message length was an exact multiple of 40.

fixes #140 fixes #114

I replaced the nested while loop (which I admittedly don't fully understand) with an O(1) lookup, get7(). len was repurposed to store the number of characters instead of the number of nibbles, so we can iterate over message in a simpler way. While I was at it, I also wrote rev7() to make reversing the bit order more obvious.

I tested this against the test case provided in #140 and "in the wild" successfully.

EliasOenal commented 2 years ago

Thanks a lot for resolving the issue. Would you mind updating the copyright section of the file header with your name? This helps to meet the attribution requirements for some of the (Linux) distributions packaging multimon-ng.

girst commented 2 years ago

On Tue, Jan 18, 2022 at 04:33:45PM -0800, Elias Önal wrote:

Thanks a lot for resolving the issue. Would you mind updating the copyright section of the file header with your name? This helps to meet the attribution requirements for some of the (Linux) distributions packaging multimon-ng.

I've added my name to the copyright section.

Thanks for the review!