1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // ISO15693 other commons
17 //-----------------------------------------------------------------------------
18 #include "iso15693tools.h"
21 #define ISO15693_SPRINTUID_BUFLEN (3 * 8 + 1)
23 // returns a string representation of the UID
24 // UID is transmitted and stored LSB first, displayed MSB first
25 // dest char* buffer, where to put the UID, if NULL a static buffer is returned
26 // uid[] the UID in transmission order
27 // return: ptr to string
28 char *iso15693_sprintUID(char *dest
, uint8_t *uid
) {
29 static char tmp
[ISO15693_SPRINTUID_BUFLEN
] = {0};
36 snprintf(dest
, ISO15693_SPRINTUID_BUFLEN
,
40 "%02X %02X %02X %02X %02X %02X %02X %02X",
41 uid
[7], uid
[6], uid
[5], uid
[4],
42 uid
[3], uid
[2], uid
[1], uid
[0]