Skip to content

fix(dll): TYPE_2_1/2_2 carry one OD octet per Table A.10 - #27

Merged
w1ne merged 1 commit into
developfrom
fix/type2-od-width
Sep 18, 2026
Merged

w1ne merged 1 commit into
developfrom
fix/type2-od-width

Conversation

@w1ne

@w1ne w1ne commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Fixes #26 (device side of the train).

Table A.10 gives TYPE_2_1 to TYPE_2_6 exactly one On-request Data octet and reserves two OD octets for TYPE_2_V (OPERATE code 5). The device DLL (iolink_dll_init, device_apply_stack_config) and the Python virtual master (MSequenceType.get_od_len) used two OD octets for every TYPE_2_x, so our stacks agreed with each other but not with a third-party peer on any TYPE_2_1/2_2 profile.

  • od_len is 2 only for TYPE_2_V, 1 for everything else;
  • regression tests that pinned the old width updated (the 2-octet Type-0 DeviceOperate test moves to TYPE_2_V, which is now the only 2-OD type);
  • capability code derivation was already Table A.10-correct (TYPE_2_1/2_2 -> code 0, 1 OD; TYPE_2_V -> code 5) and now matches the actual DLL width.

Gates: device ctest 22/22, virtual-master unit tests 14/14, clang-format clean on all changed files.

Table A.10 gives TYPE_2_1 to TYPE_2_6 exactly one On-request Data octet and
reserves the two-octet OD for TYPE_2_V (OPERATE M-sequence code 5). The device
DLL, the test harness and the Python virtual master all used two OD octets for
every TYPE_2_x, which agrees between our own stacks but not with a third-party
peer on any TYPE_2_1/2_2 profile.

Derive od_len as 2 only for TYPE_2_V, update the regression tests that pinned
the old width (the 2-octet Type-0 DeviceOperate regression moves to TYPE_2_V),
and align the Python M-sequence generator comment/values.

Device ctest 22/22 and the virtual-master unit tests 14/14 are green.
@w1ne
w1ne merged commit 62a2197 into develop Sep 18, 2026
3 checks passed
@w1ne
w1ne deleted the fix/type2-od-width branch September 19, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TYPE_2_x M-sequences carry a single OD octet (Table A.10)

1 participant