+static const struct emv_tag_bit EMV_CTQ[] = {
+ { EMV_BIT(1, 8), "Online PIN Required" },
+ { EMV_BIT(1, 7), "Signature Required" },
+ { EMV_BIT(1, 6), "Go Online if Offline Data Authentication Fails and Reader is online capable" },
+ { EMV_BIT(1, 5), "Switch Interface if Offline Data Authentication fails and Reader supports VIS" },
+ { EMV_BIT(1, 4), "Go Online if Application Expired" },
+ { EMV_BIT(1, 3), "Switch Interface for Cash Transactions" },
+ { EMV_BIT(1, 2), "Switch Interface for Cashback Transactions" },
+ { EMV_BIT(2, 8), "Consumer Device CVM Performed" },
+ { EMV_BIT(2, 7), "Card supports Issuer Update Processing at the POS" },
+ EMV_BIT_FINISH,
+};
+
+static const struct emv_tag_bit EMV_TTQ[] = {
+ { EMV_BIT(1, 8), "MSD supported" },
+ { EMV_BIT(1, 7), "VSDC supported" },
+ { EMV_BIT(1, 6), "qVSDC supported" },
+ { EMV_BIT(1, 5), "EMV contact chip supported" },
+ { EMV_BIT(1, 4), "Offline-only reader" },
+ { EMV_BIT(1, 3), "Online PIN supported" },
+ { EMV_BIT(1, 2), "Signature supported" },
+ { EMV_BIT(1, 1), "Offline Data Authentication (ODA) for Online Authorizations supported\nWarning!!!! Readers compliant to this specification set TTQ byte 1 bit 1 (this field) to 0b" },
+ { EMV_BIT(2, 8), "Online cryptogram required" },
+ { EMV_BIT(2, 7), "CVM required" },
+ { EMV_BIT(2, 6), "(Contact Chip) Offline PIN supported" },
+ { EMV_BIT(3, 8), "Issuer Update Processing supported" },
+ { EMV_BIT(3, 7), "Mobile functionality supported (Consumer Device CVM)" },
+ EMV_BIT_FINISH,
+};
+
+static const struct emv_tag_bit EMV_CVR[] = {
+ // mask 0F 0F F0 0F
+ { EMV_BIT(1, 4), "CDA Performed" },
+ { EMV_BIT(1, 3), "Offline DDA Performed" },
+ { EMV_BIT(1, 2), "Issuer Authentication Not Performed" },
+ { EMV_BIT(1, 1), "Issuer Authentication performed and Failed" },
+ { EMV_BIT(2, 4), "Offline PIN Verification Performed" },
+ { EMV_BIT(2, 3), "Offline PIN Verification Performed and PIN Not Successfully Verified" },
+ { EMV_BIT(2, 2), "PIN Try Limit Exceeded" },
+ { EMV_BIT(2, 1), "Last Online Transaction Not Completed" },
+ { EMV_BIT(3, 8), "Lower Offline Transaction Count Limit Exceeded" },
+ { EMV_BIT(3, 7), "Upper Offline Transaction Count Limit Exceeded" },
+ { EMV_BIT(3, 6), "Lower Cumulative Offline Amount Limit Exceeded" },
+ { EMV_BIT(3, 5), "Upper Cumulative Offline Amount Limit Exceeded" },
+ { EMV_BIT(4, 4), "Issuer script processing failed on last transaction" },
+ { EMV_BIT(4, 3), "Offline data authentication failed on previous transaction and transaction declined offline" },
+ { EMV_BIT(4, 2), "Go Online on Next Transaction Was Set" },
+ { EMV_BIT(4, 1), "Unable to go Online" },
+ EMV_BIT_FINISH,
+};
+
+// All Data Elements by Tags used in TLV structure (according to the EMV 4.2 Standard )
+// https://www.eftlab.co.uk/index.php/site-map/knowledge-base/145-emv-nfc-tags
+// http://dexterous-programmer.blogspot.in/2012/05/emv-tags.html