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"
23 #define ISO15693_SPRINTUID_BUFLEN (3 * 8 + 1)
25 // returns a string representation of the UID
26 // UID is transmitted and stored LSB first, displayed MSB first
27 // dest char* buffer, where to put the UID, if NULL a static buffer is returned
28 // uid[] the UID in transmission order
29 // return: ptr to string
30 char *iso15693_sprintUID(char *dest
, uint8_t *uid
) {
31 static char tempbuf
[ISO15693_SPRINTUID_BUFLEN
] = {0};
37 snprintf(dest
, ISO15693_SPRINTUID_BUFLEN
,
41 "%02X %02X %02X %02X %02X %02X %02X %02X",
42 uid
[7], uid
[6], uid
[5], uid
[4],
43 uid
[3], uid
[2], uid
[1], uid
[0]