Skip to content

Conversation

@tensoid
Copy link
Contributor

@tensoid tensoid commented May 6, 2025

Changes

  • Removed the first 14 bytes (code, flags, dataBlockStartAddr, startAddress, endAddress) from the payload construction in MP::writeMemory since these fields are already handled by the MC::writeMemory.

  • Removed setAddress method as it is no longer used in the updated implementation.

  • Improved chunking logic in the memory write operation:
    Instead of always using the maximum APDU length, the range is now capped based on the remaining data and the actual max APDU size.

Anything else you would like me to change?
Also a quick question, is the max apdu size written down somewhere in the spec, or where did you get that number from? I cant seem to find it in the spec.

Fixes #152

@bmalinowsky bmalinowsky merged commit 0d24468 into calimero-project:master May 12, 2025
0 of 2 checks passed
@bmalinowsky
Copy link
Collaborator

Thanks for addressing this issue.

I added a few commits to make memory services more deterministic wrt which service is used and what apdu size should be supported. (Note, Calimero currently doesn't check line couplers for configuration. And the check most likely introduces some delay.)

The max. apdu size is device & network specific. All devices have to support an apdu of 15 bytes, but new services are written for 254 (the max. that the device property might return).

bmalinowsky added a commit that referenced this pull request May 31, 2025
Fix apdu construction and chunking in MP::writeMemory (#152)
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.

Incorrect address shifting and apdu construction bugs in writeMemory (Management Procedures)

2 participants