registry.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "types.h"
  3. typedef struct SubGhzEnvironment SubGhzEnvironment;
  4. typedef struct SubGhzProtocolRegistry SubGhzProtocolRegistry;
  5. struct SubGhzProtocolRegistry {
  6. const SubGhzProtocol** items;
  7. const size_t size;
  8. };
  9. /**
  10. * Registration by name SubGhzProtocol.
  11. * @param protocol_registry SubGhzProtocolRegistry
  12. * @param name Protocol name
  13. * @return SubGhzProtocol* pointer to a SubGhzProtocol instance
  14. */
  15. const SubGhzProtocol* subghz_protocol_registry_get_by_name(
  16. const SubGhzProtocolRegistry* protocol_registry,
  17. const char* name);
  18. /**
  19. * Registration protocol by index in array SubGhzProtocol.
  20. * @param protocol_registry SubGhzProtocolRegistry
  21. * @param index Protocol by index in array
  22. * @return SubGhzProtocol* pointer to a SubGhzProtocol instance
  23. */
  24. const SubGhzProtocol* subghz_protocol_registry_get_by_index(
  25. const SubGhzProtocolRegistry* protocol_registry,
  26. size_t index);
  27. /**
  28. * Getting the number of registered protocols.
  29. * @param protocol_registry SubGhzProtocolRegistry
  30. * @return Number of protocols
  31. */
  32. size_t subghz_protocol_registry_count(const SubGhzProtocolRegistry* protocol_registry);