// encode UID to raw hex according to TAG selection BOOL tag_uid_to_hex(BYTE *hex, BYTE *uid, BYTE tagtype) { switch(tagtype) { case TAG_TYPE_ASK_RAW: case TAG_TYPE_EM4X05: case TAG_TYPE_FSK1_RAW: case TAG_TYPE_FSK2_RAW: case TAG_TYPE_PSK1_RAW: case TAG_TYPE_PSK2_RAW: case TAG_TYPE_PSK3_RAW: memcpy(hex, uid, strlen(uid)); return TRUE; case TAG_TYPE_AWID_26: if(!bcd_to_awid26_hex(hex, uid)) return FALSE; return TRUE; case TAG_TYPE_Q5: case TAG_TYPE_EM4X02: if(!hex_to_em4x02_hex(hex, uid)) return FALSE; return TRUE; case TAG_TYPE_FDXB: if(!uid_to_fdxb_hex(hex, uid)) return FALSE; return TRUE; case TAG_TYPE_HID_26: if(!bcd_to_hid26_hex(hex, uid)) return FALSE; return TRUE; case TAG_TYPE_INDALA_64: if(!indala64_hex_to_uid(hex, uid)) return FALSE; return TRUE; case TAG_TYPE_INDALA_224: if(!indala224_hex_to_uid(hex, uid)) return FALSE; return TRUE; case TAG_TYPE_UNIQUE: if(!hex_to_unique_hex(hex, uid)) return FALSE; return TRUE; default: return FALSE; } return TRUE; }
// show interpreted HEX value UID BOOL interpret_uid(BYTE *response, BYTE *hex, BYTE tagtype) { switch(tagtype) { case TAG_TYPE_NONE: strcpy(response, hex); return TRUE; case TAG_TYPE_ASK_RAW: return ask_raw_hex_to_uid(response, hex); case TAG_TYPE_AWID_26: return awid26_hex_to_uid(response, hex); case TAG_TYPE_EM4X02: return em4x02_hex_to_uid(response, hex); case TAG_TYPE_FDXB: return fdxb_hex_to_uid(response, hex); case TAG_TYPE_FSK1_RAW: case TAG_TYPE_FSK2_RAW: return fsk_raw_hex_to_uid(response, hex); case TAG_TYPE_HID_26: return hid26_hex_to_uid(response, hex); case TAG_TYPE_HITAG1: return hitag1_hex_to_uid(response, hex); case TAG_TYPE_HITAG2: return hitag2_hex_to_uid(response, hex); case TAG_TYPE_INDALA_64: return indala64_hex_to_uid(response, hex); case TAG_TYPE_INDALA_224: return indala224_hex_to_uid(response, hex); case TAG_TYPE_PSK1_RAW: return psk1_raw_hex_to_uid(response, hex); case TAG_TYPE_Q5: //case TAG_TYPE_T55X7: return q5_hex_to_uid(response, hex); case TAG_TYPE_UNIQUE: return unique_hex_to_uid(response, hex); default: break; } return FALSE; }