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:
@@ -11,7 +11,7 @@ void subghz_protocol_decoder_base_set_decoder_callback(
|
||||
|
||||
bool subghz_protocol_decoder_base_get_string(
|
||||
SubGhzProtocolDecoderBase* decoder_base,
|
||||
string_t output) {
|
||||
FuriString* output) {
|
||||
bool status = false;
|
||||
|
||||
if(decoder_base->protocol && decoder_base->protocol->decoder &&
|
||||
|
||||
@@ -11,8 +11,9 @@ typedef struct SubGhzProtocolDecoderBase SubGhzProtocolDecoderBase;
|
||||
typedef void (
|
||||
*SubGhzProtocolDecoderBaseRxCallback)(SubGhzProtocolDecoderBase* instance, void* context);
|
||||
|
||||
typedef void (
|
||||
*SubGhzProtocolDecoderBaseSerialize)(SubGhzProtocolDecoderBase* decoder_base, string_t output);
|
||||
typedef void (*SubGhzProtocolDecoderBaseSerialize)(
|
||||
SubGhzProtocolDecoderBase* decoder_base,
|
||||
FuriString* output);
|
||||
|
||||
struct SubGhzProtocolDecoderBase {
|
||||
// Decoder general section
|
||||
@@ -41,7 +42,7 @@ void subghz_protocol_decoder_base_set_decoder_callback(
|
||||
*/
|
||||
bool subghz_protocol_decoder_base_get_string(
|
||||
SubGhzProtocolDecoderBase* decoder_base,
|
||||
string_t output);
|
||||
FuriString* output);
|
||||
|
||||
/**
|
||||
* Serialize data SubGhzProtocolDecoderBase.
|
||||
|
||||
@@ -323,11 +323,11 @@ bool subghz_protocol_decoder_bett_deserialize(void* context, FlipperFormat* flip
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_bett_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_bett_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderBETT* instance = context;
|
||||
uint32_t data = (uint32_t)(instance->generic.data & 0x3FFFF);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%05lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_bett_deserialize(void* context, FlipperFormat* flip
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBETT instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_bett_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_bett_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -322,7 +322,7 @@ bool subghz_protocol_decoder_came_deserialize(void* context, FlipperFormat* flip
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_came_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_came_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderCame* instance = context;
|
||||
|
||||
@@ -333,7 +333,7 @@ void subghz_protocol_decoder_came_get_string(void* context, string_t output) {
|
||||
|
||||
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_came_deserialize(void* context, FlipperFormat* flip
|
||||
* @param context Pointer to a SubGhzProtocolDecoderCame instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_came_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_came_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -325,7 +325,7 @@ bool subghz_protocol_decoder_came_atomo_deserialize(void* context, FlipperFormat
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_came_atomo_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_came_atomo_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderCameAtomo* instance = context;
|
||||
subghz_protocol_came_atomo_remote_controller(
|
||||
@@ -333,7 +333,7 @@ void subghz_protocol_decoder_came_atomo_get_string(void* context, string_t outpu
|
||||
uint32_t code_found_hi = instance->generic.data >> 32;
|
||||
uint32_t code_found_lo = instance->generic.data & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -69,4 +69,4 @@ bool subghz_protocol_decoder_came_atomo_deserialize(void* context, FlipperFormat
|
||||
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_came_atomo_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_came_atomo_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -446,14 +446,14 @@ bool subghz_protocol_decoder_came_twee_deserialize(void* context, FlipperFormat*
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_came_twee_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_came_twee_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderCameTwee* instance = context;
|
||||
subghz_protocol_came_twee_remote_controller(&instance->generic);
|
||||
uint32_t code_found_hi = instance->generic.data >> 32;
|
||||
uint32_t code_found_lo = instance->generic.data & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_came_twee_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_came_twee_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_came_twee_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -451,7 +451,7 @@ bool subghz_protocol_decoder_chamb_code_deserialize(void* context, FlipperFormat
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_chamb_code_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_chamb_code_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderChamb_Code* instance = context;
|
||||
|
||||
@@ -462,7 +462,7 @@ void subghz_protocol_decoder_chamb_code_get_string(void* context, string_t outpu
|
||||
|
||||
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key:0x%03lX\r\n"
|
||||
@@ -474,19 +474,19 @@ void subghz_protocol_decoder_chamb_code_get_string(void* context, string_t outpu
|
||||
|
||||
switch(instance->generic.data_count_bit) {
|
||||
case 7:
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"DIP:" CHAMBERLAIN_7_CODE_DIP_PATTERN "\r\n",
|
||||
CHAMBERLAIN_7_CODE_DATA_TO_DIP(code_found_lo));
|
||||
break;
|
||||
case 8:
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"DIP:" CHAMBERLAIN_8_CODE_DIP_PATTERN "\r\n",
|
||||
CHAMBERLAIN_8_CODE_DATA_TO_DIP(code_found_lo));
|
||||
break;
|
||||
case 9:
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"DIP:" CHAMBERLAIN_9_CODE_DIP_PATTERN "\r\n",
|
||||
CHAMBERLAIN_9_CODE_DATA_TO_DIP(code_found_lo));
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_chamb_code_deserialize(void* context, FlipperFormat
|
||||
* @param context Pointer to a SubGhzProtocolDecoderChamb_Code instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_chamb_code_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_chamb_code_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -343,12 +343,12 @@ bool subghz_protocol_decoder_clemsa_deserialize(void* context, FlipperFormat* fl
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_clemsa_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_clemsa_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderClemsa* instance = context;
|
||||
subghz_protocol_clemsa_check_remote_controller(&instance->generic);
|
||||
//uint32_t data = (uint32_t)(instance->generic.data & 0xFFFFFF);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%05lX Btn %X\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_clemsa_deserialize(void* context, FlipperFormat* fl
|
||||
* @param context Pointer to a SubGhzProtocolDecoderClemsa instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_clemsa_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_clemsa_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -337,11 +337,11 @@ bool subghz_protocol_decoder_doitrand_deserialize(void* context, FlipperFormat*
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_doitrand_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_doitrand_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderDoitrand* instance = context;
|
||||
subghz_protocol_doitrand_check_remote_controller(&instance->generic);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%02lX%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_doitrand_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderDoitrand instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_doitrand_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_doitrand_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -207,7 +207,7 @@ bool subghz_protocol_decoder_faac_slh_deserialize(void* context, FlipperFormat*
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_faac_slh_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_faac_slh_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderFaacSLH* instance = context;
|
||||
subghz_protocol_faac_slh_check_remote_controller(&instance->generic);
|
||||
@@ -216,7 +216,7 @@ void subghz_protocol_decoder_faac_slh_get_string(void* context, string_t output)
|
||||
uint32_t code_fix = code_found_reverse & 0xFFFFFFFF;
|
||||
uint32_t code_hop = (code_found_reverse >> 32) & 0xFFFFFFFF;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%lX%08lX\r\n"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_faac_slh_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_faac_slh_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_faac_slh_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -317,11 +317,11 @@ bool subghz_protocol_decoder_gate_tx_deserialize(void* context, FlipperFormat* f
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_gate_tx_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_gate_tx_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderGateTx* instance = context;
|
||||
subghz_protocol_gate_tx_check_remote_controller(&instance->generic);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%06lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_gate_tx_deserialize(void* context, FlipperFormat* f
|
||||
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_gate_tx_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_gate_tx_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -350,12 +350,12 @@ bool subghz_protocol_decoder_holtek_deserialize(void* context, FlipperFormat* fl
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_holtek_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_holtek_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderHoltek* instance = context;
|
||||
subghz_protocol_holtek_check_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
@@ -368,8 +368,8 @@ void subghz_protocol_decoder_holtek_get_string(void* context, string_t output) {
|
||||
instance->generic.btn >> 4);
|
||||
|
||||
if((instance->generic.btn & 0xF) == 0xE) {
|
||||
string_cat_printf(output, "ON\r\n");
|
||||
furi_string_cat_printf(output, "ON\r\n");
|
||||
} else if(((instance->generic.btn & 0xF) == 0xB)) {
|
||||
string_cat_printf(output, "OFF\r\n");
|
||||
furi_string_cat_printf(output, "OFF\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_holtek_deserialize(void* context, FlipperFormat* fl
|
||||
* @param context Pointer to a SubGhzProtocolDecoderHoltek instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_holtek_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_holtek_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -374,12 +374,12 @@ bool subghz_protocol_decoder_honeywell_wdb_deserialize(
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_honeywell_wdb_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_honeywell_wdb_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderHoneywell_WDB* instance = context;
|
||||
subghz_protocol_honeywell_wdb_check_remote_controller(instance);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -108,4 +108,4 @@ bool subghz_protocol_decoder_honeywell_wdb_deserialize(
|
||||
* @param context Pointer to a SubGhzProtocolDecoderHoneywell_WDB instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_honeywell_wdb_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_honeywell_wdb_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -338,12 +338,12 @@ bool subghz_protocol_decoder_hormann_deserialize(void* context, FlipperFormat* f
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_hormann_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_hormann_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderHormann* instance = context;
|
||||
subghz_protocol_hormann_check_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s\r\n"
|
||||
"%dbit\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_hormann_deserialize(void* context, FlipperFormat* f
|
||||
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_hormann_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_hormann_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -205,7 +205,7 @@ bool subghz_protocol_decoder_ido_deserialize(void* context, FlipperFormat* flipp
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_ido_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_ido_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderIDo* instance = context;
|
||||
|
||||
@@ -215,7 +215,7 @@ void subghz_protocol_decoder_ido_get_string(void* context, string_t output) {
|
||||
uint32_t code_fix = code_found_reverse & 0xFFFFFF;
|
||||
uint32_t code_hop = (code_found_reverse >> 24) & 0xFFFFFF;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_ido_deserialize(void* context, FlipperFormat* flipp
|
||||
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_ido_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_ido_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -434,13 +434,13 @@ bool subghz_protocol_decoder_intertechno_v3_deserialize(
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_intertechno_v3_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_intertechno_v3_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderIntertechno_V3* instance = context;
|
||||
|
||||
subghz_protocol_intertechno_v3_check_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%.11s %db\r\n"
|
||||
"Key:0x%08llX\r\n"
|
||||
@@ -453,17 +453,17 @@ void subghz_protocol_decoder_intertechno_v3_get_string(void* context, string_t o
|
||||
if(instance->generic.data_count_bit ==
|
||||
subghz_protocol_intertechno_v3_const.min_count_bit_for_found) {
|
||||
if(instance->generic.cnt >> 5) {
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output, "Ch: All Btn:%s\r\n", (instance->generic.btn ? "On" : "Off"));
|
||||
} else {
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"Ch:" CH_PATTERN " Btn:%s\r\n",
|
||||
CNT_TO_CH(instance->generic.cnt),
|
||||
(instance->generic.btn ? "On" : "Off"));
|
||||
}
|
||||
} else if(instance->generic.data_count_bit == INTERTECHNO_V3_DIMMING_COUNT_BIT) {
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"Ch:" CH_PATTERN " Dimm:%d%%\r\n",
|
||||
CNT_TO_CH(instance->generic.cnt),
|
||||
|
||||
@@ -108,4 +108,4 @@ bool subghz_protocol_decoder_intertechno_v3_deserialize(
|
||||
* @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_intertechno_v3_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_intertechno_v3_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -124,4 +124,4 @@ bool subghz_protocol_decoder_keeloq_deserialize(void* context, FlipperFormat* fl
|
||||
* @param context Pointer to a SubGhzProtocolDecoderKeeloq instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_keeloq_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_keeloq_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#include <m-string.h>
|
||||
#include <m-array.h>
|
||||
|
||||
#define bit(x, n) (((x) >> (n)) & 1)
|
||||
|
||||
@@ -256,7 +256,7 @@ bool subghz_protocol_decoder_kia_deserialize(void* context, FlipperFormat* flipp
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_kia_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_kia_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderKIA* instance = context;
|
||||
|
||||
@@ -264,7 +264,7 @@ void subghz_protocol_decoder_kia_get_string(void* context, string_t output) {
|
||||
uint32_t code_found_hi = instance->generic.data >> 32;
|
||||
uint32_t code_found_lo = instance->generic.data & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%08lX%08lX\r\n"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_kia_deserialize(void* context, FlipperFormat* flipp
|
||||
* @param context Pointer to a SubGhzProtocolDecoderKIA instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_kia_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_kia_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -327,7 +327,7 @@ bool subghz_protocol_decoder_linear_deserialize(void* context, FlipperFormat* fl
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_linear_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_linear_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderLinear* instance = context;
|
||||
|
||||
@@ -338,7 +338,7 @@ void subghz_protocol_decoder_linear_get_string(void* context, string_t output) {
|
||||
|
||||
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_linear_deserialize(void* context, FlipperFormat* fl
|
||||
* @param context Pointer to a SubGhzProtocolDecoderLinear instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_linear_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_linear_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -375,8 +375,8 @@ static void subghz_protocol_magellen_check_remote_controller(SubGhzBlockGeneric*
|
||||
instance->btn = (data_rev >> 16) & 0xFF;
|
||||
}
|
||||
|
||||
static void subghz_protocol_magellen_get_event_serialize(uint8_t event, string_t output) {
|
||||
string_cat_printf(
|
||||
static void subghz_protocol_magellen_get_event_serialize(uint8_t event, FuriString* output) {
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s%s%s%s%s%s%s%s",
|
||||
((event >> 4) & 0x1 ? (event & 0x1 ? " Open" : " Close") :
|
||||
@@ -424,11 +424,11 @@ bool subghz_protocol_decoder_magellen_deserialize(void* context, FlipperFormat*
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_magellen_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_magellen_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderMagellen* instance = context;
|
||||
subghz_protocol_magellen_check_remote_controller(&instance->generic);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_magellen_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderMagellen instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_magellen_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_magellen_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -373,12 +373,12 @@ bool subghz_protocol_decoder_marantec_deserialize(void* context, FlipperFormat*
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_marantec_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_marantec_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderMarantec* instance = context;
|
||||
subghz_protocol_marantec_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_marantec_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderMarantec instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_marantec_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_marantec_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -408,12 +408,12 @@ bool subghz_protocol_decoder_megacode_deserialize(void* context, FlipperFormat*
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_megacode_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_megacode_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderMegaCode* instance = context;
|
||||
subghz_protocol_megacode_check_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%06lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_megacode_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderMegaCode instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_megacode_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_megacode_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -370,7 +370,7 @@ bool subghz_protocol_decoder_nero_radio_deserialize(void* context, FlipperFormat
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_nero_radio_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_nero_radio_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderNeroRadio* instance = context;
|
||||
|
||||
@@ -383,7 +383,7 @@ void subghz_protocol_decoder_nero_radio_get_string(void* context, string_t outpu
|
||||
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:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_nero_radio_deserialize(void* context, FlipperFormat
|
||||
* @param context Pointer to a SubGhzProtocolDecoderNeroRadio instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_nero_radio_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_nero_radio_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -355,7 +355,7 @@ bool subghz_protocol_decoder_nero_sketch_deserialize(void* context, FlipperForma
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_nero_sketch_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_nero_sketch_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderNeroSketch* instance = context;
|
||||
|
||||
@@ -368,7 +368,7 @@ void subghz_protocol_decoder_nero_sketch_get_string(void* context, string_t outp
|
||||
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:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_nero_sketch_deserialize(void* context, FlipperForma
|
||||
* @param context Pointer to a SubGhzProtocolDecoderNeroSketch instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_nero_sketch_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_nero_sketch_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -309,7 +309,7 @@ bool subghz_protocol_decoder_nice_flo_deserialize(void* context, FlipperFormat*
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_nice_flo_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderNiceFlo* instance = context;
|
||||
|
||||
@@ -318,7 +318,7 @@ void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output)
|
||||
instance->generic.data, instance->generic.data_count_bit);
|
||||
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_nice_flo_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_nice_flo_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -354,7 +354,7 @@ bool subghz_protocol_decoder_nice_flor_s_deserialize(void* context, FlipperForma
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_nice_flor_s_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_nice_flor_s_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderNiceFlorS* instance = context;
|
||||
|
||||
@@ -363,7 +363,7 @@ void subghz_protocol_decoder_nice_flor_s_get_string(void* context, string_t outp
|
||||
uint32_t code_found_hi = instance->generic.data >> 32;
|
||||
uint32_t code_found_lo = instance->generic.data & 0x00000000ffffffff;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_nice_flor_s_deserialize(void* context, FlipperForma
|
||||
* @param context Pointer to a SubGhzProtocolDecoderNiceFlorS instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_nice_flor_s_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_nice_flor_s_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "../blocks/math.h"
|
||||
#include <lib/toolbox/manchester_decoder.h>
|
||||
#include <lib/flipper_format/flipper_format_i.h>
|
||||
#include <m-string.h>
|
||||
|
||||
#define TAG "SubGhzProtocolOregon2"
|
||||
|
||||
@@ -247,12 +246,12 @@ bool subghz_protocol_decoder_oregon2_deserialize(void* context, FlipperFormat* f
|
||||
|
||||
// append string of the variable data
|
||||
static void
|
||||
oregon2_var_data_append_string(uint16_t sensor_id, uint32_t var_data, string_t output) {
|
||||
oregon2_var_data_append_string(uint16_t sensor_id, uint32_t var_data, FuriString* output) {
|
||||
uint32_t val;
|
||||
|
||||
if(sensor_id == 0xEC40) {
|
||||
val = ((var_data >> 4) & 0xF) * 10 + ((var_data >> 8) & 0xF);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"Temp: %s%d.%d C\r\n",
|
||||
(var_data & 0xF) ? "-" : "+",
|
||||
@@ -261,7 +260,7 @@ static void
|
||||
}
|
||||
}
|
||||
|
||||
static void oregon2_append_check_sum(uint32_t fix_data, uint32_t var_data, string_t output) {
|
||||
static void oregon2_append_check_sum(uint32_t fix_data, uint32_t var_data, FuriString* output) {
|
||||
uint8_t sum = fix_data & 0xF;
|
||||
uint8_t ref_sum = var_data & 0xFF;
|
||||
var_data >>= 8;
|
||||
@@ -275,16 +274,16 @@ static void oregon2_append_check_sum(uint32_t fix_data, uint32_t var_data, strin
|
||||
// swap calculated sum nibbles
|
||||
sum = (((sum >> 4) & 0xF) | (sum << 4)) & 0xFF;
|
||||
if(sum == ref_sum)
|
||||
string_cat_printf(output, "Sum ok: 0x%hhX", ref_sum);
|
||||
furi_string_cat_printf(output, "Sum ok: 0x%hhX", ref_sum);
|
||||
else
|
||||
string_cat_printf(output, "Sum err: 0x%hhX vs 0x%hhX", ref_sum, sum);
|
||||
furi_string_cat_printf(output, "Sum err: 0x%hhX vs 0x%hhX", ref_sum, sum);
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_oregon2_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_oregon2_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderOregon2* instance = context;
|
||||
uint16_t sensor_id = OREGON2_SENSOR_ID(instance->generic.data);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s\r\n"
|
||||
"ID: 0x%04lX, ch: %d%s, rc: 0x%02lX\r\n",
|
||||
|
||||
@@ -320,11 +320,11 @@ bool subghz_protocol_decoder_phoenix_v2_deserialize(void* context, FlipperFormat
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_phoenix_v2_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_phoenix_v2_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderPhoenix_V2* instance = context;
|
||||
subghz_protocol_phoenix_v2_check_remote_controller(&instance->generic);
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%02lX%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_phoenix_v2_deserialize(void* context, FlipperFormat
|
||||
* @param context Pointer to a SubGhzProtocolDecoderPhoenix_V2 instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_phoenix_v2_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_phoenix_v2_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -373,12 +373,12 @@ bool subghz_protocol_decoder_power_smart_deserialize(void* context, FlipperForma
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_power_smart_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_power_smart_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderPowerSmart* instance = context;
|
||||
subghz_protocol_power_smart_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_power_smart_deserialize(void* context, FlipperForma
|
||||
* @param context Pointer to a SubGhzProtocolDecoderPowerSmart instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_power_smart_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_power_smart_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -351,14 +351,14 @@ bool subghz_protocol_decoder_princeton_deserialize(void* context, FlipperFormat*
|
||||
return res;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_princeton_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_princeton_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderPrinceton* instance = context;
|
||||
subghz_protocol_princeton_check_remote_controller(&instance->generic);
|
||||
uint32_t data_rev = subghz_protocol_blocks_reverse_key(
|
||||
instance->generic.data, instance->generic.data_count_bit);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%08lX\r\n"
|
||||
|
||||
@@ -104,4 +104,4 @@ bool subghz_protocol_decoder_princeton_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderPrinceton instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_princeton_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_princeton_get_string(void* context, FuriString* output);
|
||||
|
||||
+24
-23
@@ -29,7 +29,7 @@ struct SubGhzProtocolDecoderRAW {
|
||||
Storage* storage;
|
||||
FlipperFormat* flipper_file;
|
||||
uint32_t file_is_open;
|
||||
string_t file_name;
|
||||
FuriString* file_name;
|
||||
size_t sample_write;
|
||||
bool last_level;
|
||||
};
|
||||
@@ -38,7 +38,7 @@ struct SubGhzProtocolEncoderRAW {
|
||||
SubGhzProtocolEncoderBase base;
|
||||
|
||||
bool is_running;
|
||||
string_t file_name;
|
||||
FuriString* file_name;
|
||||
SubGhzFileEncoderWorker* file_worker_encoder;
|
||||
};
|
||||
|
||||
@@ -90,8 +90,8 @@ bool subghz_protocol_raw_save_to_file_init(
|
||||
instance->storage = furi_record_open(RECORD_STORAGE);
|
||||
instance->flipper_file = flipper_format_file_alloc(instance->storage);
|
||||
|
||||
string_t temp_str;
|
||||
string_init(temp_str);
|
||||
FuriString* temp_str;
|
||||
temp_str = furi_string_alloc();
|
||||
bool init = false;
|
||||
|
||||
do {
|
||||
@@ -104,16 +104,17 @@ bool subghz_protocol_raw_save_to_file_init(
|
||||
break;
|
||||
}
|
||||
|
||||
string_set(instance->file_name, dev_name);
|
||||
furi_string_set(instance->file_name, dev_name);
|
||||
// First remove subghz device file if it was saved
|
||||
string_printf(temp_str, "%s/%s%s", SUBGHZ_RAW_FOLDER, dev_name, SUBGHZ_APP_EXTENSION);
|
||||
furi_string_printf(temp_str, "%s/%s%s", SUBGHZ_RAW_FOLDER, dev_name, SUBGHZ_APP_EXTENSION);
|
||||
|
||||
if(!storage_simply_remove(instance->storage, string_get_cstr(temp_str))) {
|
||||
if(!storage_simply_remove(instance->storage, furi_string_get_cstr(temp_str))) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Open file
|
||||
if(!flipper_format_file_open_always(instance->flipper_file, string_get_cstr(temp_str))) {
|
||||
if(!flipper_format_file_open_always(
|
||||
instance->flipper_file, furi_string_get_cstr(temp_str))) {
|
||||
FURI_LOG_E(TAG, "Unable to open file for write: %s", temp_str);
|
||||
break;
|
||||
}
|
||||
@@ -130,13 +131,13 @@ bool subghz_protocol_raw_save_to_file_init(
|
||||
break;
|
||||
}
|
||||
|
||||
subghz_block_generic_get_preset_name(string_get_cstr(preset->name), temp_str);
|
||||
subghz_block_generic_get_preset_name(furi_string_get_cstr(preset->name), temp_str);
|
||||
if(!flipper_format_write_string_cstr(
|
||||
instance->flipper_file, "Preset", string_get_cstr(temp_str))) {
|
||||
instance->flipper_file, "Preset", furi_string_get_cstr(temp_str))) {
|
||||
FURI_LOG_E(TAG, "Unable to add Preset");
|
||||
break;
|
||||
}
|
||||
if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) {
|
||||
if(!strcmp(furi_string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) {
|
||||
if(!flipper_format_write_string_cstr(
|
||||
instance->flipper_file, "Custom_preset_module", "CC1101")) {
|
||||
FURI_LOG_E(TAG, "Unable to add Custom_preset_module");
|
||||
@@ -160,7 +161,7 @@ bool subghz_protocol_raw_save_to_file_init(
|
||||
init = true;
|
||||
} while(0);
|
||||
|
||||
string_clear(temp_str);
|
||||
furi_string_free(temp_str);
|
||||
|
||||
return init;
|
||||
}
|
||||
@@ -210,7 +211,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
instance->ind_write = 0;
|
||||
instance->last_level = false;
|
||||
instance->file_is_open = RAWFileIsOpenClose;
|
||||
string_init(instance->file_name);
|
||||
instance->file_name = furi_string_alloc();
|
||||
|
||||
return instance;
|
||||
}
|
||||
@@ -218,7 +219,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
void subghz_protocol_decoder_raw_free(void* context) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderRAW* instance = context;
|
||||
string_clear(instance->file_name);
|
||||
furi_string_free(instance->file_name);
|
||||
free(instance);
|
||||
}
|
||||
|
||||
@@ -255,12 +256,12 @@ bool subghz_protocol_decoder_raw_deserialize(void* context, FlipperFormat* flipp
|
||||
return true;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_raw_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_raw_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
//SubGhzProtocolDecoderRAW* instance = context;
|
||||
UNUSED(context);
|
||||
//ToDo no use
|
||||
string_cat_printf(output, "RAW Date");
|
||||
furi_string_cat_printf(output, "RAW Date");
|
||||
}
|
||||
|
||||
void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
@@ -268,7 +269,7 @@ void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
SubGhzProtocolEncoderRAW* instance = malloc(sizeof(SubGhzProtocolEncoderRAW));
|
||||
|
||||
instance->base.protocol = &subghz_protocol_raw;
|
||||
string_init(instance->file_name);
|
||||
instance->file_name = furi_string_alloc();
|
||||
instance->is_running = false;
|
||||
return instance;
|
||||
}
|
||||
@@ -286,7 +287,7 @@ void subghz_protocol_encoder_raw_free(void* context) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolEncoderRAW* instance = context;
|
||||
subghz_protocol_encoder_raw_stop(instance);
|
||||
string_clear(instance->file_name);
|
||||
furi_string_free(instance->file_name);
|
||||
free(instance);
|
||||
}
|
||||
|
||||
@@ -305,7 +306,7 @@ static bool subghz_protocol_encoder_raw_worker_init(SubGhzProtocolEncoderRAW* in
|
||||
|
||||
instance->file_worker_encoder = subghz_file_encoder_worker_alloc();
|
||||
if(subghz_file_encoder_worker_start(
|
||||
instance->file_worker_encoder, string_get_cstr(instance->file_name))) {
|
||||
instance->file_worker_encoder, furi_string_get_cstr(instance->file_name))) {
|
||||
//the worker needs a file in order to open and read part of the file
|
||||
furi_delay_ms(100);
|
||||
instance->is_running = true;
|
||||
@@ -334,8 +335,8 @@ bool subghz_protocol_encoder_raw_deserialize(void* context, FlipperFormat* flipp
|
||||
furi_assert(context);
|
||||
SubGhzProtocolEncoderRAW* instance = context;
|
||||
bool res = false;
|
||||
string_t temp_str;
|
||||
string_init(temp_str);
|
||||
FuriString* temp_str;
|
||||
temp_str = furi_string_alloc();
|
||||
do {
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
@@ -346,11 +347,11 @@ bool subghz_protocol_encoder_raw_deserialize(void* context, FlipperFormat* flipp
|
||||
FURI_LOG_E(TAG, "Missing File_name");
|
||||
break;
|
||||
}
|
||||
string_set(instance->file_name, temp_str);
|
||||
furi_string_set(instance->file_name, temp_str);
|
||||
|
||||
res = subghz_protocol_encoder_raw_worker_init(instance);
|
||||
} while(false);
|
||||
string_clear(temp_str);
|
||||
furi_string_free(temp_str);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ bool subghz_protocol_decoder_raw_deserialize(void* context, FlipperFormat* flipp
|
||||
* @param context Pointer to a SubGhzProtocolDecoderRAW instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_raw_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_raw_get_string(void* context, FuriString* output);
|
||||
|
||||
/**
|
||||
* Allocate SubGhzProtocolEncoderRAW.
|
||||
|
||||
@@ -263,14 +263,14 @@ bool subghz_protocol_decoder_scher_khan_deserialize(void* context, FlipperFormat
|
||||
return subghz_block_generic_deserialize(&instance->generic, flipper_format);
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_scher_khan_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_scher_khan_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderScherKhan* instance = context;
|
||||
|
||||
subghz_protocol_scher_khan_check_remote_controller(
|
||||
&instance->generic, &instance->protocol_name);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_scher_khan_deserialize(void* context, FlipperFormat
|
||||
* @param context Pointer to a SubGhzProtocolDecoderScherKhan instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_scher_khan_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_scher_khan_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -555,7 +555,7 @@ bool subghz_protocol_secplus_v1_check_fixed(uint32_t fixed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_secplus_v1_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderSecPlus_v1* instance = context;
|
||||
|
||||
@@ -567,7 +567,7 @@ void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t outpu
|
||||
uint8_t id1 = (fixed / 9) % 3;
|
||||
uint16_t pin = 0;
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
@@ -587,9 +587,9 @@ void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t outpu
|
||||
pin = (fixed / 59049) % 19683;
|
||||
|
||||
if(pin <= 9999) {
|
||||
string_cat_printf(output, " pin:%d", pin);
|
||||
furi_string_cat_printf(output, " pin:%d", pin);
|
||||
} else if(10000 <= pin && pin <= 11029) {
|
||||
string_cat_printf(output, " pin:enter");
|
||||
furi_string_cat_printf(output, " pin:enter");
|
||||
}
|
||||
|
||||
int pin_suffix = 0;
|
||||
@@ -597,13 +597,13 @@ void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t outpu
|
||||
pin_suffix = (fixed / 1162261467) % 3;
|
||||
|
||||
if(pin_suffix == 1) {
|
||||
string_cat_printf(output, " #\r\n");
|
||||
furi_string_cat_printf(output, " #\r\n");
|
||||
} else if(pin_suffix == 2) {
|
||||
string_cat_printf(output, " *\r\n");
|
||||
furi_string_cat_printf(output, " *\r\n");
|
||||
} else {
|
||||
string_cat_printf(output, "\r\n");
|
||||
furi_string_cat_printf(output, "\r\n");
|
||||
}
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"Sn:0x%08lX\r\n"
|
||||
"Cnt:0x%03X\r\n"
|
||||
@@ -615,14 +615,14 @@ void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t outpu
|
||||
//id = fixed / 27;
|
||||
instance->generic.serial = fixed / 27;
|
||||
if(instance->generic.btn == 1) {
|
||||
string_cat_printf(output, " Btn:left\r\n");
|
||||
furi_string_cat_printf(output, " Btn:left\r\n");
|
||||
} else if(instance->generic.btn == 0) {
|
||||
string_cat_printf(output, " Btn:middle\r\n");
|
||||
furi_string_cat_printf(output, " Btn:middle\r\n");
|
||||
} else if(instance->generic.btn == 2) {
|
||||
string_cat_printf(output, " Btn:right\r\n");
|
||||
furi_string_cat_printf(output, " Btn:right\r\n");
|
||||
}
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"Sn:0x%08lX\r\n"
|
||||
"Cnt:0x%03X\r\n"
|
||||
|
||||
@@ -110,4 +110,4 @@ bool subghz_protocol_secplus_v1_check_fixed(uint32_t fixed);
|
||||
* @param context Pointer to a SubGhzProtocolDecoderSecPlus_v1 instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_secplus_v1_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -810,12 +810,12 @@ bool subghz_protocol_decoder_secplus_v2_deserialize(void* context, FlipperFormat
|
||||
return res;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_secplus_v2_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_secplus_v2_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderSecPlus_v2* instance = context;
|
||||
subghz_protocol_secplus_v2_remote_controller(&instance->generic, instance->secplus_packet_1);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Pk1:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -122,4 +122,4 @@ bool subghz_protocol_decoder_secplus_v2_deserialize(void* context, FlipperFormat
|
||||
* @param context Pointer to a SubGhzProtocolDecoderSecPlus_v2 instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_secplus_v2_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_secplus_v2_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -426,13 +426,13 @@ bool subghz_protocol_decoder_somfy_keytis_deserialize(void* context, FlipperForm
|
||||
return res;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_somfy_keytis_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_somfy_keytis_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderSomfyKeytis* instance = context;
|
||||
|
||||
subghz_protocol_somfy_keytis_check_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"%lX%08lX%06lX\r\n"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_somfy_keytis_deserialize(void* context, FlipperForm
|
||||
* @param context Pointer to a SubGhzProtocolDecoderSomfyKeytis instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_somfy_keytis_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_somfy_keytis_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -363,13 +363,13 @@ bool subghz_protocol_decoder_somfy_telis_deserialize(void* context, FlipperForma
|
||||
return ret;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_somfy_telis_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_somfy_telis_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderSomfyTelis* instance = context;
|
||||
|
||||
subghz_protocol_somfy_telis_check_remote_controller(&instance->generic);
|
||||
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key:0x%lX%08lX\r\n"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_somfy_telis_deserialize(void* context, FlipperForma
|
||||
* @param context Pointer to a SubGhzProtocolDecoderSomfyTelis instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_somfy_telis_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_somfy_telis_get_string(void* context, FuriString* output);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "keeloq_common.h"
|
||||
|
||||
#include "../subghz_keystore.h"
|
||||
#include <m-string.h>
|
||||
#include <m-array.h>
|
||||
|
||||
#include "../blocks/const.h"
|
||||
@@ -229,7 +228,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
//Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_star_line_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;
|
||||
@@ -240,7 +239,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_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;
|
||||
@@ -248,7 +247,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_star_line_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;
|
||||
}
|
||||
// Check for mirrored man
|
||||
@@ -260,7 +259,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
}
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
|
||||
if(subghz_protocol_star_line_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;
|
||||
}
|
||||
//###########################
|
||||
@@ -270,13 +269,13 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_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;
|
||||
}
|
||||
man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_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;
|
||||
@@ -355,7 +354,7 @@ bool subghz_protocol_decoder_star_line_deserialize(void* context, FlipperFormat*
|
||||
return res;
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_star_line_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_star_line_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderStarLine* instance = context;
|
||||
|
||||
@@ -370,7 +369,7 @@ void subghz_protocol_decoder_star_line_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"
|
||||
|
||||
@@ -70,4 +70,4 @@ bool subghz_protocol_decoder_star_line_deserialize(void* context, FlipperFormat*
|
||||
* @param context Pointer to a SubGhzProtocolDecoderStarLine instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_star_line_get_string(void* context, string_t output);
|
||||
void subghz_protocol_decoder_star_line_get_string(void* context, FuriString* output);
|
||||
|
||||
Reference in New Issue
Block a user