Skip to content

feat: expose brand-specific identifiers in OpenPrintTag Response#6

Closed
gienne wants to merge 3 commits into
SimplyPrint:mainfrom
gienne:feat/response-brand-specific-ids
Closed

feat: expose brand-specific identifiers in OpenPrintTag Response#6
gienne wants to merge 3 commits into
SimplyPrint:mainfrom
gienne:feat/response-brand-specific-ids

Conversation

@gienne

@gienne gienne commented Jun 2, 2026

Copy link
Copy Markdown

Problem

BrandSpecificInstanceID, BrandSpecificPackageID and BrandSpecificMaterialID are decoded from the CBOR payload (MainSection keys 5-7) but not included in the JSON response of the card read endpoint, making them invisible to API consumers.

Fix

Add the three fields to the Response struct and populate them in ToResponse().

JSON keys follow the existing camelCase convention (instanceUuid, packageUuid, etc.).

Use cases

  • brandSpecificInstanceId: per-spool serial/lot number (e.g. Prusa instance reference) useful for traceability and inventory systems
  • brandSpecificPackageId: product/SKU reference for the package
  • brandSpecificMaterialId: material reference identifier

gienne added 3 commits June 1, 2026 17:49
WriteDataWithURL was calling writeNTAGPages(card, 4, ...) for all non-MIFARE
cards, including ISO 15693 (NFC-V) tags such as the NXP ICode SLIX2 used on
Prusa filament spools.

Two bugs for ISO 15693:
1. Wrong start block: NTAG user memory begins at page 4; ISO 15693 NDEF begins
   at block 1 (block 0 holds the Capability Container).
2. Padding to card.Size (320 bytes) caused writes to blocks 80-83, which are
   out of range for ICode SLIX2 (80 blocks, 0-79).

Fix: detect NFC-V protocol and write CC to block 0 then NDEF TLV from block 1,
mirroring the correct logic already present in WriteMultipleRecords.

Tested on ACR1552U with blank NXP ICode SLIX2 tags and with Prusa-branded
filament spool tags (write + readback verified).
Add BrandSpecificInstanceID, BrandSpecificPackageID and BrandSpecificMaterialID
to the Response struct so they are included in the JSON output of the card read
API endpoint.

These fields are already decoded from the CBOR payload (MainSection keys 5-7)
but were not propagated to the API response, making them invisible to consumers
of the /v1/readers/{n}/card endpoint.

Use cases:
- BrandSpecificInstanceID: per-spool serial/lot number (e.g. Prusa instance ref)
  useful for traceability and inventory management systems
- BrandSpecificPackageID: product/SKU reference for the package
- BrandSpecificMaterialID: material reference identifier

JSON keys follow the existing camelCase convention used by the other UUID
fields (instanceUuid, packageUuid, etc.).
@gienne gienne force-pushed the feat/response-brand-specific-ids branch from fc1fd32 to cbcef1e Compare June 3, 2026 17:08
@gienne gienne closed this Jun 3, 2026
@gienne

gienne commented Jun 3, 2026

Copy link
Copy Markdown
Author

Wrong content

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