Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes NDEF issues in
UltralightCard
:FormatNdef
reads block 3 (the OTP block) to determine if it contains the correct values; if not, it writes to it. Then it writes an empty NDEF tag in block 4. However, it relies upon theCommand
andData
properties being set by the write to block 3. If the write to block 3 didn't happen, then instead of writing to block 4 it was reading block 4.WriteNdefMessage
intends to compare the required size for the NDEF tag against the available memory on the card, but there is an error in the comparison. Also, it will now throwArgumentOutOfRangeException
when the size is too large (instead of returningfalse
), so that it is more consistent with behavior ofMifareCard.WriteNdefMessage
. The code was treating a non-positive return fromRunUltralightCommand
as an error, but in the case of a successful write it returns 0.Microsoft Reviewers: Open in CodeFlow