I'm trying to initialize a new Mifare Classic Tag to the DNEF format, readable by the Proximity API.
According to Microsoft, the proximity API is capable to initialize a mifare classic tag to a NDEF format if needed (as described here and here).
But, using this line of code to publish the message:
proximityDevice.PublishBinaryMessage("NDEF:WriteTag", ndef.ToByteArray().AsBuffer(), MessageTransmittedHandler);
don't initialize the TAG and write anything, just works on a pre-formatted NDEF tag (done by an Android Phone, for example).
There are any way to initialize the TAG to a NDEF format on the Desktop familly, being the NFC reader/writer a proximity device? (NXP NearFieldProximity Provider)
UPDATE:
I found a MIRAFE API for .NET from Onovotny with all low level operations to send the APDU data to Mifare Cards, supporting the WinRT SmartCard framework that I'm using.
The problem now consists on any data operations (getData or setData) when tries to login the card, producing this Exception:
"The smart card has been reset, so any shared state information is invalid. (Exception from HRESULT: 0x80100068)"
I can get the card identification and the card is writabble on Android devices. I also tried to change the KeyA to {0x00,0x00,0x00,0x00,0x00,0x00}, { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF} and {0xA0,0xA1,0xA2,0xA3,0xA4,0xA5} but the results are the same.
Just started a Windows Service at services.msc called "Smart Card Device Enumeration Service", and I could be able to write/read data to/from SmartCards.
About the NDEF formatting, I inserted MAD data on sector 0, block 1 and 2. After that, added the NDEF records on sector 1, block 0..2. Then, I updated the Key A and Key B of MAD and NDEF sectors like this:
Filling MAD and 2 NDEF records manually:
Updating keys for NDEF records: