Datasheet

C1, C2, C3 BCD-Coded Mode, 0 or 1
KeyA MiFare authentication key A; 6 Bytes hexadecimal coded ASCII-string (16
chars)
KeyB MiFare authentication key B; 6 Bytes hexadecimal coded ASCII-string (16
chars)
Table 10: SKO mode parameter description
Response, if successful:
OK!<CR>
Examples:
Sector 5 which contains block 20 get the keys 112233445566 (key A) and 665544332211
(key B)
STM<SPACE>SKO<SPACE>20<SPACE>112233445566<SPACE>665544332211<C
R>
Possible error codes:
UPA<CR> Unknown parameter
BAE<CR> An unauthenticated block is chosen
KNC<CR> Keys not changeable
UKA<CR> Use Key A for authentication
UKB<CR> Use Key B for authentication
BNR<CR> Block not readable, i.e. wrong key, see Block –and Access Mode
BNA<CR> Block not authenticated, Block No. is not in authenticated sector
NMA<CR> No MiFare 1k or 4k chip authenticated
5.4. Value block Operation (VAL)
This command is used to use the integrated MiFare valueblock operations. A value block is
able to save a signed 4 byte value and one address byte (i.e. own block address). The value
is saved LSB first, i.e. 00000035h written as parameter looks like 35000000h. The value can
be manipulated by four different ways (always depending on access bits). It is usually used
to store information on credit values for e-payment or e-ticketing situations.
There are five different modes for this command:
Initialization – the first step to use the next operations (sets a initial value/address)
metraTec MiFare Protocol Guide Page 27 of 38