- Development Kit User Guide
- Setup, Samples and Tools
- Running the Samples
- Running the reference_apps Samples
- Transit Sample
- Running the Transit Sample from the Command Line
Running the Transit Sample from the Command Line
The TransitDemo
or TransitDemo.bat
script automatically starts and stops cref
when needed to simulate interaction sessions with the POS terminal and the turnstile transit terminal.
- Open a Command Prompt window and perform the following:
- Navigate to the
JC_HOME_SIMULATOR\bin
directory. - Start the simulator by using the following command at the command prompt:
cref -o transitCard
- Navigate to the
- Open a second Command Prompt window and perform the following:
- Set
ANT_HOME
(path to ant install folder),JC_HOME_TOOLS
andJC_HOME_SIMULATOR
(path to JCDK install folder) as environment variables. - Navigate to the
JC_HOME_SIMULATOR\samples\reference_apps\Transit\Transit\applet
directory. - Enter the following command at the command prompt:
ant all
In this sample's
applet
directory, theant
all
command generates the APDU script and downloads the CAP file.
- Set
- In the
cref
Command Prompt window, restart the simulator by using the following command:cref -i transitCard -o transitCard
Starting the simulator with the
-i
transitCard
-o
transitCard
options and filenames causes the simulator to use the contents of thetransitCard
file to initialize the EEPROM and to save the EEPROM contents to a file namedtransitCard
. - In the applet Command Prompt window, perform the following:
- Navigate to the
JC_HOME_SIMULATOR\samples\reference_apps\Transit\Transit\client
directory. - Enter the following command at the command prompt:
ant run1
In this sample's
client
directory, theant
run1 command compiles and builds theclient.jar
and generates theactual_output1.txt
file.
- Navigate to the
- Verify that the contents of the
actual_output1.txt
file are the same as the contents of theTransitClient_1.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output1.txt
file varies from theTransitClient_1.expected.output
file for the following instructions:-
CLA:80 INS:30
-
CLA:80 INS:40
-
- In the
cref
Command Prompt window, restart the simulator by using the following command:cref -i transitCard -o transitCard
- In the applet Command Prompt window, enter the following command at the command prompt:
ant run2
In this sample's
client
directory, theant
run2 command compiles and builds theclient.jar
and generates theactual_output2.txt
file. - Verify that the contents of the
actual_output2.txt
file are the same as the contents of theTransitClient_2.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output2.txt
file varies from theTransitClient_2.expected.output
file for the following instructions:-
CLA:80 INS:30
-
CLA:80 INS:40
-
- In the
cref
Command Prompt window, restart the simulator by using the following command:cref -i transitCard -o transitCard
- In the applet Command Prompt window, enter the following command at the command prompt:
ant run3
In this sample's
client
directory, theant
run3 command compiles and builds theclient.jar
and generates theactual_output3.txt
file. - Verify that the contents of the
actual_output3.txt
file are the same as the contents of theTransitClient_3.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output3.txt
file varies from theTransitClient_3.expected.output
file for the following instructions:-
CLA:80 INS:30
-
CLA:80 INS:40
-
- In the
cref
Command Prompt window, restart the simulator by using the following command:cref -i transitCard -o transitCard
- In the applet Command Prompt window, enter the following command at the command prompt:
ant run4
In this sample's
client
directory, theant
run4 command compiles and builds theclient.jar
and generates theactual_output4.txt
file - Verify that the contents of the
actual_output4.txt
file are the same as the contents of theTransitClient_4.expected.output
file.Because the terminal uses random number generation for challenge/response and for generating session key, the contents of theactual_output4.txt
file varies from theTransitClient_4.expected.output
file for the following instructions:-
CLA:80 INS:30
-
CLA:80 INS:40
-