Order Tray | Contact Us | Home | SIG Lists

[ax25-layer2] NRZI problem?

Samuel Falvo II sam.falvo at gmail.com
Fri May 4 17:56:27 UTC 2012


On Fri, May 4, 2012 at 10:49 AM, Mario Doerr <mailinglist at xyphur.de> wrote:
> unsigned char NRZI_rd_byte(unsigned char input)
> {
>        unsigned char byte = 0;
>        unsigned int n;
>        static unsigned char toggle = 0;
>
>        for(n=8; n != 0; n--)
>        {
>                byte <<= 1;
>
>                if( ( input & 0x80 ) == ( toggle & 0x80 ) )
>                        byte |= 0x01;
>
>                toggle = input & 0x80;
>
>                input <<= 1;
>        }
>        return(byte);
> }

I noticed that your NRZI decoder ignores stuff bits.  You'll need to
compensate for those in the NRZI decoder in order to get a proper
bit-stream.

--
Samuel A. Falvo II


More information about the ax25-layer2 mailing list