ibutton_key.h 814 B

12345678910111213141516171819202122232425262728293031
  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. void clear_data();
  9. uint8_t* get_data();
  10. uint8_t get_type_data_size();
  11. void set_name(const char* name);
  12. char* get_name();
  13. void set_type(iButtonKeyType key_type);
  14. iButtonKeyType get_key_type();
  15. const char* get_key_type_string_by_type(iButtonKeyType key_type);
  16. bool get_key_type_by_type_string(const char* type_string, iButtonKeyType* key_type);
  17. uint8_t get_type_data_size_by_type(iButtonKeyType key_type);
  18. iButtonKey();
  19. private:
  20. uint8_t data[IBUTTON_KEY_DATA_SIZE] = {0, 0, 0, 0, 0, 0, 0, 0};
  21. char name[IBUTTON_KEY_NAME_SIZE] = {0};
  22. iButtonKeyType type = iButtonKeyType::KeyDallas;
  23. };