// // Created by robin on 7/22/16. // #ifndef MIFARE_TOOLS_FREEFARETAGBUSINESS_H #define MIFARE_TOOLS_FREEFARETAGBUSINESS_H #include #include #include typedef std::vector> MappedKeys; class FreeFareTagBusiness { public: FreeFareTagBusiness(std::shared_ptr tag); ResultBool authenticate(int sector, std::string key, int keyType); Result mapKeys(std::vector keys, std::function cb = 0); ResultString readBlock(int sector, int block, std::string key, int keyType); Result readSector(int sector, std::string key, int keyType); Result> read(MappedKeys keys, std::function cb = 0); Result> read(std::vector keys, std::function mapCb = 0, std::function readCb = 0); ResultBool writeBlock(int sector, int block, std::string key, int keyType, const std::string& data); ResultBool writeSector(int sector, std::string key, int keyType, const std::string& data); ResultBool write(MappedKeys keys, const std::string& data, bool writeSector0, std::function cb = 0); ResultBool write(std::vector keys, const std::string& data, bool writeSector0, std::function mapCb = 0, std::function writeCb = 0); const std::string& getUid() const; freefare_tag_type getType() const; std::shared_ptr getTag() const; protected: std::shared_ptr _tag; }; #endif //MIFARE_TOOLS_FREEFARETAGBUSINESS_H