registry.h 1.2 KB

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