I just buy a P310C Model. This model has encoder inside. I have been
order to build a encoder application to encode 500 units smart card. I
need help on build the application because I am beginner in C++/MFC. I have been supply with cst25110.h and cst25110.dll
The application story:
The Application will read a text file to encode all cards. The txt file
name CADID_listing.txt contains:
CAD_PIN=22222
CARD_TYPE=01000000
CAD_ID
1234567800
4587452600
5412288400
...
Explaination: CARD_ID will be write to the card, and each card has
CAD_PIN and CARD TYPE written inside. Let say the first card is encode,
so the card will be CARD_PIN=22222, CARD_TYPE=01000000 and
CARD_ID=1234567800 and the second card will be CARD_PIN=22222,
CARD_TYPE=01000000 and CARD_ID=4587452600....and so on until the card is
finished encode.
I have do some research and i only can completed until here,
// P310C Encoder
#include "cst25110.h"
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
SCR_SCR_PARAMS myParams; // each instance represents one encoder
void main(void)
{
.
.
myParams.scrAttr.Port = 1; // e.g., target encoder attached to com 1
ctOpen(&myParams.scrAttr);
.
subfunction();
.
.
ctClose(&myParams.scrAttr);
}
void subfunction()
{
.
iccApduExchange(&myParams); // note we did not declare in this function
}
// P310C Smart Card Encoder
ctOpen();
ctEngageCard(); // engage contact station
ctColdReset(); // for SLE 4428 cards.
int main () {
char buffer[256];
ifstream examplefile ("CADID_listing.txt"); // The CAD_PIN, CARD_TYPE, CAD_ID will not be encoded to the card
if (! examplefile.is_open()) // For example each card will be encoded by 55555 00000001 0410000001 ( CAD_PIN, CARD TYPE and CAD_ID )
{ cout << "Error opening file"; exit (1); }
while (! examplefile.eof() )
{
examplefile.getline (buffer,100);
cout << buffer << endl;
}
return 0;
}
ctDeactivate(); // power down smartcard
ctDisengageCard(); // disengage contact station
ctClose();
I need urgent help