Elatec GmbH
Page 31 of 50
7.1.8 Storage Classes
There are following storage classes available: Standard, const and secret. Without using any modifier,
the standard storage is used. A variable, which is declared in the standard storage class, is allocated in
the normal data segment.
Examples:
byte i; // A single integer
byte a[15]; // An array of 15 bytes
7.1.8.1 const
An identifier, which is declared as const can be used for calculations at compile time. There is no
physical memory occupied during runtime. Typically, you would use a const for defining constants,
which are used throughout a script for easier understanding and adaptation for different purposes.
Example:
const byte c = 15;
7.1.8.2 secret
The secret data space is a read-only segment. The content of this segment is written once during
programming the script into the TWN3 transponder reader. Furthermore, this segment can not be read
directly by the script itself. Therefore, there is no way to simply read the content of this memory and
send it to the host. There are only a few system functions, which take the content of this segment as
input. Typically, the secret data space is used for keys, which are necessary for authentication to a
transponder. Examples:
// Some well known factory default keys for transponders
secret byte MifareKeyFF[6] = { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF };
secret byte MifareKeyAA[6] = { 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5 };
secret byte MifareKeyBB[6] = { 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5 };
secret byte Hitag2Key[4] = { 'M','I','K','R' };
secret byte EM4050Key[4] = { 0x00,0x00,0x00,0x00 };