Skip to content

Format string syntax

Online document

(in Russian)

Строка форматирования

Syntax

  • a - switch to the ASCII mode: outputs data received from the tag as ASCII symbols. Skips data outside the following range: 8(backspace), 9(tab), 10(return), and from 32(space) to 126(~).
  • d - switch to the decimal mode: outputs each byte as a decimal (0-255). No zero padding, no delimiters between bytes.
  • D - (only for the -e/-m devices, firmware 2.9 and later) outputs the UID of an EM-41xx compatible tag in decimal format (the 4 least significant bytes as a 32bit big-endian decimal number padded with zeros if necessary to fill 10 digits). If no EM-41xx tag is currently present, the code is ignored (nothing is printed). All the other device revisions will just output the ASCII letter D.
  • e - (only for the -e/-m devices, firmware 2.0 Jan 30 2020 and later) outputs the UID of an EM-41xx compatible tag in decimal format (the 3 least significant bytes as a 24bit big-endian decimal number padded with zeros if necessary to fill 10 digits). If no EM-41xx tag is currently present, the code is ignored (nothing is printed). All the other device revisions will just output the ASCII letter e.
  • E - (only for the -e/-m devices, firmware 2.0 Jan 30 2020 and later) outputs the UID of an EM-41xx compatible tag in text format ( xxx.yyyyy , i.e. the facility code, the dot, and the 16bit integer padded to fill 10 digits.). If no EM-41xx tag is currently present, the code is ignored. All the other device revisions will just output the ASCII letter E.
  • h - switch to hexadecimal mode (lower-case): outputs each byte as 2 hexadecimal digits, lower case (ex. a, not A).
  • H - switch to hexadecimal mode (upper-case): outputs each byte as 2 hexadecimal digits, upper case (ex. A, not a).
  • U - output the tag’s UID. The U switch must be followed by one of the modifiers:

    • * - output the whole UID.
    • ~ - output the whole UID in reversed order (the last byte first).
    • n:m - output bytes n, n+1, ..., m (inclusive) of the UID. If m < n, output bytes m, m-1, ..., n (inclusive). The indices outside the current data range are silently skipped.
    • n: - output bytes n, n+1, ... of the UID (till the last byte).
    • n - output byte n.

    Attention : the n,m indices above start from zero!. Ex: the first byte is n=0

  • BN - output block N(0-255) from the tag memory. The block numbers range depends on the tag type. If the block does not exist or cannot be read (for example due to an authentication failure), it is silently skipped. The B switch must be followed by the block number N, then the % symbol, and then by one of the following modifiers:

    • * - output the whole block (4 or 16 bytes depending on the tag type).
    • ~ - output the whole block in reversed order.
    • n:m - output the block range (same format as the U code’s postfix).
    • n: - output part of the block (same format as the U code’s postfix).
    • n - output the block byte (same format as the U code’s postfix).
  • S - output the SAK of the tag.
  • \t sequence is converted to TAB, \n to RETURN (if the protocol does not forbid it).
  • any other symbol is printed as is (no check whether it is a printable character or not is performed). In order to print reserved symbol (‘a’, ‘d’, ‘h’, etc) escape it with a backslash (\).