// // Created by robin on 7/22/16. // #ifndef MIFARE_TOOLS_FREEFARETAGBUSINESS_H #define MIFARE_TOOLS_FREEFARETAGBUSINESS_H #include #include namespace LibNfc { namespace FreeFare { class FreeFareTagInternal; typedef std::vector> MappedKeys; class FreeFareTag { public: enum FreeFareTagType { UNKNOWN, FELICA, MIFARE_MINI, MIFARE_CLASSIC_1K, MIFARE_CLASSIC_4K, MIFARE_DESFIRE, MIFARE_ULTRALIGHT, MIFARE_ULTRALIGHT_C }; static std::string getTagTypeString(FreeFareTagType type); FreeFareTag(std::shared_ptr tag); LibNfc::Utils::ResultBool authenticate(int sector, std::string key, int keyType); LibNfc::Utils::Result mapKeys(std::vector keys, std::function cb = 0); LibNfc::Utils::ResultString readBlock(int sector, int block, std::string key, int keyType); LibNfc::Utils::Result readSector(int sector, std::string key, int keyType); LibNfc::Utils::Result> read(MappedKeys keys, std::function cb = 0); LibNfc::Utils::Result> read(std::vector keys, std::function mapCb = 0, std::function readCb = 0); LibNfc::Utils::ResultBool writeBlock(int sector, int block, std::string key, int keyType, const std::string& data); LibNfc::Utils::ResultBool writeSector(int sector, std::string key, int keyType, const std::string& data); LibNfc::Utils::ResultBool write(MappedKeys keys, const std::string& data, bool writeSector0, std::function cb = 0); LibNfc::Utils::ResultBool write(std::vector keys, const std::string& data, bool writeSector0, std::function mapCb = 0, std::function writeCb = 0); const std::string& getUid() const; FreeFareTagType getType() const; std::shared_ptr getTag() const; protected: std::shared_ptr _tag; }; }; // FreeFare }; // LibNfc #endif //MIFARE_TOOLS_FREEFARETAGBUSINESS_H