Appendix a. example host application – MagTek IntelliStripe 310™ User Manual

Page 41

Advertising
background image

35

APPENDIX A. EXAMPLE HOST APPLICATION


The following is an example of a very simple host application that uses the IntelliStripe 310
command set to read a magnetic stripe and communicate to a smart card. This example would
not be used as a real application because it has no error handling. It is intended only to be used
as a demonstration of how the command set can be used to build an application.

The steps are as follows:

1. Initialize device by setting MSR Direction transport property to Consume and setting Auto

Consume transport property to Enabled.


2. Wait for a card to be consumed completely into the reader. Check Rear Card Present

indicator inside a loop until it is set. The Rear Card Present indicator is obtained by issuing
the Get Indicators transport property. For error handling, also check for the following case
inside the loop. If the Auto Transporting indicator is clear and the Middle Card Present
Indicator is set but the Rear Card Present indicator is not set then a card is stuck in the
transport so go to step 5.


3. Issue the Get Track 123 Decode Data magnetic stripe command to get the magnetic stripe

data.


4. Issue the Card Eject transport command to eject the card.

5. Go to step 2 to read another card.

Advertising