Skip to content

Restrict EEPROM device identity to catalog and fix read size - #13

Merged
kaklik merged 1 commit into
masterfrom
fix/eeprom-device-catalog-and-read-size
Jun 21, 2026
Merged

kaklik merged 1 commit into
masterfrom
fix/eeprom-device-catalog-and-read-size

Conversation

@kaklik

@kaklik kaklik commented Jun 21, 2026

Copy link
Copy Markdown
Member

The EEPROM manager dialog let the user write arbitrary device identity into EEPROM: device_type listed the whole DeviceType enum (incl. UNKNOWN) and device_version / hardware_revision were free 0-255 spin boxes, so combinations absent from xDOS_devices.yaml could be written.

Replace them with cascading combo boxes driven by KNOWN_DEVICES: device type lists only catalogued families, version is filtered by type, and HW revision by type+version (None shown as "—", mapped to stored byte 0). Loading EEPROM whose combination is not in the catalog now shows a warning and falls back to valid entries so it can be overwritten, instead of being silently accepted.

Also fix "Blob too short" on load: the dialog read a hardcoded 101 bytes while the struct is TOTAL_SIZE (113), so unpack_record always failed. Use TOTAL_SIZE for the real read, the log message, and the demo 0xFF fallback block.

The EEPROM manager dialog let the user write arbitrary device identity into
EEPROM: device_type listed the whole DeviceType enum (incl. UNKNOWN) and
device_version / hardware_revision were free 0-255 spin boxes, so combinations
absent from xDOS_devices.yaml could be written.

Replace them with cascading combo boxes driven by KNOWN_DEVICES: device type
lists only catalogued families, version is filtered by type, and HW revision by
type+version (None shown as "—", mapped to stored byte 0). Loading EEPROM whose
combination is not in the catalog now shows a warning and falls back to valid
entries so it can be overwritten, instead of being silently accepted.

Also fix "Blob too short" on load: the dialog read a hardcoded 101 bytes while
the struct is TOTAL_SIZE (113), so unpack_record always failed. Use TOTAL_SIZE
for the real read, the log message, and the demo 0xFF fallback block.
@kaklik
kaklik requested a review from roman-dvorak June 21, 2026 14:29

@roman-dvorak roman-dvorak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Předpokládám, že funkčnost řešení byla otestována

@kaklik
kaklik merged commit f18d01a into master Jun 21, 2026
2 of 6 checks passed
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.

2 participants