Skip to content

Memory Read space is sometimes incorrect #98

Description

@Poikilos

This PR #96 is almost ready. There seems to be only one problem (at d60cc42). When I read from space 251 I am getting XML instead of the value there.

  • The issue does not occur on every segment.

Relevant part of CS-105's CDI:

    <segment space='251' origin='1'>
        <name>User Info Settings</name>
        <description>Change name and description of this Command Station for LCC network browsers.</description>
        <string size='63'>
            <name>User Name</name>
            <description>This name will appear in network browsers for this device.</description>
        </string>
        <string size='64'>
            <name>User Description</name>
            <description>This description will appear in network browsers for this device.</description>
        </string>
    </segment>

Steps to reproduce issue:

  • Open examples_gui.py
  • For IP type "Detect".
  • Manually enter the destination Node ID & IP address/hostname, or do the following detection steps:
    • Choose a command station from the TCP service name list.
    • Click "Copy digits to Far Node ID"
  • Connect
  • Refresh
  • Expand "User Info Settings"
  • Select "User Name"
  • Click "Read"

Expected result: Read same value as PanelPro's LCC Configuration dialog

Actual result: We get the XML according to the offset and length given (wrong space). In this case, '?xml version="1.0" encoding="utf-8"?>\n<cdi xmlns:xsi="http://ww'.

  • Console output:
read: space=251=0xfb address=1=0x1 size=63=0x3f
No null terminator in bytearray(b'?xml version="1.0" encoding="utf-8"?>\n<cdi xmlns:xsi="http://ww')
  • JMRI gets the expected value (a string previously set by the user), demonstrating that value itself is not mangled on the device.

An example of a space that works fine is:

    <segment space='253' origin='128'>
        <name>System Settings</name>
        <description>Configuration options related to the DCC functionality, including Track Output.</description>
        <group offset='4'/>
        <group>
            <name>Track Output</name>
            <description>Configuration options for the Command Station's Mainline Output, such as short circuit limits.</description>
            <int size='2'>
                <name>Booster Trip Current</name>
                <description>Current limit in milliamps at which the booster will detect an overload and shutdown (1000 to 5250 milliamps). Inrush current above this threshold is allowed.</description>
                <min>1000</min>
                <max>5250</max>
                <default>5250</default>
            </int>
            <int size='2'>
                <name>Booster Trip Inrush Delay</name>
                <description>This is the delay (10 to 320 milliseconds) to hold off on tripping the booster if the "Booster Trip Current" limit is reached.</description>
                <min>10</min>
                <max>320</max>
                <default>320</default>
            </int>
            <int size='2'>
                <name>Booster Kill Current</name>
                <description>Current limit in milliamps at which the booster will detect a short circuit and shutdown (2000 to 9000 milliamps). This is an absolute limit regardless of inrush current. Typically this value is equal to or larger than the "Booster Trip Current".</description>
                <min>2000</min>
                <max>9000</max>
                <default>9000</default>
            </int>

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