NEO 2 Interface Developer’s Guide
Copyright © 2019, International Technologies & Systems Corporation. All rights reserved.
309
ePurse Value Block Format
A Debit function subtracts a given amount from a Mifare value block and stores the result in
the same block. A Credit function adds a given amount to a Mifare value block and stores the
result in the same block. A Backup function reads a value block and stores a copy of it in
another value block in the same authenticated sector.
This command is flexible in that it allows any number of Debit, Credit or Backup function blocks
to be embedded within one
Command Frame
in any order, with or without keys specified, as
long as the total number of bytes is within the size capability of one Pass-Through command.
Operations are performed in the order they are specified.
For instance, a Purse Command could simply contain one Debit function to debit a value block
by a specified amount. If a key and key type is included they are used to authenticate the block
and the debit function is performed. If no key information is included the key and key type
used in the previous Mifare Authentication command is used.
In another case, the Purse Command could contain a Credit function to credit a value block by a
specific amount and a Backup function to backup the resulting balance to another value block
somewhere on the card. Each command could include a specific key for the block being
addressed, or omit the key information and let the reader use the last known key.
Note:
The default key and key type are overwritten each time a key is encountered while
processing a Purse Command. The initial default values are those set when the
command is received. That key type and key are used until another key
is encountered, at which point the new key becomes the default key for subsequent
transactions. If purse commands are used without key information then the terminal must
have successfully sent at least one
command to the reader for
the first block.
Warning
:
Multiple ePurse command blocks can be included in one command; each
command contains a count of the number of command blocks included in the command.
If the count of command blocks specified is not equal to the actual number of command
blocks included in the command, an error may or may not be returned to the user.
If the count of command blocks is greater than the actual number of command blocks
specified, all command blocks available are acted upon and an error is returned.
If the count of command blocks is less than the actual number of command blocks in the
command, only the number of commands specified in the count is acted upon but no error
is returned.