ibutton-key.h 833 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <stdint.h>
  3. #include "helpers/key-info.h"
  4. class iButtonKey {
  5. public:
  6. uint8_t get_size();
  7. void set_data(uint8_t* data, uint8_t data_count);
  8. uint8_t* get_data();
  9. uint8_t get_type_data_size();
  10. void set_name(const char* name);
  11. const char* get_name();
  12. void set_type(iButtonKeyType key_type);
  13. iButtonKeyType get_key_type();
  14. // temporary constructor for KeyStore mockup
  15. iButtonKey(
  16. iButtonKeyType type,
  17. const char* name,
  18. uint8_t d0,
  19. uint8_t d1,
  20. uint8_t d2,
  21. uint8_t d3,
  22. uint8_t d4,
  23. uint8_t d5,
  24. uint8_t d6,
  25. uint8_t d7);
  26. iButtonKey();
  27. private:
  28. uint8_t data[IBUTTON_KEY_SIZE] = {0, 0, 0, 0, 0, 0, 0, 0};
  29. const char* name = {0};
  30. iButtonKeyType type = iButtonKeyType::KeyDallas;
  31. };