Github Address: Github.com/zifeiniu/cpucardlib
Project Requirements and Introduction:
The company requires that user-related information be stored in an RF card, and the Mifare type card used in the previous project only stores the user's card ID. Mifare S70 capacity is not enough, thus using the CPU card, FM1280, up to 80KB eerom storage.
Spend points on the csdn download a C # Read CPU card demo, disgusting is not only no source code, and interop calls encapsulated DLLs, also specify the use of their card reader, advertising and earn my points.
Then I wrote a, open source, for everyone to change.
Time is tight, never understand, to write this also two weeks, and so on to continue to write a read bus card and bank card ...
Introduced
Interfaces for two devices have been implemented
PCSC, using the car122u Reader (Pcsccardreader) (GITHUB.COM/DANM-DE/PCSC-SHARP), can be used as long as the PCSC driver reader is implemented.
Decca D3d8 Reader Decardreader.
To add a new card reader, simply implement the interface Icpucardreader. Interface is simple, just implement send byte[], return byte[] can.
Cpucard class Seals common operation commands.
Currently only external authentication is implemented and no secret key operation is involved.
Create binary files, write files, read files, log logs, etc.
The largest binary files encountered by the pit:
The document does not describe how large the binary file is available. There is no error when creating a large binary file, but it is wrong to write the times.
Check document: When the highest bit of the P1 parameter is not 1 o'clock, P1 P2 is the file offset to write, which means that the maximum offset is 7fff,32767 bytes, Unicode encoding, up to 16,383 Kanji
Hardware Resource Release issues:
Like this hardware reads the completion of the time do not know when to release resources appropriate, each time the command is sent to open, send the completion of the shutdown, so do not know that slow is certain, and may reduce the hardware life.
So after the device layer sends the command not to shut down, the business layer on the card operation is closed. The device is turned on when the next command is sent, and the device is not turned on automatically.
Read binary file issues:
Because the write can specify the length of the binary file, but when the binary file is read, it does not find how to get the length of the binary file.
Discovery reads will be prompted as follows
6Cxx error le length wrong, actual length is XX.
After the read hit 6C, fixed the length of the read data, continue to read.
Reference files:
Fmcos Special Technical Manual (using Fudan Microelectronics card)
Test equipment Model
acr122u Decca D8 (soon to be implemented)
Test the CPU Card model:
fm1216-137 FM1280
Features not implemented
Time is tight, currently useless use encryption, line protection function.