[FL-3375] SubGhz: add CC1101 module external (#2747)
* SubGhz: add CC1101 Ext driver * SubGhz: move TIM2 -> TIM17 use cc1101_ext * FuriHal: SPI move channel DMA 3,4 -> 6.7 * Documentation: fix font * SubGhz: add work with SubGhz devices by link to device * SubGhz: add support switching external/internal cc1101 "subghz chat" * SubGhz: add support switching external/internal cc1101 "subghz tx" and "subghz rx" * SubGhz: add "Radio Settings" scene * SubGhz: add icon * SubGhz: add supported CC1101 external module in SubGhz app * SubGhz: fix check frequency supported radio device * SubGhz: fix clang-formatted * Sughz: move dirver CC1101_Ext to lib , compile cmd ./fbt launch_app APPSRC=radio_device_cc1101_ext * SubGhz: fix CLI * SubGhz: fix PVS * SubGhz: delete comments * SubGhz: fix unit_test * Format sources * Update api symbols and drivers targets * Drivers: find proper place for target option * SubGhz: external device connected method naming * Format sources * SubGhz: fix module selection menu, when external is not connected * SubGhz: fix furi_assert(device); * SubGhz: fix split h and c * SubGhz: furi_hal_subghz remove preset load function by name * SubGhz: deleted comments * Format Sources * SubGhz: add some consts and fix unit tests * Sync API Symbols Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
co-authored by
Aleksandr Kutuzov
parent
6d9de25494
commit
8c93695d01
@@ -40,6 +40,7 @@ struct SubGhzProtocolEncoderRAW {
|
||||
|
||||
bool is_running;
|
||||
FuriString* file_name;
|
||||
FuriString* radio_device_name;
|
||||
SubGhzFileEncoderWorker* file_worker_encoder;
|
||||
};
|
||||
|
||||
@@ -282,6 +283,7 @@ void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
|
||||
instance->base.protocol = &subghz_protocol_raw;
|
||||
instance->file_name = furi_string_alloc();
|
||||
instance->radio_device_name = furi_string_alloc();
|
||||
instance->is_running = false;
|
||||
return instance;
|
||||
}
|
||||
@@ -300,6 +302,7 @@ void subghz_protocol_encoder_raw_free(void* context) {
|
||||
SubGhzProtocolEncoderRAW* instance = context;
|
||||
subghz_protocol_encoder_raw_stop(instance);
|
||||
furi_string_free(instance->file_name);
|
||||
furi_string_free(instance->radio_device_name);
|
||||
free(instance);
|
||||
}
|
||||
|
||||
@@ -318,7 +321,9 @@ 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, furi_string_get_cstr(instance->file_name))) {
|
||||
instance->file_worker_encoder,
|
||||
furi_string_get_cstr(instance->file_name),
|
||||
furi_string_get_cstr(instance->radio_device_name))) {
|
||||
//the worker needs a file in order to open and read part of the file
|
||||
furi_delay_ms(100);
|
||||
instance->is_running = true;
|
||||
@@ -328,7 +333,10 @@ static bool subghz_protocol_encoder_raw_worker_init(SubGhzProtocolEncoderRAW* in
|
||||
return instance->is_running;
|
||||
}
|
||||
|
||||
void subghz_protocol_raw_gen_fff_data(FlipperFormat* flipper_format, const char* file_path) {
|
||||
void subghz_protocol_raw_gen_fff_data(
|
||||
FlipperFormat* flipper_format,
|
||||
const char* file_path,
|
||||
const char* radio_device_name) {
|
||||
do {
|
||||
stream_clean(flipper_format_get_raw_stream(flipper_format));
|
||||
if(!flipper_format_write_string_cstr(flipper_format, "Protocol", "RAW")) {
|
||||
@@ -340,6 +348,12 @@ void subghz_protocol_raw_gen_fff_data(FlipperFormat* flipper_format, const char*
|
||||
FURI_LOG_E(TAG, "Unable to add File_name");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_format_write_string_cstr(
|
||||
flipper_format, "Radio_device_name", radio_device_name)) {
|
||||
FURI_LOG_E(TAG, "Unable to add Radio_device_name");
|
||||
break;
|
||||
}
|
||||
} while(false);
|
||||
}
|
||||
|
||||
@@ -364,6 +378,13 @@ SubGhzProtocolStatus
|
||||
}
|
||||
furi_string_set(instance->file_name, temp_str);
|
||||
|
||||
if(!flipper_format_read_string(flipper_format, "Radio_device_name", temp_str)) {
|
||||
FURI_LOG_E(TAG, "Missing Radio_device_name");
|
||||
res = SubGhzProtocolStatusErrorParserOthers;
|
||||
break;
|
||||
}
|
||||
furi_string_set(instance->radio_device_name, temp_str);
|
||||
|
||||
if(!subghz_protocol_encoder_raw_worker_init(instance)) {
|
||||
res = SubGhzProtocolStatusErrorEncoderGetUpload;
|
||||
break;
|
||||
|
||||
@@ -126,8 +126,12 @@ void subghz_protocol_raw_file_encoder_worker_set_callback_end(
|
||||
* File generation for RAW work.
|
||||
* @param flipper_format Pointer to a FlipperFormat instance
|
||||
* @param file_path File path
|
||||
* @param radio_dev_name Radio device name
|
||||
*/
|
||||
void subghz_protocol_raw_gen_fff_data(FlipperFormat* flipper_format, const char* file_path);
|
||||
void subghz_protocol_raw_gen_fff_data(
|
||||
FlipperFormat* flipper_format,
|
||||
const char* file_path,
|
||||
const char* radio_dev_name);
|
||||
|
||||
/**
|
||||
* Deserialize and generating an upload to send.
|
||||
|
||||
Reference in New Issue
Block a user