Closed AlexanderMaleckij closed 1 year ago
@AlexanderMaleckij there has been quite few improvements in the cards on the .NET IoT repository. See latest PR here https://github.com/dotnet/iot/pull/2028 and here https://github.com/dotnet/iot/pull/2027 which seems to fix those kind of issues.
So feel free to take those changes, incorporate them into the IoT Device repository here https://github.com/nanoframework/nanoFramework.IoT.Device
And then you'll help a lot of people with this fix :-) Thanks in advance!
Library/API/IoT binding
nanoFramework.Iot.Device.Mfrc522 NuGet package
Visual Studio version
No response
.NET nanoFramework extension version
No response
Target name(s)
No response
Firmware version
No response
Device capabilities
No response
Description
Transceive method does not work properly when called with a command to write data. It also affects the WriteDataBlock method from the
MifareCard
class that uses it. According to datasheet (section 11.3), 2 separate commands must be sent to write a data block, while in the current implementation, only one command is sent.WriteDataBlock
under the hood calls 1 time Transceive method of theCardTransceiver
abstract class, with thedataToSend
parameter having the following format:dataToSend
parameter (SpanByte)BlockNumber
Data
Transceive
method implementation under the hood calls SendWithCrc method, which by itself works great.The
Transceive
method can behave differently and call different private methods depending on the value of the command byte (byte №0 of thedataToSend
parameter), so a new private method could be introduced to handle the write command, which would call theSendWithCrc
method 2 times.How to reproduce
No response
Expected behaviour
No response
Screenshots
No response
Sample project or code
No response
Aditional information
No response