[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

@@ -22,7 +22,9 @@ void subghz_protocol_came_free(SubGhzProtocolCame* instance);
* @param encoder - SubGhzProtocolCommonEncoder encoder
* @return bool
*/
bool subghz_protocol_came_send_key(SubGhzProtocolCame* instance, SubGhzProtocolCommonEncoder* encoder);
bool subghz_protocol_came_send_key(
SubGhzProtocolCame* instance,
SubGhzProtocolCommonEncoder* encoder);
/** Reset internal state
* @param instance - SubGhzProtocolCame instance
@@ -43,6 +45,26 @@ void subghz_protocol_came_parse(SubGhzProtocolCame* instance, bool level, uint32
*/
void subghz_protocol_came_to_str(SubGhzProtocolCame* instance, string_t output);
/** Get a string to save the protocol
*
* @param instance - SubGhzProtocolCame instance
* @param output - the resulting string
*/
void subghz_protocol_came_to_save_str(SubGhzProtocolCame* instance, string_t output);
bool subghz_protocol_came_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolCame* instance);
/** Loading protocol from file
*
* @param file_worker - FileWorker file_worker
* @param instance - SubGhzProtocolCame instance
* @return bool
*/
bool subghz_protocol_came_to_load_protocol_from_file(
FileWorker* file_worker,
SubGhzProtocolCame* instance);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolCame instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_came_to_load_protocol(SubGhzProtocolCame* instance, void* context);

View File

@@ -96,9 +96,30 @@ struct SubGhzProtocolCommonLoad{
uint32_t param3;
};
/** Allocate SubGhzProtocolCommonEncoder
*
* @return SubGhzProtocolCommonEncoder*
*/
SubGhzProtocolCommonEncoder* subghz_protocol_encoder_common_alloc();
/** Free SubGhzProtocolCommonEncoder
*
* @param instance
*/
void subghz_protocol_encoder_common_free(SubGhzProtocolCommonEncoder* instance);
/** Get count repeat left
*
* @param instance - SubGhzProtocolCommonEncoder instance
* @return count repeat left
*/
size_t subghz_encoder_common_get_repeat_left(SubGhzProtocolCommonEncoder* instance);
/** Get LevelDuration this encoder step
*
* @param context - SubGhzProtocolCommonEncoder context
* @return LevelDuration this step
*/
LevelDuration subghz_protocol_encoder_common_yield(void* context);
/** Add data bit to code_found
@@ -146,4 +167,11 @@ void subghz_protocol_common_set_callback(
*/
void subghz_protocol_common_to_str(SubGhzProtocolCommon* instance, string_t output);
/** Converting a string to a HEX array
*
* @param str - string data
* @param buff - uint8_t* buff
* @param len - size buff
* @return bool
*/
bool subghz_protocol_common_read_hex(string_t str, uint8_t* buff, uint16_t len);

View File

@@ -50,4 +50,9 @@ void subghz_protocol_faac_slh_parse(SubGhzProtocolFaacSLH* instance, bool level,
*/
void subghz_protocol_faac_slh_to_str(SubGhzProtocolFaacSLH* instance, string_t output);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolFaacSLH instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_faac_slh_to_load_protocol(SubGhzProtocolFaacSLH* instance, void* context);

View File

@@ -43,6 +43,24 @@ void subghz_protocol_gate_tx_parse(SubGhzProtocolGateTX* instance, bool level, u
*/
void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t output);
/** Get a string to save the protocol
*
* @param instance - SubGhzProtocolGateTX instance
* @param output - the resulting string
*/
void subghz_protocol_gate_tx_to_save_str(SubGhzProtocolGateTX* instance, string_t output);
/** Loading protocol from file
*
* @param file_worker - FileWorker file_worker
* @param instance - SubGhzProtocolGateTX instance
* @return bool
*/
bool subghz_protocol_gate_tx_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolGateTX* instance);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolGateTX instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_gate_tx_to_load_protocol(SubGhzProtocolGateTX* instance, void* context);

View File

@@ -49,4 +49,10 @@ void subghz_protocol_ido_parse(SubGhzProtocolIDo* instance, bool level, uint32_t
* @param output - output string
*/
void subghz_protocol_ido_to_str(SubGhzProtocolIDo* instance, string_t output);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolIDo instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_ido_to_load_protocol(SubGhzProtocolIDo* instance, void* context);

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;

View File

@@ -18,14 +18,27 @@ SubGhzProtocolKeeloq* subghz_protocol_keeloq_alloc(SubGhzKeystore* keystore);
*/
void subghz_protocol_keeloq_free(SubGhzProtocolKeeloq* instance);
/** Find and get manufacture name
*
* @param context - SubGhzProtocolKeeloq context
* @return name - char* manufacture name
*/
const char* subghz_protocol_keeloq_find_and_get_manufacture_name(void* context);
/** Get manufacture name
*
* @param context - SubGhzProtocolKeeloq context
* @return name - char* manufacture name
*/
const char* subghz_protocol_keeloq_get_manufacture_name(void* context);
/** Set manufacture name
*
* @param manufacture_name - manufacture name
* @param context - SubGhzProtocolKeeloq context
* @return bool
*/
void subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name);
bool subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name);
/** Get key keeloq
*
@@ -61,6 +74,24 @@ void subghz_protocol_keeloq_parse(SubGhzProtocolKeeloq* instance, bool level, ui
*/
void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t output);
/** Get a string to save the protocol
*
* @param instance - SubGhzProtocolKeeloq instance
* @param output - the resulting string
*/
void subghz_protocol_keeloq_to_save_str(SubGhzProtocolKeeloq* instance, string_t output);
/** Loading protocol from file
*
* @param file_worker - FileWorker file_worker
* @param instance - SubGhzProtocolKeeloq instance
* @return bool
*/
bool subghz_protocol_keeloq_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolKeeloq* instance);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolKeeloq instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_keeloq_to_load_protocol(SubGhzProtocolKeeloq* instance, void* context);

View File

@@ -49,6 +49,24 @@ void subghz_protocol_nero_sketch_parse(SubGhzProtocolNeroSketch* instance, bool
*/
void subghz_protocol_nero_sketch_to_str(SubGhzProtocolNeroSketch* instance, string_t output);
/** Get a string to save the protocol
*
* @param instance - SubGhzProtocolNeroSketch instance
* @param output - the resulting string
*/
void subghz_protocol_nero_sketch_to_save_str(SubGhzProtocolNeroSketch* instance, string_t output);
/** Loading protocol from file
*
* @param file_worker - FileWorker file_worker
* @param instance - SubGhzProtocolNeroSketch instance
* @return bool
*/
bool subghz_protocol_nero_sketch_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolNeroSketch* instance);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolNeroSketch instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_nero_sketch_to_load_protocol(SubGhzProtocolNeroSketch* instance, void* context);

View File

@@ -43,6 +43,24 @@ void subghz_protocol_nice_flo_parse(SubGhzProtocolNiceFlo* instance, bool level,
*/
void subghz_protocol_nice_flo_to_str(SubGhzProtocolNiceFlo* instance, string_t output);
/** Get a string to save the protocol
*
* @param instance - SubGhzProtocolNiceFlo instance
* @param output - the resulting string
*/
void subghz_protocol_nice_flo_to_save_str(SubGhzProtocolNiceFlo* instance, string_t output);
/** Loading protocol from file
*
* @param file_worker - FileWorker file_worker
* @param instance - SubGhzProtocolNiceFlo instance
* @return bool
*/
bool subghz_protocol_nice_flo_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolNiceFlo* instance);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolNiceFlo instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_nice_flo_to_load_protocol(SubGhzProtocolNiceFlo* instance, void* context);

View File

@@ -50,4 +50,10 @@ void subghz_protocol_nice_flor_s_parse(SubGhzProtocolNiceFlorS* instance, bool l
* @param output - output string
*/
void subghz_protocol_nice_flor_s_to_str(SubGhzProtocolNiceFlorS* instance, string_t output);
/** Loading protocol from bin data
*
* @param instance - SubGhzProtocolNiceFlorS instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_nice_flor_s_to_load_protocol(SubGhzProtocolNiceFlorS* instance, void* context);

View File

@@ -56,6 +56,11 @@ SubGhzDecoderPrinceton* subghz_decoder_princeton_alloc();
*/
void subghz_decoder_princeton_free(SubGhzDecoderPrinceton* instance);
/** Get Te interval protocol
*
* @param context - SubGhzDecoderPrinceton context
* @return Te interval (us)
*/
uint16_t subghz_protocol_princeton_get_te(void* context);
/** Get upload protocol
@@ -90,11 +95,26 @@ void subghz_decoder_princeton_parse(
*/
void subghz_decoder_princeton_to_str(SubGhzDecoderPrinceton* instance, string_t output);
/** Get a string to save the protocol
*
* @param instance - SubGhzDecoderPrinceton instance
* @param output - the resulting string
*/
void subghz_decoder_princeton_to_save_str(SubGhzDecoderPrinceton* instance, string_t output);
bool subghz_decoder_princeton_to_load_protocol_from_file(
FileWorker* file_worker,
SubGhzDecoderPrinceton* instance);
/** Loading protocol from file
*
* @param file_worker - FileWorker file_worker
* @param instance - SubGhzDecoderPrinceton instance
* @return bool
*/
bool subghz_decoder_princeton_to_load_protocol_from_file(FileWorker* file_worker, SubGhzDecoderPrinceton* instance);
/** Loading protocol from bin data
*
* @param instance - SubGhzDecoderPrinceton instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_princeton_to_load_protocol(
SubGhzDecoderPrinceton* instance,
void* context) ;

View File

@@ -38,12 +38,17 @@ void subghz_protocol_star_line_free(SubGhzProtocolStarLine* instance) {
free(instance);
}
const char* subghz_protocol_star_line_get_manufacture_name (void* context){
const char* subghz_protocol_star_line_find_and_get_manufacture_name (void* context){
SubGhzProtocolStarLine* instance = context;
subghz_protocol_star_line_check_remote_controller(instance);
return instance->manufacture_name;
}
const char* subghz_protocol_star_line_get_manufacture_name (void* context){
SubGhzProtocolStarLine* instance = context;
return instance->manufacture_name;
}
/** Send bit
*
* @param instance - SubGhzProtocolStarLine instance

View File

@@ -18,6 +18,18 @@ SubGhzProtocolStarLine* subghz_protocol_star_line_alloc(SubGhzKeystore* keystore
*/
void subghz_protocol_star_line_free(SubGhzProtocolStarLine* instance);
/** Find and get manufacture name
*
* @param context - SubGhzProtocolStarLine context
* @return name - char* manufacture name
*/
const char* subghz_protocol_star_line_find_and_get_manufacture_name(void* context);
/** Get manufacture name
*
* @param context - SubGhzProtocolStarLine context
* @return name - char* manufacture name
*/
const char* subghz_protocol_star_line_get_manufacture_name(void* context);
/** Sends the key on the air
@@ -53,4 +65,10 @@ void subghz_protocol_star_line_parse(SubGhzProtocolStarLine* instance, bool leve
* @param output - output string
*/
void subghz_protocol_star_line_to_str(SubGhzProtocolStarLine* instance, string_t output);
/** Loading protocol from bin data
*
* @param instance - SubGhzDecoderPrinceton instance
* @param context - SubGhzProtocolCommonLoad context
*/
void subghz_decoder_star_line_to_load_protocol(SubGhzProtocolStarLine* instance, void* context);