Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

FreeFareTagBusiness.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // Created by robin on 7/22/16.
  3. //
  4. #ifndef MIFARE_TOOLS_FREEFARETAGBUSINESS_H
  5. #define MIFARE_TOOLS_FREEFARETAGBUSINESS_H
  6. #include <boost/shared_ptr.hpp>
  7. #include <DataAccess/FreeFareTag.h>
  8. #include <DataAccess/SectorDbo.h>
  9. typedef std::vector<std::pair<std::string, std::string>> MappedKeys;
  10. class FreeFareTagBusiness
  11. {
  12. public:
  13. FreeFareTagBusiness(std::shared_ptr<FreeFareTag> tag);
  14. ResultBool authenticate(int sector, std::string key, int keyType);
  15. ResultString readBlock(int sector, int block, std::string key, int keyType);
  16. Result<SectorDbo> readSector(int sector, std::string key, int keyType);
  17. Result<MappedKeys> mapKeys(std::vector<std::string> keys, std::function<void(int, int)> cb = 0);
  18. Result<std::vector<SectorDbo>> dump(MappedKeys keys, std::function<void(int, int)> cb = 0);
  19. Result<std::vector<SectorDbo>> dump(std::vector<std::string> keys, std::function<void(int, int)> mapCb = 0, std::function<void(int, int)> dumpCb = 0);
  20. const std::string& getUid() const;
  21. freefare_tag_type getType() const;
  22. std::shared_ptr<FreeFareTag> getTag() const;
  23. protected:
  24. std::shared_ptr<FreeFareTag> _tag;
  25. };
  26. #endif //MIFARE_TOOLS_FREEFARETAGBUSINESS_H