minor changes

This commit is contained in:
DerSkythe 2022-10-10 04:44:23 +04:00
parent 7ded162c94
commit 9c0391a887
3 changed files with 7 additions and 29 deletions

View file

@ -222,6 +222,7 @@ bool subbrute_worker_transmit_current_key(SubBruteWorker* instance, uint64_t ste
instance->step = step; instance->step = step;
bool result; bool result;
instance->protocol_name = subbrute_protocol_file(instance->file);
FlipperFormat* flipper_format = flipper_format_string_alloc(); FlipperFormat* flipper_format = flipper_format_string_alloc();
Stream* stream = flipper_format_get_raw_stream(flipper_format); Stream* stream = flipper_format_get_raw_stream(flipper_format);
@ -255,7 +256,7 @@ bool subbrute_worker_transmit_current_key(SubBruteWorker* instance, uint64_t ste
// } // }
flipper_format_free(flipper_format); flipper_format_free(flipper_format);
// furi_string_free(payload); // furi_string_free(payload);
return result; return result;
} }
@ -296,8 +297,8 @@ void subbrute_worker_subghz_transmit(SubBruteWorker* instance, FlipperFormat* fl
subghz_transmitter_free(instance->transmitter); subghz_transmitter_free(instance->transmitter);
instance->transmitter = NULL; instance->transmitter = NULL;
} }
instance->transmitter = subghz_transmitter_alloc_init( instance->transmitter =
instance->environment, subbrute_protocol_file(instance->file)); subghz_transmitter_alloc_init(instance->environment, instance->protocol_name);
subghz_transmitter_deserialize(instance->transmitter, flipper_format); subghz_transmitter_deserialize(instance->transmitter, flipper_format);
furi_hal_subghz_reset(); furi_hal_subghz_reset();
furi_hal_subghz_load_preset(instance->preset); furi_hal_subghz_load_preset(instance->preset);
@ -349,6 +350,8 @@ int32_t subbrute_worker_thread(void* context) {
SubBruteWorkerState local_state = instance->state = SubBruteWorkerStateTx; SubBruteWorkerState local_state = instance->state = SubBruteWorkerStateTx;
subbrute_worker_send_callback(instance); subbrute_worker_send_callback(instance);
instance->protocol_name = subbrute_protocol_file(instance->file);
FlipperFormat* flipper_format = flipper_format_string_alloc(); FlipperFormat* flipper_format = flipper_format_string_alloc();
Stream* stream = flipper_format_get_raw_stream(flipper_format); Stream* stream = flipper_format_get_raw_stream(flipper_format);

View file

@ -20,6 +20,7 @@ struct SubBruteWorker {
SubGhzProtocolDecoderBase* decoder_result; SubGhzProtocolDecoderBase* decoder_result;
SubGhzEnvironment* environment; SubGhzEnvironment* environment;
SubGhzTransmitter* transmitter; SubGhzTransmitter* transmitter;
const char* protocol_name;
// Initiated values // Initiated values
SubBruteAttacks attack; // Attack state SubBruteAttacks attack; // Attack state

View file

@ -130,32 +130,6 @@ const SubBruteProtocol subbrute_protocol_linear_10bit_310 = {
const SubBruteProtocol subbrute_protocol_load_file = const SubBruteProtocol subbrute_protocol_load_file =
{0, 0, 0, 3, FuriHalSubGhzPresetOok650Async, RAWFileProtocol}; {0, 0, 0, 3, FuriHalSubGhzPresetOok650Async, RAWFileProtocol};
//static const SubBruteProtocol subbrute_protocols[SubBruteAttackTotalCount] = {
// [SubBruteAttackCAME12bit303] =
// {303875000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
// [SubBruteAttackCAME12bit307] =
// {307800000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
// [SubBruteAttackCAME12bit433] =
// {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
// [SubBruteAttackCAME12bit868] =
// {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, CAMEFileProtocol},
// [SubBruteAttackNICE12bit433] =
// {433920000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
// [SubBruteAttackNICE12bit868] =
// {868350000, 12, 0, 3, FuriHalSubGhzPresetOok650Async, NICEFileProtocol},
// [SubBruteAttackChamberlain9bit300] =
// {300000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
// [SubBruteAttackChamberlain9bit315] =
// {315000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
// [SubBruteAttackChamberlain9bit390] =
// {390000000, 9, 0, 3, FuriHalSubGhzPresetOok650Async, ChamberlainFileProtocol},
// [SubBruteAttackLinear10bit300] =
// {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
// [SubBruteAttackLinear10bit310] =
// {300000000, 10, 0, 5, FuriHalSubGhzPresetOok650Async, LinearFileProtocol},
// [SubBruteAttackLoadFile] = {0, 0, 0, 3, FuriHalSubGhzPresetOok650Async, RAWFileProtocol},
//};
static const char* subbrute_protocol_names[] = { static const char* subbrute_protocol_names[] = {
[SubBruteAttackCAME12bit303] = "CAME 12bit 303MHz", [SubBruteAttackCAME12bit303] = "CAME 12bit 303MHz",
[SubBruteAttackCAME12bit307] = "CAME 12bit 307MHz", [SubBruteAttackCAME12bit307] = "CAME 12bit 307MHz",