[FL-1756, FL-1769, FL-1776, FL-1759] Gui: input events complementary V3, refactoring. SubGhz: read/emulate fixes. Cleanup. (#684)

* Gui: move rotation logic to ViewPort, replace delayed View switch in ViewDispatcher with event filtering and redirection to previous view.
* SubGhz: add function description
* Gui, Input: add event id to input events.
* SubGhz: fix "crashing on ?"
* SubGhz: add icon scanning
* SubGhz: updated interface read scene,  updated interface config scene
* Assets: update subghz assets
* SubGhz:  replaced the picture in the read scene, changed the paths to additional files
* SubGhz: fix deadlock in timer callback
* SubGhz: fix icon read scene
* SubGhz: fix icon read scene
* SubGhz: fix duble text transmitter scene
* SubGhz: correct spelling. Gui: bigger queue for ViewDispatcher.
* SubGhz: fix creation and transmission of dynamic code without the presence of a manufactory key
* SubGhz: fix keelog, setting a name in the absence of a manufactory key
* SubGhz: fix load bad keelog key
* Format sources
* Furi: remove garbage from core. GpioTester: fix memory leak and cleanup
* Accessor: remove obsolete notification code
* MusicPlayer: remove input event injection
* Input: rename id to sequence

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2021-09-02 01:05:00 +04:00
committed by GitHub
parent 3ed26e61eb
commit e17336498d
47 changed files with 763 additions and 476 deletions

View File

@@ -174,15 +174,31 @@ void subghz_protocol_keeloq_check_remote_controller(SubGhzProtocolKeeloq* instan
instance->common.btn = key_fix >> 28;
}
const char* subghz_protocol_keeloq_get_manufacture_name(void* context) {
const char* subghz_protocol_keeloq_find_and_get_manufacture_name(void* context) {
SubGhzProtocolKeeloq* instance = context;
subghz_protocol_keeloq_check_remote_controller(instance);
return instance->manufacture_name;
}
void subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name) {
const char* subghz_protocol_keeloq_get_manufacture_name(void* context) {
SubGhzProtocolKeeloq* instance = context;
return instance->manufacture_name;
}
bool subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name) {
SubGhzProtocolKeeloq* instance = context;
instance->manufacture_name = manufacture_name;
int res = 0;
for
M_EACH(
manufacture_code,
*subghz_keystore_get_data(instance->keystore),
SubGhzKeyArray_t) {
res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name);
if(res == 0) return true;
}
instance->manufacture_name = "Unknown";
return false;
}
uint64_t subghz_protocol_keeloq_gen_key(void* context) {
@@ -232,6 +248,10 @@ bool subghz_protocol_keeloq_send_key(
if(instance->common.callback)
instance->common.callback((SubGhzProtocolCommon*)instance, instance->common.context);
if(!strcmp(instance->manufacture_name, "Unknown")) {
return false;
}
size_t index = 0;
encoder->size_upload = 11 * 2 + 2 + (instance->common.code_last_count_bit * 2) + 4;
if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false;
@@ -392,8 +412,7 @@ void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t outp
code_found_reverse_lo,
instance->common.btn,
instance->manufacture_name,
instance->common.serial
);
instance->common.serial);
}
void subghz_protocol_keeloq_to_save_str(SubGhzProtocolKeeloq* instance, string_t output) {
@@ -450,9 +469,7 @@ bool subghz_protocol_keeloq_to_load_protocol_from_file(
return loaded;
}
void subghz_decoder_keeloq_to_load_protocol(
SubGhzProtocolKeeloq* instance,
void* context) {
void subghz_decoder_keeloq_to_load_protocol(SubGhzProtocolKeeloq* instance, void* context) {
furi_assert(context);
furi_assert(instance);
SubGhzProtocolCommonLoad* data = context;