Skip to content

eds: Add first-class support for CiA 306 ObjFlags and Denotation#654

Open
bizfsc wants to merge 1 commit intocanopen-python:masterfrom
bizfsc:feat/cia306-objflags-denotation-v2
Open

eds: Add first-class support for CiA 306 ObjFlags and Denotation#654
bizfsc wants to merge 1 commit intocanopen-python:masterfrom
bizfsc:feat/cia306-objflags-denotation-v2

Conversation

@bizfsc
Copy link
Copy Markdown
Contributor

@bizfsc bizfsc commented May 4, 2026

ObjFlags (UNSIGNED32 bitfield) and Denotation (DCF-only string) are standard CiA 306 fields that were previously silently dropped. This PR adds first-class support for both.

Changes

  • ODVariable, ODRecord and ODArray gain an obj_flags: int = 0 attribute.
  • ODVariable gains a denotation: str = "" attribute.
  • New _get_obj_flags(eds, section) helper reads and validates the ObjFlags integer value.
  • ObjFlags is parsed for VAR/DOMAIN (via build_variable()), ARRAY and RECORD top-level objects.
  • ObjFlags is exported whenever non-zero.
  • Denotation is read in build_variable() and written only in DCF mode (device_commisioning=True), matching the CiA 306 specification.

Tests

  • test_reading_obj_flags — VAR with ObjFlags=0x1 reads back correctly
  • test_reading_obj_flags_default — standard objects default to 0
  • test_roundtrip_obj_flags — full EDS export/import cycle preserves obj_flags
  • test_denotation_roundtrip_dcfdenotation survives a DCF round-trip
  • test_denotation_not_exported_in_eds_modedenotation is absent in plain EDS export

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bizfsc bizfsc force-pushed the feat/cia306-objflags-denotation-v2 branch from 5dff918 to 90dbe07 Compare May 4, 2026 08:52
ObjFlags (UNSIGNED32 bitfield) and Denotation (DCF-only string) are
standard CiA 306 fields that are now parsed and exported explicitly.

Changes:
  * ODVariable, ODRecord and ODArray gain an obj_flags: int = 0 attribute.
  * ODVariable gains a denotation: str = '' attribute.
  * _get_obj_flags() helper reads and validates the ObjFlags integer value.
  * ObjFlags is parsed for VAR/DOMAIN (via build_variable), ARRAY and RECORD.
  * ObjFlags is exported whenever non-zero.
  * Denotation is read in build_variable() and written only in DCF mode
    (device_commisioning=True), matching the CiA 306 specification.
  * Adds test object 0x3060 (ObjFlags=0x1) to sample.eds and four new tests
    covering read, round-trip and DCF export for both fields.

Co-authored-by: FedericoSpada <FedericoSpada@users.noreply.github.com>
@bizfsc bizfsc force-pushed the feat/cia306-objflags-denotation-v2 branch from 90dbe07 to bccbd5c Compare May 4, 2026 09:00
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.

1 participant