2022-10-19 17:27:26 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-11-02 15:15:40 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-10-19 17:27:26 +00:00
|
|
|
typedef struct SubGhzEnvironment SubGhzEnvironment;
|
|
|
|
|
|
|
|
typedef struct SubGhzProtocolRegistry SubGhzProtocolRegistry;
|
2023-06-06 19:13:41 +00:00
|
|
|
typedef struct SubGhzProtocol SubGhzProtocol;
|
2022-10-19 17:27:26 +00:00
|
|
|
|
|
|
|
struct SubGhzProtocolRegistry {
|
|
|
|
const SubGhzProtocol** items;
|
|
|
|
const size_t size;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registration by name SubGhzProtocol.
|
|
|
|
* @param protocol_registry SubGhzProtocolRegistry
|
|
|
|
* @param name Protocol name
|
|
|
|
* @return SubGhzProtocol* pointer to a SubGhzProtocol instance
|
|
|
|
*/
|
|
|
|
const SubGhzProtocol* subghz_protocol_registry_get_by_name(
|
|
|
|
const SubGhzProtocolRegistry* protocol_registry,
|
|
|
|
const char* name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registration protocol by index in array SubGhzProtocol.
|
|
|
|
* @param protocol_registry SubGhzProtocolRegistry
|
|
|
|
* @param index Protocol by index in array
|
|
|
|
* @return SubGhzProtocol* pointer to a SubGhzProtocol instance
|
|
|
|
*/
|
|
|
|
const SubGhzProtocol* subghz_protocol_registry_get_by_index(
|
|
|
|
const SubGhzProtocolRegistry* protocol_registry,
|
|
|
|
size_t index);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Getting the number of registered protocols.
|
|
|
|
* @param protocol_registry SubGhzProtocolRegistry
|
|
|
|
* @return Number of protocols
|
|
|
|
*/
|
|
|
|
size_t subghz_protocol_registry_count(const SubGhzProtocolRegistry* protocol_registry);
|
2022-11-02 15:15:40 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|