mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-01-06 21:49:45 +03:00
SubGhz: check load type file
This commit is contained in:
parent
d8631d1489
commit
1387d8d5d6
@ -80,6 +80,13 @@ typedef enum {
|
|||||||
SubGhzViewIdTestPacket,
|
SubGhzViewIdTestPacket,
|
||||||
} SubGhzViewId;
|
} SubGhzViewId;
|
||||||
|
|
||||||
|
/** SubGhz load type file */
|
||||||
|
typedef enum {
|
||||||
|
SubGhzLoadTypeFileNoLoad,
|
||||||
|
SubGhzLoadTypeFileKey,
|
||||||
|
SubGhzLoadTypeFileRaw,
|
||||||
|
} SubGhzLoadTypeFile;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SubGhzViewReceiverModeLive,
|
SubGhzViewReceiverModeLive,
|
||||||
SubGhzViewReceiverModeFile,
|
SubGhzViewReceiverModeFile,
|
||||||
|
@ -4,7 +4,7 @@ void subghz_scene_saved_on_enter(void* context) {
|
|||||||
SubGhz* subghz = context;
|
SubGhz* subghz = context;
|
||||||
|
|
||||||
if(subghz_load_protocol_from_file(subghz)) {
|
if(subghz_load_protocol_from_file(subghz)) {
|
||||||
if((!strcmp(subghz->txrx->decoder_result->protocol->name, "RAW"))) {
|
if((subghz_get_load_type_file(subghz) == SubGhzLoadTypeFileRaw)) {
|
||||||
subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
|
subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
|
||||||
} else {
|
} else {
|
||||||
|
@ -478,7 +478,7 @@ int32_t subghz_app(void* p) {
|
|||||||
if(subghz_key_load(subghz, p, true)) {
|
if(subghz_key_load(subghz, p, true)) {
|
||||||
furi_string_set(subghz->file_path, (const char*)p);
|
furi_string_set(subghz->file_path, (const char*)p);
|
||||||
|
|
||||||
if((!strcmp(subghz->txrx->decoder_result->protocol->name, "RAW"))) {
|
if((subghz_get_load_type_file(subghz) == SubGhzLoadTypeFileRaw)) {
|
||||||
//Load Raw TX
|
//Load Raw TX
|
||||||
subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
|
subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
|
||||||
|
@ -356,8 +356,10 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog) {
|
|||||||
}
|
}
|
||||||
if(!strcmp(furi_string_get_cstr(temp_str), "RAW")) {
|
if(!strcmp(furi_string_get_cstr(temp_str), "RAW")) {
|
||||||
//if RAW
|
//if RAW
|
||||||
|
subghz->txrx->load_type_file = SubGhzLoadTypeFileRaw;
|
||||||
subghz_protocol_raw_gen_fff_data(subghz->txrx->fff_data, file_path);
|
subghz_protocol_raw_gen_fff_data(subghz->txrx->fff_data, file_path);
|
||||||
} else {
|
} else {
|
||||||
|
subghz->txrx->load_type_file = SubGhzLoadTypeFileKey;
|
||||||
stream_copy_full(
|
stream_copy_full(
|
||||||
flipper_format_get_raw_stream(fff_data_file),
|
flipper_format_get_raw_stream(fff_data_file),
|
||||||
flipper_format_get_raw_stream(subghz->txrx->fff_data));
|
flipper_format_get_raw_stream(subghz->txrx->fff_data));
|
||||||
@ -412,6 +414,11 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SubGhzLoadTypeFile subghz_get_load_type_file(SubGhz* subghz) {
|
||||||
|
furi_assert(subghz);
|
||||||
|
return subghz->txrx->load_type_file;
|
||||||
|
}
|
||||||
|
|
||||||
bool subghz_get_next_name_file(SubGhz* subghz, uint8_t max_len) {
|
bool subghz_get_next_name_file(SubGhz* subghz, uint8_t max_len) {
|
||||||
furi_assert(subghz);
|
furi_assert(subghz);
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ struct SubGhzTxRx {
|
|||||||
bool ignore_magellan;
|
bool ignore_magellan;
|
||||||
|
|
||||||
SubGhzRxKeyState rx_key_state;
|
SubGhzRxKeyState rx_key_state;
|
||||||
|
SubGhzLoadTypeFile load_type_file;
|
||||||
|
|
||||||
bool debug_pin_state;
|
bool debug_pin_state;
|
||||||
};
|
};
|
||||||
@ -189,5 +190,7 @@ void subghz_lock(SubGhz* subghz);
|
|||||||
void subghz_unlock(SubGhz* subghz);
|
void subghz_unlock(SubGhz* subghz);
|
||||||
bool subghz_is_locked(SubGhz* subghz);
|
bool subghz_is_locked(SubGhz* subghz);
|
||||||
|
|
||||||
|
SubGhzLoadTypeFile subghz_get_load_type_file(SubGhz* subghz);
|
||||||
|
|
||||||
extern const NotificationSequence subghz_sequence_rx;
|
extern const NotificationSequence subghz_sequence_rx;
|
||||||
extern const NotificationSequence subghz_sequence_rx_locked;
|
extern const NotificationSequence subghz_sequence_rx_locked;
|
||||||
|
Loading…
Reference in New Issue
Block a user