Skip to content

void DCC_Decoder::State_Execute() seems to not follow NMRA spec in one case..  #5

@wbertels

Description

@wbertels

While fiddeling around with the DCC monitor and decoder I found the line:

        ///////////////////////////////////////////////////////////
        // Handle as a extd accessory decoder packet  (4 bytes)
    if( ((gPacket[0] & 0xC0) == 0x80)  &&  ((gPacket[1] & 0x85) == 0x01) )

As the NMRA standard
https://www.nmra.org/sites/default/files/s-9.2.1_2012_07.pdf

describes the bytes for the extended accessory decoder as:
{preamble} 0 10AAAAAA 0 0AAA0AA1 0 000XXXXX 0 EEEEEEEE 1

        Comment: check 0x85 is a mask with 10000101, should be 10001001 according to NMRA standard??? 

it seems the 0x85 should be 0x89, as the bits 7, 3 and 0 need to be checked and masked, adding up 0x80 +0x08 +0x01.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions