Exemplo n.º 1
0
        snprint_nfc_target(out string strdst, NFC.nfc_target pnt, bool verbose)
        {
            strdst = "";
            if (null != pnt)
            {
                strdst  = "";
                strdst += NFC.str_nfc_modulation_type(pnt.nm.nmt) + " ";
                strdst += "(" + NFC.str_nfc_baud_rate(pnt.nm.nbr);
                strdst += (pnt.nm.nmt != NFC.nfc_modulation_type.NMT_DEP) ? "" : (pnt.nti.ndi.ndm == NFC.nfc_dep_mode.NDM_ACTIVE) ? "active mode" : "passive mode" + ")";
                strdst += " target:\r\n";
                string dst = "";
                switch (pnt.nm.nmt)
                {
                case NFC.nfc_modulation_type.NMT_ISO14443A:
                    snprint_nfc_iso14443a_info(out dst, pnt.nti.nai, verbose);
                    break;

                case NFC.nfc_modulation_type.NMT_JEWEL:
                    snprint_nfc_jewel_info(out dst, pnt.nti.nji, verbose);
                    break;

                case NFC.nfc_modulation_type.NMT_FELICA:
                    snprint_nfc_felica_info(out dst, pnt.nti.nfi, verbose);
                    break;

                case NFC.nfc_modulation_type.NMT_ISO14443B:
                    snprint_nfc_iso14443b_info(out dst, pnt.nti.nbi, verbose);
                    break;

                case NFC.nfc_modulation_type.NMT_ISO14443BI:
                    snprint_nfc_iso14443bi_info(out dst, pnt.nti.nii, verbose);
                    break;

                case NFC.nfc_modulation_type.NMT_ISO14443B2SR:
                    snprint_nfc_iso14443b2sr_info(out dst, pnt.nti.nsi, verbose);
                    break;

                case NFC.nfc_modulation_type.NMT_ISO14443B2CT:
                    snprint_nfc_iso14443b2ct_info(out dst, pnt.nti.nci, verbose);
                    break;

                case NFC.nfc_modulation_type.NMT_DEP:
                    snprint_nfc_dep_info(out dst, pnt.nti.ndi, verbose);
                    break;
                }
                strdst += dst;
            }
        }
Exemplo n.º 2
0
        /* Error reporting */

        /** @ingroup error
         * @brief Return the last error string
         * @return Returns a string
         *
         * @param pnd \a nfc_device struct pointer that represent currently used device
         */
        public static string nfc_strerror(nfc_device pnd)
        {
            return(NFC.ErrorMessage(pnd.last_error));
        }