RPC: Add Virtual Display & Unify log tags (#814)
* RPC: Update protobuf sources * RPC: Add Virtual Display * Unify log tags * RPC: Virtual Display placeholder * Rpc: clear frame buffer callback before confirm. * Firmware: full assert for hal, move fatfs initialization to furi hal. * FuriHal: VCP optimizations, thread safe console. Rpc: adjust buffer sizes. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include <lib/toolbox/manchester-decoder.h>
|
||||
#include "../subghz_keystore.h"
|
||||
|
||||
#define TAG "SubGhzCameAtomo"
|
||||
|
||||
#define SUBGHZ_NO_CAME_ATOMO_RAINBOW_TABLE 0xFFFFFFFFFFFFFFFF
|
||||
|
||||
struct SubGhzProtocolCameAtomo {
|
||||
@@ -39,7 +41,7 @@ void subghz_protocol_came_atomo_free(SubGhzProtocolCameAtomo* instance) {
|
||||
|
||||
void subghz_protocol_came_atomo_name_file(SubGhzProtocolCameAtomo* instance, const char* name) {
|
||||
instance->rainbow_table_file_name = name;
|
||||
printf("Loading CAME Atomo rainbow table %s\r\n", name);
|
||||
FURI_LOG_I(TAG, "Loading rainbow table from %s", name);
|
||||
}
|
||||
|
||||
/** Read bytes from rainbow table
|
||||
|
@@ -175,12 +175,12 @@ bool subghz_protocol_common_to_save_file(SubGhzProtocolCommon* instance, Flipper
|
||||
bool res = false;
|
||||
do {
|
||||
if(!flipper_file_write_string_cstr(flipper_file, "Protocol", instance->name)) {
|
||||
FURI_LOG_E(SUBGHZ_KEY_TAG, "Unable to add Protocol");
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Protocol");
|
||||
break;
|
||||
}
|
||||
if(!flipper_file_write_uint32(
|
||||
flipper_file, "Bit", (uint32_t*)&instance->code_last_count_bit, 1)) {
|
||||
FURI_LOG_E(SUBGHZ_KEY_TAG, "Unable to add Bit");
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Bit");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ bool subghz_protocol_common_to_save_file(SubGhzProtocolCommon* instance, Flipper
|
||||
}
|
||||
|
||||
if(!flipper_file_write_hex(flipper_file, "Key", key_data, sizeof(uint64_t))) {
|
||||
FURI_LOG_E(SUBGHZ_KEY_TAG, "Unable to add Key");
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Key");
|
||||
break;
|
||||
}
|
||||
res = true;
|
||||
@@ -211,14 +211,14 @@ bool subghz_protocol_common_to_load_protocol_from_file(
|
||||
|
||||
do {
|
||||
if(!flipper_file_read_uint32(flipper_file, "Bit", (uint32_t*)&temp_data, 1)) {
|
||||
FURI_LOG_E(SUBGHZ_KEY_TAG, "Missing Bit");
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Missing Bit");
|
||||
break;
|
||||
}
|
||||
instance->code_last_count_bit = (uint8_t)temp_data;
|
||||
|
||||
uint8_t key_data[sizeof(uint64_t)] = {0};
|
||||
if(!flipper_file_read_hex(flipper_file, "Key", key_data, sizeof(uint64_t))) {
|
||||
FURI_LOG_E(SUBGHZ_KEY_TAG, "Missing Key");
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Missing Key");
|
||||
break;
|
||||
}
|
||||
for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
|
||||
|
@@ -21,11 +21,10 @@
|
||||
#define SUBGHZ_APP_EXTENSION ".sub"
|
||||
#define SUBGHZ_ENCODER_UPLOAD_MAX_SIZE 2048
|
||||
|
||||
#define SUBGHZ_KEY_TAG "SubGhzParser"
|
||||
#define SUBGHZ_PARSER_TAG "SubGhzParser"
|
||||
#define SUBGHZ_KEY_FILE_VERSION 1
|
||||
#define SUBGHZ_KEY_FILE_TYPE "Flipper SubGhz Key File"
|
||||
|
||||
#define SUBGHZ_RAW_TAG "SubGhzRAW"
|
||||
#define SUBGHZ_RAW_FILE_VERSION 1
|
||||
#define SUBGHZ_RAW_FILE_TYPE "Flipper SubGhz RAW File"
|
||||
|
||||
|
@@ -9,6 +9,8 @@
|
||||
* https://vrtp.ru/index.php?showtopic=27867
|
||||
*/
|
||||
|
||||
#define TAG "SubGhzNiceFlorS"
|
||||
|
||||
struct SubGhzProtocolNiceFlorS {
|
||||
SubGhzProtocolCommon common;
|
||||
const char* rainbow_table_file_name;
|
||||
@@ -45,7 +47,7 @@ void subghz_protocol_nice_flor_s_free(SubGhzProtocolNiceFlorS* instance) {
|
||||
|
||||
void subghz_protocol_nice_flor_s_name_file(SubGhzProtocolNiceFlorS* instance, const char* name) {
|
||||
instance->rainbow_table_file_name = name;
|
||||
printf("Loading Nice FloR S rainbow table %s\r\n", name);
|
||||
FURI_LOG_I(TAG, "Loading rainbow table from %s", name);
|
||||
}
|
||||
|
||||
/** Send bit
|
||||
|
@@ -11,6 +11,8 @@
|
||||
#define SUBGHZ_PT_COUNT_KEY 5
|
||||
#define SUBGHZ_PT_TIMEOUT 320
|
||||
|
||||
#define TAG "SubghzPrinceton"
|
||||
|
||||
struct SubGhzEncoderPrinceton {
|
||||
uint32_t key;
|
||||
uint16_t te;
|
||||
@@ -67,7 +69,7 @@ void subghz_encoder_princeton_print_log(void* context) {
|
||||
float duty_cycle =
|
||||
((float)instance->time_high / (instance->time_high + instance->time_low)) * 100;
|
||||
FURI_LOG_I(
|
||||
"EncoderPrinceton",
|
||||
TAG "Encoder",
|
||||
"Radio ON=%dus, OFF=%dus, DutyCycle=%d,%d%%",
|
||||
instance->time_high,
|
||||
instance->time_low,
|
||||
@@ -297,7 +299,7 @@ bool subghz_decoder_princeton_to_save_file(
|
||||
bool res = subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
if(res) {
|
||||
res = flipper_file_write_uint32(flipper_file, "TE", (uint32_t*)&instance->te, 1);
|
||||
if(!res) FURI_LOG_E(SUBGHZ_KEY_TAG, "Unable to add Te");
|
||||
if(!res) FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Te");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -310,7 +312,7 @@ bool subghz_decoder_princeton_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
if(loaded) {
|
||||
loaded = flipper_file_read_uint32(flipper_file, "TE", (uint32_t*)&instance->te, 1);
|
||||
if(!loaded) FURI_LOG_E(SUBGHZ_KEY_TAG, "Missing TE");
|
||||
if(!loaded) FURI_LOG_E(SUBGHZ_PARSER_TAG, "Missing TE");
|
||||
}
|
||||
return loaded;
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "subghz_protocol_raw.h"
|
||||
#include "../subghz_file_encoder_worker.h"
|
||||
|
||||
#define TAG "SubGhzRaw"
|
||||
|
||||
#define SUBGHZ_DOWNLOAD_MAX_SIZE 512
|
||||
|
||||
struct SubGhzProtocolRAW {
|
||||
@@ -165,28 +167,28 @@ bool subghz_protocol_raw_save_to_file_init(
|
||||
|
||||
// Open file
|
||||
if(!flipper_file_open_always(instance->flipper_file, string_get_cstr(dev_file_name))) {
|
||||
FURI_LOG_E(SUBGHZ_RAW_TAG, "Unable to open file for write: %s", dev_file_name);
|
||||
FURI_LOG_E(TAG, "Unable to open file for write: %s", dev_file_name);
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_header_cstr(
|
||||
instance->flipper_file, SUBGHZ_RAW_FILE_TYPE, SUBGHZ_RAW_FILE_VERSION)) {
|
||||
FURI_LOG_E(SUBGHZ_RAW_TAG, "Unable to add header");
|
||||
FURI_LOG_E(TAG, "Unable to add header");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_uint32(instance->flipper_file, "Frequency", (uint32_t*)&frequency, 1)) {
|
||||
FURI_LOG_E(SUBGHZ_RAW_TAG, "Unable to add Frequency");
|
||||
FURI_LOG_E(TAG, "Unable to add Frequency");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_string_cstr(instance->flipper_file, "Preset", preset)) {
|
||||
FURI_LOG_E(SUBGHZ_RAW_TAG, "Unable to add Preset");
|
||||
FURI_LOG_E(TAG, "Unable to add Preset");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_string_cstr(instance->flipper_file, "Protocol", instance->common.name)) {
|
||||
FURI_LOG_E(SUBGHZ_RAW_TAG, "Unable to add Protocol");
|
||||
FURI_LOG_E(TAG, "Unable to add Protocol");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -222,7 +224,7 @@ bool subghz_protocol_raw_save_to_file_write(SubGhzProtocolRAW* instance) {
|
||||
if(instance->file_is_open == RAWFileIsOpenWrite) {
|
||||
if(!flipper_file_write_int32(
|
||||
instance->flipper_file, "RAW_Data", instance->upload_raw, instance->ind_write)) {
|
||||
FURI_LOG_E(SUBGHZ_RAW_TAG, "Unable to add RAW_Data");
|
||||
FURI_LOG_E(TAG, "Unable to add RAW_Data");
|
||||
} else {
|
||||
instance->sample_write += instance->ind_write;
|
||||
instance->ind_write = 0;
|
||||
|
Reference in New Issue
Block a user