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.

FreeFareSector.h 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // Created by robin on 7/22/16.
  3. //
  4. #ifndef MIFARE_TOOLS_SECTORDBO_H
  5. #define MIFARE_TOOLS_SECTORDBO_H
  6. #include <string>
  7. #include <libnfc_cpptools/Result.h>
  8. #include <libnfc_cpptools/FreeFareAccessBits.h>
  9. namespace LibNfc
  10. {
  11. namespace FreeFare
  12. {
  13. class FreeFareSector
  14. {
  15. public:
  16. FreeFareSector(const std::string& data = "");
  17. const std::string& getBlock(int block) const;
  18. std::string getKeyA() const;
  19. std::string getKeyB() const;
  20. std::string getAccessBits() const;
  21. FreeFareAccessBits getAccessBitsDbo() const;
  22. void setBlock(int block, const std::string& data);
  23. void setKeyA(const std::string& key);
  24. void setKeyB(const std::string& key);
  25. void setAccessBits(const std::string& accessBits);
  26. void setAccessBits(const FreeFareAccessBits& accessBits);
  27. bool hasBlock(int block) const;
  28. bool hasKeyA() const;
  29. bool hasKeyB() const;
  30. bool hasAccessBits() const;
  31. protected:
  32. std::string _blocks[4];
  33. bool _haveBlocks[4];
  34. bool _hasKeyA;
  35. bool _hasKeyB;
  36. bool _hasAccessBits;
  37. };
  38. }; // FreeFare
  39. }; // LibNfc
  40. #endif //MIFARE_TOOLS_SECTORDBO_H