subghz_keystore.h 971 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <m-string.h>
  3. #include <m-array.h>
  4. #include <stdint.h>
  5. typedef struct {
  6. string_t name;
  7. uint64_t key;
  8. uint16_t type;
  9. } SubGhzKey;
  10. ARRAY_DEF(SubGhzKeyArray, SubGhzKey, M_POD_OPLIST)
  11. #define M_OPL_SubGhzKeyArray_t() ARRAY_OPLIST(SubGhzKeyArray, M_POD_OPLIST)
  12. typedef struct SubGhzKeystore SubGhzKeystore;
  13. /** Allocate SubGhzKeystore
  14. *
  15. * @return SubGhzKeystore*
  16. */
  17. SubGhzKeystore* subghz_keystore_alloc();
  18. /** Free SubGhzKeystore
  19. *
  20. * @param instance
  21. */
  22. void subghz_keystore_free(SubGhzKeystore* instance);
  23. /** Loading manufacture key from file
  24. *
  25. * @param instance - SubGhzKeystore instance
  26. * @param filename - const char* full path to the file
  27. */
  28. void subghz_keystore_load(SubGhzKeystore* instance, const char* filename);
  29. /** Get array of keys and names manufacture
  30. *
  31. * @param instance - SubGhzKeystore instance
  32. * @return SubGhzKeyArray_t*
  33. */
  34. SubGhzKeyArray_t* subghz_keystore_get_data(SubGhzKeystore* instance);