mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-24 22:07:14 +03:00
acc39a4bc0
* Api Symbols: replace asserts with checks * Api Symbols: replace asserts with checks part 2 * Update no args function signatures with void, to help compiler to track incorrect usage * More unavoidable void * Update PVS config and code to make it happy * Format sources * nfc: fix checks * dead code cleanup & include fixes Co-authored-by: gornekich <n.gorbadey@gmail.com> Co-authored-by: hedger <hedger@users.noreply.github.com> Co-authored-by: hedger <hedger@nanode.su>
31 lines
921 B
C
31 lines
921 B
C
#include "registry.h"
|
|
|
|
const SubGhzProtocol* subghz_protocol_registry_get_by_name(
|
|
const SubGhzProtocolRegistry* protocol_registry,
|
|
const char* name) {
|
|
furi_check(protocol_registry);
|
|
|
|
for(size_t i = 0; i < subghz_protocol_registry_count(protocol_registry); i++) {
|
|
if(strcmp(name, protocol_registry->items[i]->name) == 0) {
|
|
return protocol_registry->items[i];
|
|
}
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
const SubGhzProtocol* subghz_protocol_registry_get_by_index(
|
|
const SubGhzProtocolRegistry* protocol_registry,
|
|
size_t index) {
|
|
furi_check(protocol_registry);
|
|
if(index < subghz_protocol_registry_count(protocol_registry)) {
|
|
return protocol_registry->items[index];
|
|
} else {
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
size_t subghz_protocol_registry_count(const SubGhzProtocolRegistry* protocol_registry) {
|
|
furi_check(protocol_registry);
|
|
return protocol_registry->size;
|
|
}
|