registry.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #include "registry.h"
  2. const SubGhzProtocol* subghz_protocol_registry[] = {
  3. &subghz_protocol_princeton, &subghz_protocol_keeloq, &subghz_protocol_star_line,
  4. &subghz_protocol_nice_flo, &subghz_protocol_came, &subghz_protocol_faac_slh,
  5. &subghz_protocol_nice_flor_s, &subghz_protocol_came_twee, &subghz_protocol_came_atomo,
  6. &subghz_protocol_nero_sketch, &subghz_protocol_ido, &subghz_protocol_kia,
  7. &subghz_protocol_hormann, &subghz_protocol_nero_radio, &subghz_protocol_somfy_telis,
  8. &subghz_protocol_somfy_keytis, &subghz_protocol_scher_khan, &subghz_protocol_gate_tx,
  9. &subghz_protocol_raw, &subghz_protocol_firefly, &subghz_protocol_secplus_v2,
  10. &subghz_protocol_secplus_v1,
  11. };
  12. const SubGhzProtocol* subghz_protocol_registry_get_by_name(const char* name) {
  13. for(size_t i = 0; i < subghz_protocol_registry_count(); i++) {
  14. if(strcmp(name, subghz_protocol_registry[i]->name) == 0) {
  15. return subghz_protocol_registry[i];
  16. }
  17. }
  18. return NULL;
  19. }
  20. const SubGhzProtocol* subghz_protocol_registry_get_by_index(size_t index) {
  21. if(index < subghz_protocol_registry_count()) {
  22. return subghz_protocol_registry[index];
  23. } else {
  24. return NULL;
  25. }
  26. }
  27. size_t subghz_protocol_registry_count() {
  28. return COUNT_OF(subghz_protocol_registry);
  29. }