Smart Reader Operation Template engine Output Format register
April 13, 2023 at 2:39 AMOutput Format
The Output Format register shares the same specification among most templates; this paragraph details this common implementation.
For templates that have their own specification for Output Format, it is detailed directly in the template’s chapter.
Register t1: output format
Register 03t1
defines the output format.
This register has 2 different specifications:
- Numeric output (raw/hexadecimal or decimal) is selected if bit 6 in byte 0 is
0
- String output (ASCII or UTF8) is selected if bit 6 in byte 0 is
1
Numeric output (raw/hexadecimal or decimal)
For a numeric output, the register has 1 or 2 bytes. If only byte 0 is defined, byte 1 defaults to 00
.
Byte | Bits | Content |
---|---|---|
0 | 7 | Direction0 : direct direction (send the data bytes as they are retrieved from the RF card)1 : reverse direction (swap bytes) |
6 | Numeric output, must be 0 |
|
5 | RFU, must be 0 |
|
4 | Suppress leading zeros0 : keep all digits1 : suppress digit 0 on the left |
|
3-0 | Format and length0000 : Decimal, 4 bytes as 10 digits0001 : Raw/Hexadecimal, 4 bytes0010 : Raw/Hexadecimal, 8 bytes0011 : Raw/Hexadecimal, 5 bytes0100 : Raw/Hexadecimal, 10 bytes0101 : Raw/Hexadecimal, 7 bytes0110 : Raw/Hexadecimal, 11 bytes0111 : RFU1000 : Raw/Hexadecimal, 16 bytes1001 : Raw/Hexadecimal, 20 bytes1010 : Raw/Hexadecimal, 24 bytes1011 : Raw/Hexadecimal, 32 bytes1100 : Decimal, 5 bytes as 12 digits1101 : Decimal, 5 bytes as 13 digits1110 : Decimal, variable length1111 : Raw/Hexadecimal, variable length |
|
1 | 7 | RFU, must be 0 |
6-4 | Drop first bits (000 i.e. 0 to 111 i.e. 7) |
|
3-0 | Drop first bytes (0000 i.e. 0 to 1111 i.e. 15) |
String output (ASCII or UTF8), variable length
For a variable-length string output, the register has 1 or 2 bytes. If only byte 0 is defined, byte 1 defaults to 00
.
Byte | Bits | Content |
---|---|---|
0 | 7 | Direction0 : direct direction (send the data bytes as they are retrieved from the RF card)1 : reverse direction (swap bytes) |
6 | String output, must be 1 |
|
5 | RFU, must be 0 |
|
4 | Variable length string, must be 1 |
|
3-0 | RFU, must be 0000 |
|
1 | 7-0 | Max output length from 01 to FF . Use 00 for ‘no limit’. |
String output (ASCII or UTF8), fixed length
For a fixed-length string output, the register has 1 byte only.
Byte | Bits | Content |
---|---|---|
0 | 7 | Direction0 : direct direction (send the data bytes as they are retrieved from the RF card)1 : reverse direction (swap bytes) |
6 | String output, must be 1 |
|
5 | Padding with SPACE char, if too short0 : padd on the left (before the string)1 : padd on the right (after the string) |
|
4 | Fixed length string, must be 1 |
|
3-0 | Length0000 : 16 characters0001 : 1 character0010 : 2 characters0011 : 3 characters0100 : 4 characters0101 : 5 characters0110 : 6 characters0111 : 7 characters1000 : 8 characters1001 : 9 characters1010 : 10 characters1011 : 11 characters1100 : 12 characters1101 : 13 characters1110 : 14 characters1111 : 15 characters |