M*LIB: non-inlined strings, FuriString primitive (#1795)

* Quicksave 1
* Header stage complete
* Source stage complete
* Lint & merge fixes
* Includes
* Documentation step 1
* FBT: output free size considering BT STACK
* Documentation step 2
* py lint
* Fix music player plugin
* unit test stage 1: string allocator, mem, getters, setters, appends, compare, search.
* unit test: string equality
* unit test: string replace
* unit test: string start_with, end_with
* unit test: string trim
* unit test: utf-8
* Rename
* Revert fw_size changes
* Simplify CLI backspace handling
* Simplify CLI character insert
* Merge fixes
* Furi: correct filenaming and spelling
* Bt: remove furi string include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Sergey Gavrilov
2022-10-06 01:15:23 +10:00
committed by GitHub
parent 0f9ea925d3
commit 4bf29827f8
370 changed files with 5597 additions and 3963 deletions

View File

@@ -2,7 +2,6 @@
#include "keeloq_common.h"
#include "../subghz_keystore.h"
#include <m-string.h>
#include <m-array.h>
#include "../blocks/const.h"
@@ -131,7 +130,7 @@ static bool subghz_protocol_keeloq_gen_data(SubGhzProtocolEncoderKeeloq* instanc
for
M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) {
res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name);
res = strcmp(furi_string_get_cstr(manufacture_code->name), instance->manufacture_name);
if(res == 0) {
switch(manufacture_code->type) {
case KEELOQ_LEARNING_SIMPLE:
@@ -489,7 +488,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
break;
@@ -499,7 +498,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
break;
@@ -508,7 +507,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, seed, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
break;
@@ -517,7 +516,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
break;
@@ -526,7 +525,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
break;
@@ -534,7 +533,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
@@ -548,7 +547,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
@@ -558,7 +557,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
@@ -566,7 +565,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
man = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
@@ -575,7 +574,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, seed, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
@@ -583,7 +582,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
man = subghz_protocol_keeloq_common_secure_learning(fix, seed, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
@@ -592,7 +591,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
fix, manufacture_code->key);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
@@ -600,7 +599,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
man = subghz_protocol_keeloq_common_magic_xor_type1_learning(fix, man_rev);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name);
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
return 1;
}
break;
@@ -683,7 +682,7 @@ bool subghz_protocol_decoder_keeloq_deserialize(void* context, FlipperFormat* fl
return res;
}
void subghz_protocol_decoder_keeloq_get_string(void* context, string_t output) {
void subghz_protocol_decoder_keeloq_get_string(void* context, FuriString* output) {
furi_assert(context);
SubGhzProtocolDecoderKeeloq* instance = context;
subghz_protocol_keeloq_check_remote_controller(
@@ -697,7 +696,7 @@ void subghz_protocol_decoder_keeloq_get_string(void* context, string_t output) {
uint32_t code_found_reverse_hi = code_found_reverse >> 32;
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
string_cat_printf(
furi_string_cat_printf(
output,
"%s %dbit\r\n"
"Key:%08lX%08lX\r\n"