Skip to content

Bump AgIsoStack to pick up the DataSpan fix (wrong DDI-to-element mapping) #110

Closed

Description

@gunicsba

The TC maps DDIs to device elements by iterating DeviceElementObject::get_child_object_ids(). That returns a DataSpan<const std::uint16_t>, and AgIsoStack's DataSpan scaled end() and operator[] by sizeof(T) twice. Iterating the span therefore read twice as many child IDs as the element has, and the second half came from whatever memory followed the list. Depending on heap contents, Section Control State (DDI 160) could be subscribed on, and written to, an element that doesn't list it. The implement then stayed in manual and ignored setpoints.

Fixed upstream in Open-Agriculture/AgIsoStack-plus-plus#783.

To do once #783 is merged: bump the isobus GIT_TAG in CMakeLists.txt (currently c0e1ebb06a2ad9d5bf86c98b3d028ab8fa350130) to a commit that includes the fix.

The four loops in src/task_controller.cpp that iterate the span (find_owning_element_number, the parent lookup in is_element_or_parent_off, and both loops in request_measurement_commands) need no change after the bump.

Replaces the workaround in #109.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions