You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // Created by robin on 6/19/16.
  3. //
  4. #ifndef MIFARE_TOOLS_FREEFARETAG_H
  5. #define MIFARE_TOOLS_FREEFARETAG_H
  6. #include <freefare.h>
  7. #include <string>
  8. #include <DBO/Result.h>
  9. class FreeFareTag
  10. {
  11. public:
  12. FreeFareTag(FreefareTag tag);
  13. ~FreeFareTag();
  14. ResultBool authenticate(int sector, std::string key, int keyType);
  15. ResultString readBlock(int sector, int block, std::string key, int keyType);
  16. ResultBool writeBlock(int sector, int block, std::string key, int keyType, const std::string& data);
  17. int getFirstBlock(int sector) const;
  18. int getLastBlock(int sector) const;
  19. int getSectorBlockCount(int sector);
  20. const freefare_tag * getTag() const;
  21. freefare_tag_type getType() const;
  22. const std::string & getUid() const;
  23. private:
  24. FreefareTag _tag;
  25. freefare_tag_type _type;
  26. std::string _uid;
  27. };
  28. #endif //MIFARE_TOOLS_FREEFARETAG_H