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.

FreeFareTagInternal.h 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 "libnfc_cpptools/Result.h"
  9. namespace LibNfc
  10. {
  11. namespace FreeFare
  12. {
  13. class FreeFareTagInternal
  14. {
  15. public:
  16. FreeFareTagInternal(FreefareTag tag);
  17. ~FreeFareTagInternal();
  18. LibNfc::Utils::ResultBool authenticate(int sector, std::string key, int keyType);
  19. LibNfc::Utils::ResultString readBlock(int sector, int block, std::string key, int keyType);
  20. LibNfc::Utils::ResultBool writeBlock(int sector, int block, std::string key, int keyType, const std::string& data);
  21. int getFirstBlock(int sector) const;
  22. int getLastBlock(int sector) const;
  23. int getSectorBlockCount(int sector);
  24. const freefare_tag * getTag() const;
  25. freefare_tag_type getType() const;
  26. const std::string & getUid() const;
  27. private:
  28. FreefareTag _tag;
  29. freefare_tag_type _type;
  30. std::string _uid;
  31. };
  32. }; // FreeFare
  33. }; // LibNfc
  34. #endif //MIFARE_TOOLS_FREEFARETAG_H