[FL-2904, FL-2900, FL-2890] WS: add app WeatherStation (#1833)
* WeatherStation: start
* SubGhz: rename protocol magellen -> magellan
* WeatherStation: err Unresolved symbols: {'subghz_protocol_decoder_base_get_string'}
* WeatherStation: fix Unresolved symbols: {'subghz_protocol_decoder_base_get_string'}
* Subghz: add set protocol_items
* WeatherStation: adding your protocols
* WS: add Infactory protocol
* WS: add history
* WS: add setting
* WS: add lock
* WS: add hopper frequency
* WS: fix history
* WS fix string_t -> FuriString*
* WS: add images
* WS: history record update when receiving data from the sensor again
* WS: add receiver info, delete extra code
* WS: add protocol ThermoPRO_TX4
* [FL-2900] SubGhz: Move icons in Sub-GHz
* WS: add Notification
* [FL-2890] SubGhz: Rename *_user files in resources to _user.example
* WS: add about scene
* WS: removing redundant code
* WS: add protocol Nexus-TH
* WS: add protocol GT_WT03
* WS: fix notification and rename "Weather Station" -> "Read Weather Station"
* SubGhz: partial unit tests fix
* SubGhz: fix unit_test
* SubGhz: remove dead code
* SubGhz: rename SubGhzPresetDefinition into SubGhzRadioPreset, cleanup subghz types.
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#include "environment.h"
|
||||
#include "registry.h"
|
||||
|
||||
struct SubGhzEnvironment {
|
||||
SubGhzKeystore* keystore;
|
||||
const SubGhzProtocolRegistry* protocol_registry;
|
||||
const char* came_atomo_rainbow_table_file_name;
|
||||
const char* nice_flor_s_rainbow_table_file_name;
|
||||
};
|
||||
@@ -10,6 +12,7 @@ SubGhzEnvironment* subghz_environment_alloc() {
|
||||
SubGhzEnvironment* instance = malloc(sizeof(SubGhzEnvironment));
|
||||
|
||||
instance->keystore = subghz_keystore_alloc();
|
||||
instance->protocol_registry = NULL;
|
||||
instance->came_atomo_rainbow_table_file_name = NULL;
|
||||
instance->nice_flor_s_rainbow_table_file_name = NULL;
|
||||
|
||||
@@ -19,6 +22,9 @@ SubGhzEnvironment* subghz_environment_alloc() {
|
||||
void subghz_environment_free(SubGhzEnvironment* instance) {
|
||||
furi_assert(instance);
|
||||
|
||||
instance->protocol_registry = NULL;
|
||||
instance->came_atomo_rainbow_table_file_name = NULL;
|
||||
instance->nice_flor_s_rainbow_table_file_name = NULL;
|
||||
subghz_keystore_free(instance->keystore);
|
||||
|
||||
free(instance);
|
||||
@@ -65,3 +71,30 @@ const char*
|
||||
|
||||
return instance->nice_flor_s_rainbow_table_file_name;
|
||||
}
|
||||
|
||||
void subghz_environment_set_protocol_registry(
|
||||
SubGhzEnvironment* instance,
|
||||
void* protocol_registry_items) {
|
||||
furi_assert(instance);
|
||||
const SubGhzProtocolRegistry* protocol_registry = protocol_registry_items;
|
||||
instance->protocol_registry = protocol_registry;
|
||||
}
|
||||
|
||||
void* subghz_environment_get_protocol_registry(SubGhzEnvironment* instance) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->protocol_registry);
|
||||
return (void*)instance->protocol_registry;
|
||||
}
|
||||
|
||||
const char*
|
||||
subghz_environment_get_protocol_name_registry(SubGhzEnvironment* instance, size_t idx) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->protocol_registry);
|
||||
const SubGhzProtocol* protocol =
|
||||
subghz_protocol_registry_get_by_index(instance->protocol_registry, idx);
|
||||
if(protocol != NULL) {
|
||||
return protocol->name;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user