+ SendCommand(&c);
+ return 0;
+}
+
+
+static bool getHitagUid(uint32_t *uid) {
+ // ToDo: this is for Hitag2 only (??)
+
+ UsbCommand c = {CMD_READER_HITAG, {RHT2F_UID_ONLY}};
+
+ SendCommand(&c);
+
+ UsbCommand resp;
+ if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
+ PrintAndLogEx(WARNING, "timeout while waiting for reply.");
+ return false;
+ }
+
+ if (resp.arg[0] == false) {
+ PrintAndLogEx(DEBUG, "DEBUG: Error - failed getting UID");
+ return false;
+ }
+
+ if (uid)
+ *uid = bytes_to_num(resp.d.asBytes, 4);
+
+ return true;
+}
+
+
+static int CmdLFHitagInfo(const char *Cmd) {
+ char ctmp = param_getchar(Cmd, 0);
+ if (ctmp != '\0') {
+ PrintAndLog("Usage: lf hitag info [h]");
+ PrintAndLog("Options:");
+ PrintAndLog(" h This help");
+ PrintAndLog("Examples:");
+ PrintAndLog(" lf hitag info");
+ return 0;
+ }
+
+ // read UID
+ uint32_t uid = 0;
+ if (getHitagUid(&uid) == false)
+ return 1;
+
+ PrintAndLogEx(SUCCESS, "UID: %08X", uid);
+
+ // how to detemine Hitag types?
+ // read block3, get configuration byte.
+ // PrintAndLogEx(FAILED, _RED_("TODO: This is a hardcoded example!"));
+
+ // common configurations.
+ // printHitagConfiguration(0x06);
+ //printHitagConfiguration( 0x0E );
+ //printHitagConfiguration( 0x02 );
+ //printHitagConfiguration( 0x00 );
+ //printHitagConfiguration( 0x04 );
+ return 0;