[FL-2230] SubGhz: protocol API refactoring (#969)

* SubGhz: protocols library refactoring
* SubGhz: new architecture and refactoring
* SubGhz: simplify protocol structure, remove unused types
* SubGhz: rename Subghz to SubGhz
* SubGhz: add environment concept

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
Skorpionm
2022-03-03 13:48:56 +04:00
committed by GitHub
parent 052237f8c9
commit 3164184bbc
173 changed files with 9836 additions and 8486 deletions

28
lib/subghz/receiver.h Normal file
View File

@@ -0,0 +1,28 @@
#pragma once
#include "types.h"
#include "protocols/base.h"
typedef struct SubGhzReceiver SubGhzReceiver;
typedef void (*SubGhzReceiverCallback)(
SubGhzReceiver* decoder,
SubGhzProtocolDecoderBase* decoder_base,
void* context);
SubGhzReceiver* subghz_receiver_alloc(SubGhzEnvironment* environment);
void subghz_receiver_free(SubGhzReceiver* instance);
void subghz_receiver_decode(SubGhzReceiver* instance, bool level, uint32_t duration);
void subghz_receiver_reset(SubGhzReceiver* instance);
void subghz_receiver_set_rx_callback(
SubGhzReceiver* instance,
SubGhzReceiverCallback callback,
void* context);
void subghz_receiver_set_filter(SubGhzReceiver* instance, SubGhzProtocolFlag filter);
SubGhzProtocolDecoderBase*
subghz_receiver_search_decoder_base_by_name(SubGhzReceiver* instance, const char* decoder_name);