Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "subghz_protocol_came_atomo.h"
|
||||
#include "subghz_protocol_common.h"
|
||||
#include <lib/toolbox/manchester-decoder.h>
|
||||
#include <lib/toolbox/manchester_decoder.h>
|
||||
#include "../subghz_keystore.h"
|
||||
|
||||
#define TAG "SubGhzCameAtomo"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "subghz_protocol_came_twee.h"
|
||||
#include "subghz_protocol_common.h"
|
||||
#include <lib/toolbox/manchester-decoder.h>
|
||||
#include <lib/toolbox/manchester-encoder.h>
|
||||
#include <lib/toolbox/manchester_decoder.h>
|
||||
#include <lib/toolbox/manchester_encoder.h>
|
||||
|
||||
/*
|
||||
* Help
|
||||
|
||||
@@ -179,8 +179,7 @@ bool subghz_protocol_common_to_save_file(SubGhzProtocolCommon* instance, Flipper
|
||||
break;
|
||||
}
|
||||
uint32_t temp = instance->code_last_count_bit;
|
||||
if(!flipper_file_write_uint32(
|
||||
flipper_file, "Bit", &temp, 1)) {
|
||||
if(!flipper_file_write_uint32(flipper_file, "Bit", &temp, 1)) {
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Bit");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <m-string.h>
|
||||
#include <furi-hal.h>
|
||||
#include <furi_hal.h>
|
||||
#include <stdint.h>
|
||||
#include <lib/flipper_file/flipper_file.h>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#define SUBGHZ_RAW_FILE_VERSION 1
|
||||
#define SUBGHZ_RAW_FILE_TYPE "Flipper SubGhz RAW File"
|
||||
|
||||
|
||||
typedef enum {
|
||||
SubGhzProtocolCommonTypeUnknown,
|
||||
SubGhzProtocolCommonTypeStatic,
|
||||
|
||||
@@ -23,7 +23,11 @@ void subghz_protocol_faac_slh_free(SubGhzProtocolFaacSLH* instance);
|
||||
* @param bit - count bit key
|
||||
* @param repeat - repeat send key
|
||||
*/
|
||||
void subghz_protocol_faac_slh_send_key(SubGhzProtocolFaacSLH* instance, uint64_t key, uint8_t bit, uint8_t repeat);
|
||||
void subghz_protocol_faac_slh_send_key(
|
||||
SubGhzProtocolFaacSLH* instance,
|
||||
uint64_t key,
|
||||
uint8_t bit,
|
||||
uint8_t repeat);
|
||||
|
||||
/** Reset internal state
|
||||
* @param instance - SubGhzProtocolFaacSLH instance
|
||||
|
||||
@@ -23,7 +23,11 @@ void subghz_protocol_ido_free(SubGhzProtocolIDo* instance);
|
||||
* @param bit - count bit key
|
||||
* @param repeat - repeat send key
|
||||
*/
|
||||
void subghz_protocol_ido_send_key(SubGhzProtocolIDo* instance, uint64_t key, uint8_t bit, uint8_t repeat);
|
||||
void subghz_protocol_ido_send_key(
|
||||
SubGhzProtocolIDo* instance,
|
||||
uint64_t key,
|
||||
uint8_t bit,
|
||||
uint8_t repeat);
|
||||
|
||||
/** Reset internal state
|
||||
* @param instance - SubGhzProtocolIDo instance
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "subghz_protocol_common.h"
|
||||
#include "file-worker.h"
|
||||
#include "file_worker.h"
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "subghz_protocol_nice_flor_s.h"
|
||||
|
||||
#include <furi.h>
|
||||
#include "file-worker.h"
|
||||
#include "file_worker.h"
|
||||
#include "../subghz_keystore.h"
|
||||
/*
|
||||
* https://phreakerclub.com/1615
|
||||
|
||||
@@ -30,7 +30,11 @@ void subghz_protocol_nice_flor_s_name_file(SubGhzProtocolNiceFlorS* instance, co
|
||||
* @param bit - count bit key
|
||||
* @param repeat - repeat send key
|
||||
*/
|
||||
void subghz_protocol_nice_flor_s_send_key(SubGhzProtocolNiceFlorS* instance, uint64_t key, uint8_t bit, uint8_t repeat);
|
||||
void subghz_protocol_nice_flor_s_send_key(
|
||||
SubGhzProtocolNiceFlorS* instance,
|
||||
uint64_t key,
|
||||
uint8_t bit,
|
||||
uint8_t repeat);
|
||||
|
||||
/** Reset internal state
|
||||
* @param instance - SubGhzProtocolNiceFlorS instance
|
||||
@@ -42,7 +46,10 @@ void subghz_protocol_nice_flor_s_reset(SubGhzProtocolNiceFlorS* instance);
|
||||
* @param instance - SubGhzProtocolNiceFlorS instance
|
||||
* @param data - LevelDuration level_duration
|
||||
*/
|
||||
void subghz_protocol_nice_flor_s_parse(SubGhzProtocolNiceFlorS* instance, bool level, uint32_t duration);
|
||||
void subghz_protocol_nice_flor_s_parse(
|
||||
SubGhzProtocolNiceFlorS* instance,
|
||||
bool level,
|
||||
uint32_t duration);
|
||||
|
||||
/** Outputting information from the parser
|
||||
*
|
||||
|
||||
@@ -23,7 +23,11 @@ void subghz_protocol_scher_khan_free(SubGhzProtocolScherKhan* instance);
|
||||
* @param bit - count bit key
|
||||
* @param repeat - repeat send key
|
||||
*/
|
||||
void subghz_protocol_scher_khan_send_key(SubGhzProtocolScherKhan* instance, uint64_t key, uint8_t bit, uint8_t repeat);
|
||||
void subghz_protocol_scher_khan_send_key(
|
||||
SubGhzProtocolScherKhan* instance,
|
||||
uint64_t key,
|
||||
uint8_t bit,
|
||||
uint8_t repeat);
|
||||
|
||||
/** Reset internal state
|
||||
* @param instance - SubGhzProtocolScherKhan instance
|
||||
@@ -41,7 +45,10 @@ void subghz_protocol_scher_khan_check_remote_controller(SubGhzProtocolScherKhan*
|
||||
* @param instance - SubGhzProtocolScherKhan instance
|
||||
* @param data - LevelDuration level_duration
|
||||
*/
|
||||
void subghz_protocol_scher_khan_parse(SubGhzProtocolScherKhan* instance, bool level, uint32_t duration);
|
||||
void subghz_protocol_scher_khan_parse(
|
||||
SubGhzProtocolScherKhan* instance,
|
||||
bool level,
|
||||
uint32_t duration);
|
||||
|
||||
/** Outputting information from the parser
|
||||
*
|
||||
|
||||
@@ -39,7 +39,11 @@ const char* subghz_protocol_star_line_get_manufacture_name(void* context);
|
||||
* @param bit - count bit key
|
||||
* @param repeat - repeat send key
|
||||
*/
|
||||
void subghz_protocol_star_line_send_key(SubGhzProtocolStarLine* instance, uint64_t key, uint8_t bit, uint8_t repeat);
|
||||
void subghz_protocol_star_line_send_key(
|
||||
SubGhzProtocolStarLine* instance,
|
||||
uint64_t key,
|
||||
uint8_t bit,
|
||||
uint8_t repeat);
|
||||
|
||||
/** Reset internal state
|
||||
* @param instance - SubGhzProtocolStarLine instance
|
||||
@@ -57,7 +61,10 @@ void subghz_protocol_star_line_check_remote_controller(SubGhzProtocolStarLine* i
|
||||
* @param instance - SubGhzProtocolStarLine instance
|
||||
* @param data - LevelDuration level_duration
|
||||
*/
|
||||
void subghz_protocol_star_line_parse(SubGhzProtocolStarLine* instance, bool level, uint32_t duration);
|
||||
void subghz_protocol_star_line_parse(
|
||||
SubGhzProtocolStarLine* instance,
|
||||
bool level,
|
||||
uint32_t duration);
|
||||
|
||||
/** Outputting information from the parser
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi-hal.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
typedef void (*SubGhzFileEncoderWorkerCallbackEnd)(void* context);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "subghz_keystore.h"
|
||||
|
||||
#include <furi.h>
|
||||
#include <furi-hal.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
#include <storage/storage.h>
|
||||
#include <toolbox/hex.h>
|
||||
@@ -143,8 +143,7 @@ static bool subghz_keystore_read_file(SubGhzKeystore* instance, File* file, uint
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
FURI_LOG_E(
|
||||
TAG, "Invalid encrypted data: %s", encrypted_line);
|
||||
FURI_LOG_E(TAG, "Invalid encrypted data: %s", encrypted_line);
|
||||
}
|
||||
} else {
|
||||
subghz_keystore_process_line(instance, encrypted_line);
|
||||
@@ -314,7 +313,7 @@ bool subghz_keystore_save(SubGhzKeystore* instance, const char* file_name, uint8
|
||||
furi_hal_crypto_store_unload_key(SUBGHZ_KEYSTORE_FILE_ENCRYPTION_KEY_SLOT);
|
||||
size_t total_keys = SubGhzKeyArray_size(instance->data);
|
||||
result = encrypted_line_count == total_keys;
|
||||
if (result) {
|
||||
if(result) {
|
||||
FURI_LOG_I(TAG, "Success. Encrypted: %d of %d", encrypted_line_count, total_keys);
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Failure. Encrypted: %d of %d", encrypted_line_count, total_keys);
|
||||
@@ -388,8 +387,7 @@ bool subghz_keystore_raw_encrypted_save(
|
||||
break;
|
||||
}
|
||||
uint32_t encryption = SubGhzKeystoreEncryptionAES256;
|
||||
if(!flipper_file_write_uint32(
|
||||
output_flipper_file, "Encryption", &encryption, 1)) {
|
||||
if(!flipper_file_write_uint32(output_flipper_file, "Encryption", &encryption, 1)) {
|
||||
FURI_LOG_E(TAG, "Unable to add Encryption");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ void subghz_parser_load_came_atomo_file(SubGhzParser* instance, const char* file
|
||||
|
||||
bool subghz_parser_load_keeloq_file(SubGhzParser* instance, const char* file_name) {
|
||||
bool ret = false;
|
||||
if (subghz_keystore_load(instance->keystore, file_name)) {
|
||||
if(subghz_keystore_load(instance->keystore, file_name)) {
|
||||
FURI_LOG_I(SUBGHZ_PARSER_TAG, "Successfully loaded keeloq keys from %s", file_name);
|
||||
ret = true;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi-hal.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
typedef void (*SubGhzTxRxWorkerCallbackHaveRead)(void* context);
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ static int32_t subghz_worker_thread_callback(void* context) {
|
||||
xStreamBufferReceive(instance->stream, &level_duration, sizeof(LevelDuration), 10);
|
||||
if(ret == sizeof(LevelDuration)) {
|
||||
if(level_duration_is_reset(level_duration)) {
|
||||
FURI_LOG_E(TAG, "Overrun buffer");;
|
||||
FURI_LOG_E(TAG, "Overrun buffer");
|
||||
;
|
||||
if(instance->overrun_callback) instance->overrun_callback(instance->context);
|
||||
} else {
|
||||
bool level = level_duration_get_level(level_duration);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi-hal.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
typedef struct SubGhzWorker SubGhzWorker;
|
||||
|
||||
@@ -27,7 +27,9 @@ void subghz_worker_free(SubGhzWorker* instance);
|
||||
* @param instance SubGhzWorker instance
|
||||
* @param callback SubGhzWorkerOverrunCallback callback
|
||||
*/
|
||||
void subghz_worker_set_overrun_callback(SubGhzWorker* instance, SubGhzWorkerOverrunCallback callback);
|
||||
void subghz_worker_set_overrun_callback(
|
||||
SubGhzWorker* instance,
|
||||
SubGhzWorkerOverrunCallback callback);
|
||||
|
||||
/** Pair callback SubGhzWorker
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user