mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 12:51:22 +04:00
[FL-3867] Code formatting update (#3765)
* clang-format: AllowShortEnumsOnASingleLine: false * clang-format: InsertNewlineAtEOF: true * clang-format: Standard: c++20 * clang-format: AlignConsecutiveBitFields * clang-format: AlignConsecutiveMacros * clang-format: RemoveParentheses: ReturnStatement * clang-format: RemoveSemicolon: true * Restored RemoveParentheses: Leave, retained general changes for it * formatting: fixed logging TAGs * Formatting update for dev Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -11,9 +11,9 @@ AlignConsecutiveAssignments:
|
|||||||
AlignFunctionPointers: false
|
AlignFunctionPointers: false
|
||||||
PadOperators: true
|
PadOperators: true
|
||||||
AlignConsecutiveBitFields:
|
AlignConsecutiveBitFields:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
AcrossEmptyLines: false
|
AcrossEmptyLines: true
|
||||||
AcrossComments: false
|
AcrossComments: true
|
||||||
AlignCompound: false
|
AlignCompound: false
|
||||||
AlignFunctionPointers: false
|
AlignFunctionPointers: false
|
||||||
PadOperators: true
|
PadOperators: true
|
||||||
@@ -25,10 +25,10 @@ AlignConsecutiveDeclarations:
|
|||||||
AlignFunctionPointers: false
|
AlignFunctionPointers: false
|
||||||
PadOperators: true
|
PadOperators: true
|
||||||
AlignConsecutiveMacros:
|
AlignConsecutiveMacros:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
AcrossEmptyLines: false
|
AcrossEmptyLines: false
|
||||||
AcrossComments: false
|
AcrossComments: true
|
||||||
AlignCompound: false
|
AlignCompound: true
|
||||||
AlignFunctionPointers: false
|
AlignFunctionPointers: false
|
||||||
PadOperators: true
|
PadOperators: true
|
||||||
AlignConsecutiveShortCaseStatements:
|
AlignConsecutiveShortCaseStatements:
|
||||||
@@ -47,7 +47,7 @@ AllowBreakBeforeNoexceptSpecifier: Never
|
|||||||
AllowShortBlocksOnASingleLine: Never
|
AllowShortBlocksOnASingleLine: Never
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
AllowShortCompoundRequirementOnASingleLine: true
|
AllowShortCompoundRequirementOnASingleLine: true
|
||||||
AllowShortEnumsOnASingleLine: true
|
AllowShortEnumsOnASingleLine: false
|
||||||
AllowShortFunctionsOnASingleLine: None
|
AllowShortFunctionsOnASingleLine: None
|
||||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||||
AllowShortLambdasOnASingleLine: All
|
AllowShortLambdasOnASingleLine: All
|
||||||
@@ -108,6 +108,7 @@ ForEachMacros:
|
|||||||
- foreach
|
- foreach
|
||||||
- Q_FOREACH
|
- Q_FOREACH
|
||||||
- BOOST_FOREACH
|
- BOOST_FOREACH
|
||||||
|
- M_EACH
|
||||||
IfMacros:
|
IfMacros:
|
||||||
- KJ_IF_MAYBE
|
- KJ_IF_MAYBE
|
||||||
IncludeBlocks: Preserve
|
IncludeBlocks: Preserve
|
||||||
@@ -136,7 +137,7 @@ IndentRequiresClause: false
|
|||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
IndentWrappedFunctionNames: true
|
IndentWrappedFunctionNames: true
|
||||||
InsertBraces: false
|
InsertBraces: false
|
||||||
InsertNewlineAtEOF: false
|
InsertNewlineAtEOF: true
|
||||||
InsertTrailingCommas: None
|
InsertTrailingCommas: None
|
||||||
IntegerLiteralSeparator:
|
IntegerLiteralSeparator:
|
||||||
Binary: 0
|
Binary: 0
|
||||||
@@ -179,7 +180,7 @@ ReferenceAlignment: Pointer
|
|||||||
ReflowComments: false
|
ReflowComments: false
|
||||||
RemoveBracesLLVM: false
|
RemoveBracesLLVM: false
|
||||||
RemoveParentheses: Leave
|
RemoveParentheses: Leave
|
||||||
RemoveSemicolon: false
|
RemoveSemicolon: true
|
||||||
RequiresClausePosition: OwnLine
|
RequiresClausePosition: OwnLine
|
||||||
RequiresExpressionIndentation: OuterScope
|
RequiresExpressionIndentation: OuterScope
|
||||||
SeparateDefinitionBlocks: Leave
|
SeparateDefinitionBlocks: Leave
|
||||||
@@ -226,7 +227,7 @@ SpacesInParensOptions:
|
|||||||
InEmptyParentheses: false
|
InEmptyParentheses: false
|
||||||
Other: false
|
Other: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: c++03
|
Standard: c++20
|
||||||
StatementAttributeLikeMacros:
|
StatementAttributeLikeMacros:
|
||||||
- Q_EMIT
|
- Q_EMIT
|
||||||
StatementMacros:
|
StatementMacros:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <gui/elements.h>
|
#include <gui/elements.h>
|
||||||
#include <assets_icons.h>
|
#include <assets_icons.h>
|
||||||
|
|
||||||
#define LOW_CHARGE_THRESHOLD 10
|
#define LOW_CHARGE_THRESHOLD 10
|
||||||
#define HIGH_DRAIN_CURRENT_THRESHOLD 100
|
#define HIGH_DRAIN_CURRENT_THRESHOLD 100
|
||||||
|
|
||||||
struct BatteryInfo {
|
struct BatteryInfo {
|
||||||
@@ -17,7 +17,7 @@ static void draw_stat(Canvas* canvas, int x, int y, const Icon* icon, char* val)
|
|||||||
canvas_draw_box(canvas, x - 4, y + 16, 24, 6);
|
canvas_draw_box(canvas, x - 4, y + 16, 24, 6);
|
||||||
canvas_set_color(canvas, ColorBlack);
|
canvas_set_color(canvas, ColorBlack);
|
||||||
canvas_draw_str_aligned(canvas, x + 8, y + 22, AlignCenter, AlignBottom, val);
|
canvas_draw_str_aligned(canvas, x + 8, y + 22, AlignCenter, AlignBottom, val);
|
||||||
};
|
}
|
||||||
|
|
||||||
static void draw_battery(Canvas* canvas, BatteryInfoModel* data, int x, int y) {
|
static void draw_battery(Canvas* canvas, BatteryInfoModel* data, int x, int y) {
|
||||||
char emote[20] = {};
|
char emote[20] = {};
|
||||||
@@ -85,7 +85,7 @@ static void draw_battery(Canvas* canvas, BatteryInfoModel* data, int x, int y) {
|
|||||||
canvas_draw_str_aligned(canvas, 92, y + 3, AlignCenter, AlignCenter, emote);
|
canvas_draw_str_aligned(canvas, 92, y + 3, AlignCenter, AlignCenter, emote);
|
||||||
canvas_draw_str_aligned(canvas, 92, y + 15, AlignCenter, AlignCenter, header);
|
canvas_draw_str_aligned(canvas, 92, y + 15, AlignCenter, AlignCenter, header);
|
||||||
canvas_draw_str_aligned(canvas, 92, y + 27, AlignCenter, AlignCenter, value);
|
canvas_draw_str_aligned(canvas, 92, y + 27, AlignCenter, AlignCenter, value);
|
||||||
};
|
}
|
||||||
|
|
||||||
static void battery_info_draw_callback(Canvas* canvas, void* context) {
|
static void battery_info_draw_callback(Canvas* canvas, void* context) {
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ typedef struct {
|
|||||||
} BtTestModel;
|
} BtTestModel;
|
||||||
|
|
||||||
#define BT_TEST_START_MESSAGE "Ok - Start"
|
#define BT_TEST_START_MESSAGE "Ok - Start"
|
||||||
#define BT_TEST_STOP_MESSAGE "Ok - Stop"
|
#define BT_TEST_STOP_MESSAGE "Ok - Stop"
|
||||||
|
|
||||||
static void bt_test_process_up(BtTest* bt_test);
|
static void bt_test_process_up(BtTest* bt_test);
|
||||||
static void bt_test_process_down(BtTest* bt_test);
|
static void bt_test_process_down(BtTest* bt_test);
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ void iso7816_xfr_datablock_callback(
|
|||||||
const uint8_t* dataBlock,
|
const uint8_t* dataBlock,
|
||||||
uint32_t dataBlockLen,
|
uint32_t dataBlockLen,
|
||||||
uint8_t* responseDataBlock,
|
uint8_t* responseDataBlock,
|
||||||
uint32_t* responseDataBlockLen);
|
uint32_t* responseDataBlockLen);
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
void iso7816_set_response(ISO7816_Response_APDU* responseAPDU, uint16_t responseCode) {
|
void iso7816_set_response(ISO7816_Response_APDU* responseAPDU, uint16_t responseCode) {
|
||||||
responseAPDU->SW1 = (responseCode >> (8 * 1)) & 0xff;
|
responseAPDU->SW1 = (responseCode >> (8 * 1)) & 0xff;
|
||||||
responseAPDU->SW2 = (responseCode >> (8 * 0)) & 0xff;
|
responseAPDU->SW2 = (responseCode >> (8 * 0)) & 0xff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
#define ISO7816_RESPONSE_OK 0x9000
|
#define ISO7816_RESPONSE_OK 0x9000
|
||||||
|
|
||||||
#define ISO7816_RESPONSE_WRONG_LENGTH 0x6700
|
#define ISO7816_RESPONSE_WRONG_LENGTH 0x6700
|
||||||
#define ISO7816_RESPONSE_WRONG_PARAMETERS_P1_P2 0x6A00
|
#define ISO7816_RESPONSE_WRONG_PARAMETERS_P1_P2 0x6A00
|
||||||
#define ISO7816_RESPONSE_WRONG_LE 0x6C00
|
#define ISO7816_RESPONSE_WRONG_LE 0x6C00
|
||||||
#define ISO7816_RESPONSE_INSTRUCTION_NOT_SUPPORTED 0x6D00
|
#define ISO7816_RESPONSE_INSTRUCTION_NOT_SUPPORTED 0x6D00
|
||||||
#define ISO7816_RESPONSE_CLASS_NOT_SUPPORTED 0x6E00
|
#define ISO7816_RESPONSE_CLASS_NOT_SUPPORTED 0x6E00
|
||||||
#define ISO7816_RESPONSE_INTERNAL_EXCEPTION 0x6F00
|
#define ISO7816_RESPONSE_INTERNAL_EXCEPTION 0x6F00
|
||||||
|
|
||||||
void iso7816_set_response(ISO7816_Response_APDU* responseAPDU, uint16_t responseCode);
|
void iso7816_set_response(ISO7816_Response_APDU* responseAPDU, uint16_t responseCode);
|
||||||
|
|||||||
@@ -81,4 +81,4 @@ void iso7816_write_response_apdu(
|
|||||||
responseDataBufferIndex++;
|
responseDataBufferIndex++;
|
||||||
|
|
||||||
*readerToPcDataBlockLen = responseDataBufferIndex;
|
*readerToPcDataBlockLen = responseDataBufferIndex;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
#include "iso7816_atr.h"
|
#include "iso7816_atr.h"
|
||||||
#include "core/common_defines.h"
|
#include "core/common_defines.h"
|
||||||
|
|
||||||
#define ISO7816_READ_COMMAND_APDU_OK 0
|
#define ISO7816_READ_COMMAND_APDU_OK 0
|
||||||
#define ISO7816_READ_COMMAND_APDU_ERROR_WRONG_LE 1
|
#define ISO7816_READ_COMMAND_APDU_ERROR_WRONG_LE 1
|
||||||
#define ISO7816_READ_COMMAND_APDU_ERROR_WRONG_LENGTH 2
|
#define ISO7816_READ_COMMAND_APDU_ERROR_WRONG_LENGTH 2
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -40,11 +40,11 @@
|
|||||||
|
|
||||||
#define TAG "ExpansionTest"
|
#define TAG "ExpansionTest"
|
||||||
|
|
||||||
#define TEST_DIR_PATH EXT_PATH(TAG)
|
#define TEST_DIR_PATH EXT_PATH(TAG)
|
||||||
#define TEST_FILE_NAME "test.txt"
|
#define TEST_FILE_NAME "test.txt"
|
||||||
#define TEST_FILE_PATH EXT_PATH(TAG "/" TEST_FILE_NAME)
|
#define TEST_FILE_PATH EXT_PATH(TAG "/" TEST_FILE_NAME)
|
||||||
|
|
||||||
#define HOST_SERIAL_ID (FuriHalSerialIdLpuart)
|
#define HOST_SERIAL_ID (FuriHalSerialIdLpuart)
|
||||||
#define MODULE_SERIAL_ID (FuriHalSerialIdUsart)
|
#define MODULE_SERIAL_ID (FuriHalSerialIdUsart)
|
||||||
|
|
||||||
#define RECEIVE_BUFFER_SIZE (sizeof(ExpansionFrame) + sizeof(ExpansionFrameChecksum))
|
#define RECEIVE_BUFFER_SIZE (sizeof(ExpansionFrame) + sizeof(ExpansionFrameChecksum))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
|
|
||||||
#define DEFAULT_PATH "/"
|
#define DEFAULT_PATH "/"
|
||||||
#define EXTENSION "*"
|
#define EXTENSION "*"
|
||||||
|
|
||||||
bool file_browser_scene_browser_on_event(void* context, SceneManagerEvent event) {
|
bool file_browser_scene_browser_on_event(void* context, SceneManagerEvent event) {
|
||||||
UNUSED(context);
|
UNUSED(context);
|
||||||
|
|||||||
@@ -78,4 +78,4 @@ int32_t lfrfid_debug_app(void* p) {
|
|||||||
lfrfid_debug_free(app);
|
lfrfid_debug_free(app);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <toolbox/args.h>
|
#include <toolbox/args.h>
|
||||||
|
|
||||||
#define TAG "SpeakerDebug"
|
#define TAG "SpeakerDebug"
|
||||||
|
|
||||||
#define CLI_COMMAND "speaker_debug"
|
#define CLI_COMMAND "speaker_debug"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
|
|
||||||
#define SUBGHZ_TEST_VERSION_APP "0.1"
|
#define SUBGHZ_TEST_VERSION_APP "0.1"
|
||||||
#define SUBGHZ_TEST_DEVELOPED "SkorP"
|
#define SUBGHZ_TEST_DEVELOPED "SkorP"
|
||||||
#define SUBGHZ_TEST_GITHUB "https://github.com/flipperdevices/flipperzero-firmware"
|
#define SUBGHZ_TEST_GITHUB "https://github.com/flipperdevices/flipperzero-firmware"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SubGhzTestViewVariableItemList,
|
SubGhzTestViewVariableItemList,
|
||||||
|
|||||||
@@ -241,4 +241,4 @@ uint8_t subghz_protocol_blocks_xor_bytes(uint8_t const message[], size_t size) {
|
|||||||
result ^= message[i];
|
result ^= message[i];
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
(value) &= ~(_one << (bit)); \
|
(value) &= ~(_one << (bit)); \
|
||||||
})
|
})
|
||||||
#define bit_write(value, bit, bitvalue) (bitvalue ? bit_set(value, bit) : bit_clear(value, bit))
|
#define bit_write(value, bit, bitvalue) (bitvalue ? bit_set(value, bit) : bit_clear(value, bit))
|
||||||
#define DURATION_DIFF(x, y) (((x) < (y)) ? ((y) - (x)) : ((x) - (y)))
|
#define DURATION_DIFF(x, y) (((x) < (y)) ? ((y) - (x)) : ((x) - (y)))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SUBGHZ_PT_SHORT 300
|
#define SUBGHZ_PT_SHORT 300
|
||||||
#define SUBGHZ_PT_LONG (SUBGHZ_PT_SHORT * 3)
|
#define SUBGHZ_PT_LONG (SUBGHZ_PT_SHORT * 3)
|
||||||
#define SUBGHZ_PT_GUARD (SUBGHZ_PT_SHORT * 30)
|
#define SUBGHZ_PT_GUARD (SUBGHZ_PT_SHORT * 30)
|
||||||
#define SUBGHZ_PT_COUNT_KEY_433 9
|
#define SUBGHZ_PT_COUNT_KEY_433 9
|
||||||
#define SUBGHZ_PT_TIMEOUT_433 900
|
#define SUBGHZ_PT_TIMEOUT_433 900
|
||||||
#define SUBGHZ_PT_COUNT_KEY_868 9
|
#define SUBGHZ_PT_COUNT_KEY_868 9
|
||||||
#define SUBGHZ_PT_TIMEOUT_868 14000
|
#define SUBGHZ_PT_TIMEOUT_868 14000
|
||||||
|
|
||||||
#define TAG "SubGhzProtocolPrinceton"
|
#define TAG "SubGhzProtocolPrinceton"
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,10 @@
|
|||||||
#include <notification/notification.h>
|
#include <notification/notification.h>
|
||||||
#include <notification/notification_messages.h>
|
#include <notification/notification_messages.h>
|
||||||
|
|
||||||
#define LINES_ON_SCREEN 6
|
|
||||||
#define COLUMNS_ON_SCREEN 21
|
|
||||||
#define TAG "UartEcho"
|
#define TAG "UartEcho"
|
||||||
|
|
||||||
|
#define LINES_ON_SCREEN 6
|
||||||
|
#define COLUMNS_ON_SCREEN 21
|
||||||
#define DEFAULT_BAUD_RATE 230400
|
#define DEFAULT_BAUD_RATE 230400
|
||||||
|
|
||||||
typedef struct UartDumpModel UartDumpModel;
|
typedef struct UartDumpModel UartDumpModel;
|
||||||
@@ -147,7 +148,7 @@ static void uart_echo_push_to_list(UartDumpModel* model, const char data) {
|
|||||||
bool new_string_needed = false;
|
bool new_string_needed = false;
|
||||||
if(furi_string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
|
if(furi_string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
|
||||||
new_string_needed = true;
|
new_string_needed = true;
|
||||||
} else if((data == '\n' || data == '\r')) {
|
} else if(data == '\n' || data == '\r') {
|
||||||
// pack line breaks
|
// pack line breaks
|
||||||
if(model->last_char != '\n' && model->last_char != '\r') {
|
if(model->last_char != '\n' && model->last_char != '\r') {
|
||||||
new_string_needed = true;
|
new_string_needed = true;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void test_runner_free(TestRunner* instance) {
|
|||||||
free(instance);
|
free(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TEST_RUNNER_TMP_DIR EXT_PATH(".tmp")
|
#define TEST_RUNNER_TMP_DIR EXT_PATH(".tmp")
|
||||||
#define TEST_RUNNER_TMP_UNIT_TESTS_DIR TEST_RUNNER_TMP_DIR "/unit_tests"
|
#define TEST_RUNNER_TMP_UNIT_TESTS_DIR TEST_RUNNER_TMP_DIR "/unit_tests"
|
||||||
|
|
||||||
static bool test_runner_run_plugin(TestRunner* instance, const char* path) {
|
static bool test_runner_run_plugin(TestRunner* instance, const char* path) {
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ TestRunner* test_runner_alloc(Cli* cli, FuriString* args);
|
|||||||
|
|
||||||
void test_runner_free(TestRunner* isntance);
|
void test_runner_free(TestRunner* isntance);
|
||||||
|
|
||||||
void test_runner_run(TestRunner* isntance);
|
void test_runner_run(TestRunner* isntance);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
|
|
||||||
#define BT_TEST_KEY_STORAGE_FILE_PATH EXT_PATH("unit_tests/bt_test.keys")
|
#define BT_TEST_KEY_STORAGE_FILE_PATH EXT_PATH("unit_tests/bt_test.keys")
|
||||||
#define BT_TEST_NVM_RAM_BUFF_SIZE (507 * 4) // The same as in ble NVM storage
|
#define BT_TEST_NVM_RAM_BUFF_SIZE (507 * 4) // The same as in ble NVM storage
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Storage* storage;
|
Storage* storage;
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ It was compressed with heatshrink using the following command:
|
|||||||
`python3 -m heatshrink2 compress -w 9 -l 4 hsstream.out.bin hsstream.in.bin`
|
`python3 -m heatshrink2 compress -w 9 -l 4 hsstream.out.bin hsstream.in.bin`
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define HSSTREAM_IN COMPRESS_UNIT_TESTS_PATH("hsstream.in.bin")
|
#define HSSTREAM_IN COMPRESS_UNIT_TESTS_PATH("hsstream.in.bin")
|
||||||
#define HSSTREAM_OUT COMPRESS_UNIT_TESTS_PATH("hsstream.out.bin")
|
#define HSSTREAM_OUT COMPRESS_UNIT_TESTS_PATH("hsstream.out.bin")
|
||||||
|
|
||||||
static void compress_test_heatshrink_stream() {
|
static void compress_test_heatshrink_stream() {
|
||||||
@@ -239,7 +239,7 @@ static void compress_test_heatshrink_stream() {
|
|||||||
furi_record_close(RECORD_STORAGE);
|
furi_record_close(RECORD_STORAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HS_TAR_PATH COMPRESS_UNIT_TESTS_PATH("test.ths")
|
#define HS_TAR_PATH COMPRESS_UNIT_TESTS_PATH("test.ths")
|
||||||
#define HS_TAR_EXTRACT_PATH COMPRESS_UNIT_TESTS_PATH("tar_out")
|
#define HS_TAR_EXTRACT_PATH COMPRESS_UNIT_TESTS_PATH("tar_out")
|
||||||
|
|
||||||
static bool file_counter(const char* name, bool is_dir, void* context) {
|
static bool file_counter(const char* name, bool is_dir, void* context) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#include <expansion/expansion_protocol.h>
|
#include <expansion/expansion_protocol.h>
|
||||||
|
|
||||||
#define EXPANSION_TEST_GARBAGE_MAGIC (0xB19AF)
|
#define EXPANSION_TEST_GARBAGE_MAGIC (0xB19AF)
|
||||||
#define EXPANSION_TEST_GARBAGE_BUF_SIZE (0x100U)
|
#define EXPANSION_TEST_GARBAGE_BUF_SIZE (0x100U)
|
||||||
#define EXPANSION_TEST_GARBAGE_ITERATIONS (100U)
|
#define EXPANSION_TEST_GARBAGE_ITERATIONS (100U)
|
||||||
|
|
||||||
MU_TEST(test_expansion_encoded_size) {
|
MU_TEST(test_expansion_encoded_size) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "../test.h" // IWYU pragma: keep
|
#include "../test.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#define TEST_DIR_NAME EXT_PATH(".tmp/unit_tests/ff")
|
#define TEST_DIR_NAME EXT_PATH(".tmp/unit_tests/ff")
|
||||||
#define TEST_DIR TEST_DIR_NAME "/"
|
#define TEST_DIR TEST_DIR_NAME "/"
|
||||||
|
|
||||||
static const char* test_filetype = "Flipper File test";
|
static const char* test_filetype = "Flipper File test";
|
||||||
static const uint32_t test_version = 666;
|
static const uint32_t test_version = 666;
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
#include <lp5562_reg.h>
|
#include <lp5562_reg.h>
|
||||||
#include "../test.h" // IWYU pragma: keep
|
#include "../test.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#define DATA_SIZE 4
|
#define DATA_SIZE 4
|
||||||
#define EEPROM_ADDRESS 0b10101000
|
#define EEPROM_ADDRESS 0b10101000
|
||||||
#define EEPROM_ADDRESS_HIGH (EEPROM_ADDRESS | 0b10)
|
#define EEPROM_ADDRESS_HIGH (EEPROM_ADDRESS | 0b10)
|
||||||
#define EEPROM_SIZE 512
|
#define EEPROM_SIZE 512
|
||||||
#define EEPROM_PAGE_SIZE 16
|
#define EEPROM_PAGE_SIZE 16
|
||||||
#define EEPROM_WRITE_DELAY_MS 6
|
#define EEPROM_WRITE_DELAY_MS 6
|
||||||
|
|
||||||
static void furi_hal_i2c_int_setup(void) {
|
static void furi_hal_i2c_int_setup(void) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <common/infrared_common_i.h>
|
#include <common/infrared_common_i.h>
|
||||||
#include "../test.h" // IWYU pragma: keep
|
#include "../test.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#define IR_TEST_FILES_DIR EXT_PATH("unit_tests/infrared/")
|
#define IR_TEST_FILES_DIR EXT_PATH("unit_tests/infrared/")
|
||||||
#define IR_TEST_FILE_PREFIX "test_"
|
#define IR_TEST_FILE_PREFIX "test_"
|
||||||
#define IR_TEST_FILE_SUFFIX ".irtest"
|
#define IR_TEST_FILE_SUFFIX ".irtest"
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
#define LF_RFID_READ_TIMING_MULTIPLIER 8
|
#define LF_RFID_READ_TIMING_MULTIPLIER 8
|
||||||
|
|
||||||
#define EM_TEST_DATA {0x58, 0x00, 0x85, 0x64, 0x02}
|
#define EM_TEST_DATA {0x58, 0x00, 0x85, 0x64, 0x02}
|
||||||
#define EM_TEST_DATA_SIZE 5
|
#define EM_TEST_DATA_SIZE 5
|
||||||
#define EM_TEST_EMULATION_TIMINGS_COUNT (64 * 2)
|
#define EM_TEST_EMULATION_TIMINGS_COUNT (64 * 2)
|
||||||
|
|
||||||
const int8_t em_test_timings[EM_TEST_EMULATION_TIMINGS_COUNT] = {
|
const int8_t em_test_timings[EM_TEST_EMULATION_TIMINGS_COUNT] = {
|
||||||
@@ -20,8 +20,8 @@ const int8_t em_test_timings[EM_TEST_EMULATION_TIMINGS_COUNT] = {
|
|||||||
-32, 32, 32, -32, -32, 32, -32, 32, -32, 32, -32, 32, -32, 32,
|
-32, 32, 32, -32, -32, 32, -32, 32, -32, 32, -32, 32, -32, 32,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HID10301_TEST_DATA {0x8D, 0x48, 0xA8}
|
#define HID10301_TEST_DATA {0x8D, 0x48, 0xA8}
|
||||||
#define HID10301_TEST_DATA_SIZE 3
|
#define HID10301_TEST_DATA_SIZE 3
|
||||||
#define HID10301_TEST_EMULATION_TIMINGS_COUNT (541 * 2)
|
#define HID10301_TEST_EMULATION_TIMINGS_COUNT (541 * 2)
|
||||||
|
|
||||||
const int8_t hid10301_test_timings[HID10301_TEST_EMULATION_TIMINGS_COUNT] = {
|
const int8_t hid10301_test_timings[HID10301_TEST_EMULATION_TIMINGS_COUNT] = {
|
||||||
@@ -69,8 +69,8 @@ const int8_t hid10301_test_timings[HID10301_TEST_EMULATION_TIMINGS_COUNT] = {
|
|||||||
5, -5, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4,
|
5, -5, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IOPROX_XSF_TEST_DATA {0x65, 0x01, 0x05, 0x39}
|
#define IOPROX_XSF_TEST_DATA {0x65, 0x01, 0x05, 0x39}
|
||||||
#define IOPROX_XSF_TEST_DATA_SIZE 4
|
#define IOPROX_XSF_TEST_DATA_SIZE 4
|
||||||
#define IOPROX_XSF_TEST_EMULATION_TIMINGS_COUNT (468 * 2)
|
#define IOPROX_XSF_TEST_EMULATION_TIMINGS_COUNT (468 * 2)
|
||||||
|
|
||||||
const int8_t ioprox_xsf_test_timings[IOPROX_XSF_TEST_EMULATION_TIMINGS_COUNT] = {
|
const int8_t ioprox_xsf_test_timings[IOPROX_XSF_TEST_EMULATION_TIMINGS_COUNT] = {
|
||||||
@@ -113,8 +113,8 @@ const int8_t ioprox_xsf_test_timings[IOPROX_XSF_TEST_EMULATION_TIMINGS_COUNT] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define INDALA26_EMULATION_TIMINGS_COUNT (1024 * 2)
|
#define INDALA26_EMULATION_TIMINGS_COUNT (1024 * 2)
|
||||||
#define INDALA26_TEST_DATA {0x3B, 0x73, 0x64, 0xA8}
|
#define INDALA26_TEST_DATA {0x3B, 0x73, 0x64, 0xA8}
|
||||||
#define INDALA26_TEST_DATA_SIZE 4
|
#define INDALA26_TEST_DATA_SIZE 4
|
||||||
|
|
||||||
const int8_t indala26_test_timings[INDALA26_EMULATION_TIMINGS_COUNT] = {
|
const int8_t indala26_test_timings[INDALA26_EMULATION_TIMINGS_COUNT] = {
|
||||||
1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1,
|
1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1,
|
||||||
@@ -205,8 +205,8 @@ const int8_t indala26_test_timings[INDALA26_EMULATION_TIMINGS_COUNT] = {
|
|||||||
-1, 1, -1, 1, -1, 1, -1, 1,
|
-1, 1, -1, 1, -1, 1, -1, 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define FDXB_TEST_DATA {0x44, 0x88, 0x23, 0xF2, 0x5A, 0x6F, 0x00, 0x01, 0x00, 0x00, 0x00}
|
#define FDXB_TEST_DATA {0x44, 0x88, 0x23, 0xF2, 0x5A, 0x6F, 0x00, 0x01, 0x00, 0x00, 0x00}
|
||||||
#define FDXB_TEST_DATA_SIZE 11
|
#define FDXB_TEST_DATA_SIZE 11
|
||||||
#define FDXB_TEST_EMULATION_TIMINGS_COUNT (206)
|
#define FDXB_TEST_EMULATION_TIMINGS_COUNT (206)
|
||||||
|
|
||||||
const int8_t fdxb_test_timings[FDXB_TEST_EMULATION_TIMINGS_COUNT] = {
|
const int8_t fdxb_test_timings[FDXB_TEST_EMULATION_TIMINGS_COUNT] = {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ extern "C" {
|
|||||||
/* Maximum length of last message */
|
/* Maximum length of last message */
|
||||||
#define MINUNIT_MESSAGE_LEN 1024
|
#define MINUNIT_MESSAGE_LEN 1024
|
||||||
/* Accuracy with which floats are compared */
|
/* Accuracy with which floats are compared */
|
||||||
#define MINUNIT_EPSILON 1E-12
|
#define MINUNIT_EPSILON 1E-12
|
||||||
|
|
||||||
#include "minunit_vars_ex.h"
|
#include "minunit_vars_ex.h"
|
||||||
|
|
||||||
@@ -84,9 +84,9 @@ void minunit_print_fail(const char* error);
|
|||||||
void minunit_printf_warning(const char* format, ...);
|
void minunit_printf_warning(const char* format, ...);
|
||||||
|
|
||||||
/* Definitions */
|
/* Definitions */
|
||||||
#define MU_TEST(method_name) static void method_name(void)
|
#define MU_TEST(method_name) static void method_name(void)
|
||||||
#define MU_TEST_1(method_name, arg_1) static void method_name(arg_1)
|
#define MU_TEST_1(method_name, arg_1) static void method_name(arg_1)
|
||||||
#define MU_TEST_SUITE(suite_name) static void suite_name(void)
|
#define MU_TEST_SUITE(suite_name) static void suite_name(void)
|
||||||
|
|
||||||
#define MU__SAFE_BLOCK(block) \
|
#define MU__SAFE_BLOCK(block) \
|
||||||
do { \
|
do { \
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define TAG "NfcTest"
|
#define TAG "NfcTest"
|
||||||
|
|
||||||
#define NFC_TEST_NFC_DEV_PATH EXT_PATH("unit_tests/nfc/nfc_device_test.nfc")
|
#define NFC_TEST_NFC_DEV_PATH EXT_PATH("unit_tests/nfc/nfc_device_test.nfc")
|
||||||
#define NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH EXT_PATH("unit_tests/mf_dict.nfc")
|
#define NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH EXT_PATH("unit_tests/mf_dict.nfc")
|
||||||
|
|
||||||
#define NFC_TEST_FLAG_WORKER_DONE (1)
|
#define NFC_TEST_FLAG_WORKER_DONE (1)
|
||||||
|
|||||||
@@ -43,14 +43,15 @@ typedef struct {
|
|||||||
static RpcSessionContext rpc_session[TEST_RPC_SESSIONS];
|
static RpcSessionContext rpc_session[TEST_RPC_SESSIONS];
|
||||||
|
|
||||||
#define TAG "UnitTestsRpc"
|
#define TAG "UnitTestsRpc"
|
||||||
#define MAX_RECEIVE_OUTPUT_TIMEOUT 3000
|
|
||||||
#define MAX_NAME_LENGTH 255
|
|
||||||
#define MAX_DATA_SIZE 512u // have to be exact as in rpc_storage.c
|
|
||||||
#define TEST_DIR_NAME EXT_PATH(".tmp/unit_tests/rpc")
|
|
||||||
#define TEST_DIR TEST_DIR_NAME "/"
|
|
||||||
#define MD5SUM_SIZE 16
|
|
||||||
|
|
||||||
#define PING_REQUEST 0
|
#define MAX_RECEIVE_OUTPUT_TIMEOUT 3000
|
||||||
|
#define MAX_NAME_LENGTH 255
|
||||||
|
#define MAX_DATA_SIZE 512u // have to be exact as in rpc_storage.c
|
||||||
|
#define TEST_DIR_NAME EXT_PATH(".tmp/unit_tests/rpc")
|
||||||
|
#define TEST_DIR TEST_DIR_NAME "/"
|
||||||
|
#define MD5SUM_SIZE 16
|
||||||
|
|
||||||
|
#define PING_REQUEST 0
|
||||||
#define PING_RESPONSE 1
|
#define PING_RESPONSE 1
|
||||||
#define WRITE_REQUEST 0
|
#define WRITE_REQUEST 0
|
||||||
#define READ_RESPONSE 1
|
#define READ_RESPONSE 1
|
||||||
@@ -554,7 +555,7 @@ static bool test_rpc_pb_stream_read(pb_istream_t* istream, pb_byte_t* buf, size_
|
|||||||
time_left = MAX(time_left, 0);
|
time_left = MAX(time_left, 0);
|
||||||
bytes_received =
|
bytes_received =
|
||||||
furi_stream_buffer_receive(session_context->output_stream, buf, count, time_left);
|
furi_stream_buffer_receive(session_context->output_stream, buf, count, time_left);
|
||||||
return (count == bytes_received);
|
return count == bytes_received;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -971,7 +972,7 @@ MU_TEST(test_storage_info) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define TEST_DIR_STAT_NAME TEST_DIR "stat_dir"
|
#define TEST_DIR_STAT_NAME TEST_DIR "stat_dir"
|
||||||
#define TEST_DIR_STAT TEST_DIR_STAT_NAME "/"
|
#define TEST_DIR_STAT TEST_DIR_STAT_NAME "/"
|
||||||
MU_TEST(test_storage_stat) {
|
MU_TEST(test_storage_stat) {
|
||||||
test_create_dir(TEST_DIR_STAT_NAME);
|
test_create_dir(TEST_DIR_STAT_NAME);
|
||||||
test_create_file(TEST_DIR_STAT "empty.txt", 0);
|
test_create_file(TEST_DIR_STAT "empty.txt", 0);
|
||||||
@@ -1212,7 +1213,7 @@ static void test_storage_delete_run(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define TEST_DIR_RMRF_NAME TEST_DIR "rmrf_test"
|
#define TEST_DIR_RMRF_NAME TEST_DIR "rmrf_test"
|
||||||
#define TEST_DIR_RMRF TEST_DIR_RMRF_NAME "/"
|
#define TEST_DIR_RMRF TEST_DIR_RMRF_NAME "/"
|
||||||
MU_TEST(test_storage_delete_recursive) {
|
MU_TEST(test_storage_delete_recursive) {
|
||||||
test_create_dir(TEST_DIR_RMRF_NAME);
|
test_create_dir(TEST_DIR_RMRF_NAME);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define UNIT_TESTS_PATH(path) EXT_PATH("unit_tests/" path)
|
#define UNIT_TESTS_PATH(path) EXT_PATH("unit_tests/" path)
|
||||||
|
|
||||||
#define STORAGE_LOCKED_FILE EXT_PATH("locked_file.test")
|
#define STORAGE_LOCKED_FILE EXT_PATH("locked_file.test")
|
||||||
#define STORAGE_LOCKED_DIR STORAGE_INT_PATH_PREFIX
|
#define STORAGE_LOCKED_DIR STORAGE_INT_PATH_PREFIX
|
||||||
|
|
||||||
#define STORAGE_TEST_DIR UNIT_TESTS_PATH("test_dir")
|
#define STORAGE_TEST_DIR UNIT_TESTS_PATH("test_dir")
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,14 @@
|
|||||||
#include <lib/subghz/devices/cc1101_configs.h>
|
#include <lib/subghz/devices/cc1101_configs.h>
|
||||||
|
|
||||||
#define TAG "SubGhzTest"
|
#define TAG "SubGhzTest"
|
||||||
#define KEYSTORE_DIR_NAME EXT_PATH("subghz/assets/keeloq_mfcodes")
|
|
||||||
#define CAME_ATOMO_DIR_NAME EXT_PATH("subghz/assets/came_atomo")
|
#define KEYSTORE_DIR_NAME EXT_PATH("subghz/assets/keeloq_mfcodes")
|
||||||
#define NICE_FLOR_S_DIR_NAME EXT_PATH("subghz/assets/nice_flor_s")
|
#define CAME_ATOMO_DIR_NAME EXT_PATH("subghz/assets/came_atomo")
|
||||||
#define ALUTECH_AT_4N_DIR_NAME EXT_PATH("subghz/assets/alutech_at_4n")
|
#define NICE_FLOR_S_DIR_NAME EXT_PATH("subghz/assets/nice_flor_s")
|
||||||
#define TEST_RANDOM_DIR_NAME EXT_PATH("unit_tests/subghz/test_random_raw.sub")
|
#define ALUTECH_AT_4N_DIR_NAME EXT_PATH("subghz/assets/alutech_at_4n")
|
||||||
|
#define TEST_RANDOM_DIR_NAME EXT_PATH("unit_tests/subghz/test_random_raw.sub")
|
||||||
#define TEST_RANDOM_COUNT_PARSE 329
|
#define TEST_RANDOM_COUNT_PARSE 329
|
||||||
#define TEST_TIMEOUT 10000
|
#define TEST_TIMEOUT 10000
|
||||||
|
|
||||||
static SubGhzEnvironment* environment_handler;
|
static SubGhzEnvironment* environment_handler;
|
||||||
static SubGhzReceiver* receiver_handler;
|
static SubGhzReceiver* receiver_handler;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <flipper_application/flipper_application.h>
|
#include <flipper_application/flipper_application.h>
|
||||||
|
|
||||||
#define APPID "UnitTest"
|
#define APPID "UnitTest"
|
||||||
#define API_VERSION (0u)
|
#define API_VERSION (0u)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <input/input.h>
|
#include <input/input.h>
|
||||||
|
|
||||||
#define MOUSE_MOVE_SHORT 5
|
#define MOUSE_MOVE_SHORT 5
|
||||||
#define MOUSE_MOVE_LONG 20
|
#define MOUSE_MOVE_LONG 20
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EventTypeInput,
|
EventTypeInput,
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
#define SUBGHZ_DEVICE_CC1101_EXT_TX_GPIO (&gpio_ext_pb2)
|
#define SUBGHZ_DEVICE_CC1101_EXT_TX_GPIO (&gpio_ext_pb2)
|
||||||
|
|
||||||
/* DMA Channels definition */
|
/* DMA Channels definition */
|
||||||
#define SUBGHZ_DEVICE_CC1101_EXT_DMA (DMA2)
|
#define SUBGHZ_DEVICE_CC1101_EXT_DMA (DMA2)
|
||||||
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_CHANNEL (LL_DMA_CHANNEL_3)
|
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_CHANNEL (LL_DMA_CHANNEL_3)
|
||||||
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH4_CHANNEL (LL_DMA_CHANNEL_4)
|
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH4_CHANNEL (LL_DMA_CHANNEL_4)
|
||||||
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH5_CHANNEL (LL_DMA_CHANNEL_5)
|
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH5_CHANNEL (LL_DMA_CHANNEL_5)
|
||||||
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_IRQ (FuriHalInterruptIdDma2Ch3)
|
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_IRQ (FuriHalInterruptIdDma2Ch3)
|
||||||
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_DEF \
|
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_DEF \
|
||||||
SUBGHZ_DEVICE_CC1101_EXT_DMA, SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_CHANNEL
|
SUBGHZ_DEVICE_CC1101_EXT_DMA, SUBGHZ_DEVICE_CC1101_EXT_DMA_CH3_CHANNEL
|
||||||
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH4_DEF \
|
#define SUBGHZ_DEVICE_CC1101_EXT_DMA_CH4_DEF \
|
||||||
@@ -365,7 +365,7 @@ bool subghz_device_cc1101_ext_is_rx_data_crc_valid(void) {
|
|||||||
cc1101_read_reg(
|
cc1101_read_reg(
|
||||||
subghz_device_cc1101_ext->spi_bus_handle, CC1101_STATUS_LQI | CC1101_BURST, data);
|
subghz_device_cc1101_ext->spi_bus_handle, CC1101_STATUS_LQI | CC1101_BURST, data);
|
||||||
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
|
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
|
||||||
if(((data[0] >> 7) & 0x01)) {
|
if((data[0] >> 7) & 0x01) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -826,9 +826,8 @@ bool subghz_device_cc1101_ext_start_async_tx(SubGhzDeviceCC1101ExtCallback callb
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool subghz_device_cc1101_ext_is_async_tx_complete(void) {
|
bool subghz_device_cc1101_ext_is_async_tx_complete(void) {
|
||||||
return (
|
return (subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncTx) &&
|
||||||
(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncTx) &&
|
(LL_TIM_GetAutoReload(TIM17) == 0);
|
||||||
(LL_TIM_GetAutoReload(TIM17) == 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void subghz_device_cc1101_ext_stop_async_tx(void) {
|
void subghz_device_cc1101_ext_stop_async_tx(void) {
|
||||||
|
|||||||
@@ -107,4 +107,4 @@ static const FlipperAppPluginDescriptor subghz_device_cc1101_ext_descriptor = {
|
|||||||
|
|
||||||
const FlipperAppPluginDescriptor* subghz_device_cc1101_ext_ep(void) {
|
const FlipperAppPluginDescriptor* subghz_device_cc1101_ext_ep(void) {
|
||||||
return &subghz_device_cc1101_ext_descriptor;
|
return &subghz_device_cc1101_ext_descriptor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define TAG "ble_beacon_app"
|
#define TAG "BleBeaconApp"
|
||||||
|
|
||||||
static bool ble_beacon_app_custom_event_callback(void* context, uint32_t event) {
|
static bool ble_beacon_app_custom_event_callback(void* context, uint32_t event) {
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define PLUGIN_APP_ID "example_plugins"
|
#define PLUGIN_APP_ID "example_plugins"
|
||||||
#define PLUGIN_API_VERSION 1
|
#define PLUGIN_API_VERSION 1
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
* Resolver interface with private application's symbols.
|
* Resolver interface with private application's symbols.
|
||||||
* Implementation is contained in app_api_table.c
|
* Implementation is contained in app_api_table.c
|
||||||
*/
|
*/
|
||||||
extern const ElfApiInterface* const application_api_interface;
|
extern const ElfApiInterface* const application_api_interface;
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ static constexpr auto app_api_table = sort(create_array_t<sym_entry>(
|
|||||||
API_METHOD(app_api_accumulator_get, uint32_t, ()),
|
API_METHOD(app_api_accumulator_get, uint32_t, ()),
|
||||||
API_METHOD(app_api_accumulator_add, void, (uint32_t)),
|
API_METHOD(app_api_accumulator_add, void, (uint32_t)),
|
||||||
API_METHOD(app_api_accumulator_sub, void, (uint32_t)),
|
API_METHOD(app_api_accumulator_sub, void, (uint32_t)),
|
||||||
API_METHOD(app_api_accumulator_mul, void, (uint32_t))));
|
API_METHOD(app_api_accumulator_mul, void, (uint32_t))));
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define PLUGIN_APP_ID "example_plugins_advanced"
|
#define PLUGIN_APP_ID "example_plugins_advanced"
|
||||||
#define PLUGIN_API_VERSION 1
|
#define PLUGIN_API_VERSION 1
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -25,15 +25,15 @@
|
|||||||
#include <furi_hal_power.h>
|
#include <furi_hal_power.h>
|
||||||
|
|
||||||
#define UPDATE_PERIOD_MS 1000UL
|
#define UPDATE_PERIOD_MS 1000UL
|
||||||
#define TEXT_STORE_SIZE 64U
|
#define TEXT_STORE_SIZE 64U
|
||||||
|
|
||||||
#define DS18B20_CMD_SKIP_ROM 0xccU
|
#define DS18B20_CMD_SKIP_ROM 0xccU
|
||||||
#define DS18B20_CMD_CONVERT 0x44U
|
#define DS18B20_CMD_CONVERT 0x44U
|
||||||
#define DS18B20_CMD_READ_SCRATCHPAD 0xbeU
|
#define DS18B20_CMD_READ_SCRATCHPAD 0xbeU
|
||||||
|
|
||||||
#define DS18B20_CFG_RESOLUTION_POS 5U
|
#define DS18B20_CFG_RESOLUTION_POS 5U
|
||||||
#define DS18B20_CFG_RESOLUTION_MASK 0x03U
|
#define DS18B20_CFG_RESOLUTION_MASK 0x03U
|
||||||
#define DS18B20_DECIMAL_PART_MASK 0x0fU
|
#define DS18B20_DECIMAL_PART_MASK 0x0fU
|
||||||
|
|
||||||
#define DS18B20_SIGN_MASK 0xf0U
|
#define DS18B20_SIGN_MASK 0xf0U
|
||||||
|
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ bool archive_is_home(ArchiveBrowserView* browser) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char* default_path = archive_get_default_path(archive_get_tab(browser));
|
const char* default_path = archive_get_default_path(archive_get_tab(browser));
|
||||||
return (furi_string_cmp_str(browser->path, default_path) == 0);
|
return furi_string_cmp_str(browser->path, default_path) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* archive_get_name(ArchiveBrowserView* browser) {
|
const char* archive_get_name(ArchiveBrowserView* browser) {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
#include "../archive_i.h"
|
#include "../archive_i.h"
|
||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
|
|
||||||
#define TAB_RIGHT InputKeyRight // Default tab switch direction
|
#define TAB_RIGHT InputKeyRight // Default tab switch direction
|
||||||
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
|
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
|
||||||
#define FILE_LIST_BUF_LEN 50
|
#define FILE_LIST_BUF_LEN 50
|
||||||
|
|
||||||
static const char* tab_default_paths[] = {
|
static const char* tab_default_paths[] = {
|
||||||
@@ -62,7 +62,7 @@ static inline const char* archive_get_default_path(ArchiveTabEnum tab) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline bool archive_is_known_app(ArchiveFileTypeEnum type) {
|
inline bool archive_is_known_app(ArchiveFileTypeEnum type) {
|
||||||
return (type != ArchiveFileTypeFolder && type != ArchiveFileTypeUnknown);
|
return type != ArchiveFileTypeFolder && type != ArchiveFileTypeUnknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx);
|
bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
|
|
||||||
#define ARCHIVE_FAV_PATH ANY_PATH("favorites.txt")
|
#define ARCHIVE_FAV_PATH ANY_PATH("favorites.txt")
|
||||||
#define ARCHIVE_FAV_TEMP_PATH ANY_PATH("favorites.tmp")
|
#define ARCHIVE_FAV_TEMP_PATH ANY_PATH("favorites.tmp")
|
||||||
|
|
||||||
uint16_t archive_favorites_count(void* context);
|
uint16_t archive_favorites_count(void* context);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#define TAG "ArchiveSceneBrowser"
|
#define TAG "ArchiveSceneBrowser"
|
||||||
|
|
||||||
#define SCENE_STATE_DEFAULT (0)
|
#define SCENE_STATE_DEFAULT (0)
|
||||||
#define SCENE_STATE_NEED_REFRESH (1)
|
#define SCENE_STATE_NEED_REFRESH (1)
|
||||||
|
|
||||||
static const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) {
|
static const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "toolbox/path.h"
|
#include "toolbox/path.h"
|
||||||
|
|
||||||
#define SCENE_DELETE_CUSTOM_EVENT (0UL)
|
#define SCENE_DELETE_CUSTOM_EVENT (0UL)
|
||||||
#define MAX_TEXT_INPUT_LEN 22
|
#define MAX_TEXT_INPUT_LEN 22
|
||||||
|
|
||||||
void archive_scene_delete_widget_callback(GuiButtonType result, InputType type, void* context) {
|
void archive_scene_delete_widget_callback(GuiButtonType result, InputType type, void* context) {
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "toolbox/path.h"
|
#include "toolbox/path.h"
|
||||||
|
|
||||||
#define SCENE_RENAME_CUSTOM_EVENT (0UL)
|
#define SCENE_RENAME_CUSTOM_EVENT (0UL)
|
||||||
#define MAX_TEXT_INPUT_LEN 22
|
#define MAX_TEXT_INPUT_LEN 22
|
||||||
|
|
||||||
void archive_scene_rename_text_input_callback(void* context) {
|
void archive_scene_rename_text_input_callback(void* context) {
|
||||||
ArchiveApp* archive = (ArchiveApp*)context;
|
ArchiveApp* archive = (ArchiveApp*)context;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "../helpers/archive_browser.h"
|
#include "../helpers/archive_browser.h"
|
||||||
|
|
||||||
#define SCROLL_INTERVAL (333)
|
#define SCROLL_INTERVAL (333)
|
||||||
#define SCROLL_DELAY (2)
|
#define SCROLL_DELAY (2)
|
||||||
|
|
||||||
static const char* ArchiveTabNames[] = {
|
static const char* ArchiveTabNames[] = {
|
||||||
[ArchiveTabFavorites] = "Favorites",
|
[ArchiveTabFavorites] = "Favorites",
|
||||||
|
|||||||
@@ -11,12 +11,12 @@
|
|||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
|
|
||||||
#define MAX_LEN_PX 110
|
#define MAX_LEN_PX 110
|
||||||
#define MAX_NAME_LEN 255
|
#define MAX_NAME_LEN 255
|
||||||
#define MAX_EXT_LEN 6
|
#define MAX_EXT_LEN 6
|
||||||
#define FRAME_HEIGHT 12
|
#define FRAME_HEIGHT 12
|
||||||
#define MENU_ITEMS 4u
|
#define MENU_ITEMS 4u
|
||||||
#define MOVE_OFFSET 5u
|
#define MOVE_OFFSET 5u
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ArchiveTabFavorites,
|
ArchiveTabFavorites,
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
#include <lib/toolbox/path.h>
|
#include <lib/toolbox/path.h>
|
||||||
#include <flipper_format/flipper_format.h>
|
#include <flipper_format/flipper_format.h>
|
||||||
|
|
||||||
#define BAD_USB_SETTINGS_PATH BAD_USB_APP_BASE_FOLDER "/.badusb.settings"
|
#define BAD_USB_SETTINGS_PATH BAD_USB_APP_BASE_FOLDER "/.badusb.settings"
|
||||||
#define BAD_USB_SETTINGS_FILE_TYPE "Flipper BadUSB Settings File"
|
#define BAD_USB_SETTINGS_FILE_TYPE "Flipper BadUSB Settings File"
|
||||||
#define BAD_USB_SETTINGS_VERSION 1
|
#define BAD_USB_SETTINGS_VERSION 1
|
||||||
#define BAD_USB_SETTINGS_DEFAULT_LAYOUT BAD_USB_APP_PATH_LAYOUT_FOLDER "/en-US.kl"
|
#define BAD_USB_SETTINGS_DEFAULT_LAYOUT BAD_USB_APP_PATH_LAYOUT_FOLDER "/en-US.kl"
|
||||||
|
|
||||||
static bool bad_usb_app_custom_event_callback(void* context, uint32_t event) {
|
static bool bad_usb_app_custom_event_callback(void* context, uint32_t event) {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
#include "views/bad_usb_view.h"
|
#include "views/bad_usb_view.h"
|
||||||
#include <furi_hal_usb.h>
|
#include <furi_hal_usb.h>
|
||||||
|
|
||||||
#define BAD_USB_APP_BASE_FOLDER ANY_PATH("badusb")
|
#define BAD_USB_APP_BASE_FOLDER ANY_PATH("badusb")
|
||||||
#define BAD_USB_APP_PATH_LAYOUT_FOLDER BAD_USB_APP_BASE_FOLDER "/assets/layouts"
|
#define BAD_USB_APP_PATH_LAYOUT_FOLDER BAD_USB_APP_BASE_FOLDER "/assets/layouts"
|
||||||
#define BAD_USB_APP_SCRIPT_EXTENSION ".txt"
|
#define BAD_USB_APP_SCRIPT_EXTENSION ".txt"
|
||||||
#define BAD_USB_APP_LAYOUT_EXTENSION ".kl"
|
#define BAD_USB_APP_LAYOUT_EXTENSION ".kl"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BadUsbAppErrorNoFiles,
|
BadUsbAppErrorNoFiles,
|
||||||
@@ -49,4 +49,4 @@ typedef enum {
|
|||||||
BadUsbAppViewError,
|
BadUsbAppViewError,
|
||||||
BadUsbAppViewWork,
|
BadUsbAppViewWork,
|
||||||
BadUsbAppViewConfig,
|
BadUsbAppViewConfig,
|
||||||
} BadUsbAppView;
|
} BadUsbAppView;
|
||||||
|
|||||||
@@ -223,4 +223,4 @@ void bad_usb_hid_ble_remove_pairing(void) {
|
|||||||
|
|
||||||
furi_check(bt_profile_restore_default(bt));
|
furi_check(bt_profile_restore_default(bt));
|
||||||
furi_record_close(RECORD_BT);
|
furi_record_close(RECORD_BT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <dolphin/dolphin.h>
|
#include <dolphin/dolphin.h>
|
||||||
|
|
||||||
#define TAG "BadUsb"
|
#define TAG "BadUsb"
|
||||||
|
|
||||||
#define WORKER_TAG TAG "Worker"
|
#define WORKER_TAG TAG "Worker"
|
||||||
|
|
||||||
#define BADUSB_ASCII_TO_KEY(script, x) \
|
#define BADUSB_ASCII_TO_KEY(script, x) \
|
||||||
@@ -46,7 +47,7 @@ uint32_t ducky_get_command_len(const char* line) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ducky_is_line_end(const char chr) {
|
bool ducky_is_line_end(const char chr) {
|
||||||
return ((chr == ' ') || (chr == '\0') || (chr == '\r') || (chr == '\n'));
|
return (chr == ' ') || (chr == '\0') || (chr == '\r') || (chr == '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t ducky_get_keycode(BadUsbScript* bad_usb, const char* param, bool accept_chars) {
|
uint16_t ducky_get_keycode(BadUsbScript* bad_usb, const char* param, bool accept_chars) {
|
||||||
@@ -56,7 +57,7 @@ uint16_t ducky_get_keycode(BadUsbScript* bad_usb, const char* param, bool accept
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((accept_chars) && (strlen(param) > 0)) {
|
if((accept_chars) && (strlen(param) > 0)) {
|
||||||
return (BADUSB_ASCII_TO_KEY(bad_usb, param[0]) & 0xFF);
|
return BADUSB_ASCII_TO_KEY(bad_usb, param[0]) & 0xFF;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -305,7 +306,7 @@ static int32_t ducky_script_execute_next(BadUsbScript* bad_usb, File* script_fil
|
|||||||
FURI_LOG_E(WORKER_TAG, "Unknown command at line %zu", bad_usb->st.line_cur - 1U);
|
FURI_LOG_E(WORKER_TAG, "Unknown command at line %zu", bad_usb->st.line_cur - 1U);
|
||||||
return SCRIPT_STATE_ERROR;
|
return SCRIPT_STATE_ERROR;
|
||||||
} else {
|
} else {
|
||||||
return (delay_val + bad_usb->defdelay);
|
return delay_val + bad_usb->defdelay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,7 +345,7 @@ static int32_t ducky_script_execute_next(BadUsbScript* bad_usb, File* script_fil
|
|||||||
FURI_LOG_E(WORKER_TAG, "Unknown command at line %zu", bad_usb->st.line_cur);
|
FURI_LOG_E(WORKER_TAG, "Unknown command at line %zu", bad_usb->st.line_cur);
|
||||||
return SCRIPT_STATE_ERROR;
|
return SCRIPT_STATE_ERROR;
|
||||||
} else {
|
} else {
|
||||||
return (delay_val + bad_usb->defdelay);
|
return delay_val + bad_usb->defdelay;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
furi_string_push_back(bad_usb->line, bad_usb->file_buf[i]);
|
furi_string_push_back(bad_usb->line, bad_usb->file_buf[i]);
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ static const DuckyCmd ducky_commands[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define TAG "BadUsb"
|
#define TAG "BadUsb"
|
||||||
|
|
||||||
#define WORKER_TAG TAG "Worker"
|
#define WORKER_TAG TAG "Worker"
|
||||||
|
|
||||||
int32_t ducky_execute_cmd(BadUsbScript* bad_usb, const char* line) {
|
int32_t ducky_execute_cmd(BadUsbScript* bad_usb, const char* line) {
|
||||||
@@ -231,7 +232,7 @@ int32_t ducky_execute_cmd(BadUsbScript* bad_usb, const char* line) {
|
|||||||
if(ducky_commands[i].callback == NULL) {
|
if(ducky_commands[i].callback == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return ((ducky_commands[i].callback)(bad_usb, line, ducky_commands[i].param));
|
return (ducky_commands[i].callback)(bad_usb, line, ducky_commands[i].param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ extern "C" {
|
|||||||
#include "ducky_script.h"
|
#include "ducky_script.h"
|
||||||
#include "bad_usb_hid.h"
|
#include "bad_usb_hid.h"
|
||||||
|
|
||||||
#define SCRIPT_STATE_ERROR (-1)
|
#define SCRIPT_STATE_ERROR (-1)
|
||||||
#define SCRIPT_STATE_END (-2)
|
#define SCRIPT_STATE_END (-2)
|
||||||
#define SCRIPT_STATE_NEXT_LINE (-3)
|
#define SCRIPT_STATE_NEXT_LINE (-3)
|
||||||
#define SCRIPT_STATE_CMD_UNKNOWN (-4)
|
#define SCRIPT_STATE_CMD_UNKNOWN (-4)
|
||||||
#define SCRIPT_STATE_STRING_START (-5)
|
#define SCRIPT_STATE_STRING_START (-5)
|
||||||
#define SCRIPT_STATE_WAIT_FOR_BTN (-6)
|
#define SCRIPT_STATE_WAIT_FOR_BTN (-6)
|
||||||
|
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
#include <stm32wbxx_ll_lpuart.h>
|
#include <stm32wbxx_ll_lpuart.h>
|
||||||
#include <stm32wbxx_ll_usart.h>
|
#include <stm32wbxx_ll_usart.h>
|
||||||
|
|
||||||
#define USB_CDC_PKT_LEN CDC_DATA_SZ
|
#define USB_CDC_PKT_LEN CDC_DATA_SZ
|
||||||
#define USB_UART_RX_BUF_SIZE (USB_CDC_PKT_LEN * 5)
|
#define USB_UART_RX_BUF_SIZE (USB_CDC_PKT_LEN * 5)
|
||||||
|
|
||||||
#define USB_CDC_BIT_DTR (1 << 0)
|
#define USB_CDC_BIT_DTR (1 << 0)
|
||||||
#define USB_CDC_BIT_RTS (1 << 1)
|
#define USB_CDC_BIT_RTS (1 << 1)
|
||||||
#define USB_USART_DE_RE_PIN &gpio_ext_pa4
|
#define USB_USART_DE_RE_PIN &gpio_ext_pa4
|
||||||
|
|
||||||
static const GpioPin* flow_pins[][2] = {
|
static const GpioPin* flow_pins[][2] = {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ static void ibutton_cli_print_usage(void) {
|
|||||||
printf("\tCyfral (2 bytes key_data)\r\n");
|
printf("\tCyfral (2 bytes key_data)\r\n");
|
||||||
printf("\tMetakom (4 bytes key_data), must contain correct parity\r\n");
|
printf("\tMetakom (4 bytes key_data), must contain correct parity\r\n");
|
||||||
printf("\t<key_data> are hex-formatted\r\n");
|
printf("\t<key_data> are hex-formatted\r\n");
|
||||||
};
|
}
|
||||||
|
|
||||||
static bool ibutton_cli_parse_key(iButtonProtocols* protocols, iButtonKey* key, FuriString* args) {
|
static bool ibutton_cli_parse_key(iButtonProtocols* protocols, iButtonKey* key, FuriString* args) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@@ -124,7 +124,7 @@ static void ibutton_cli_read(Cli* cli) {
|
|||||||
ibutton_protocols_free(protocols);
|
ibutton_protocols_free(protocols);
|
||||||
|
|
||||||
furi_event_flag_free(event);
|
furi_event_flag_free(event);
|
||||||
};
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FuriEventFlag* event;
|
FuriEventFlag* event;
|
||||||
@@ -226,7 +226,7 @@ void ibutton_cli_emulate(Cli* cli, FuriString* args) {
|
|||||||
ibutton_key_free(key);
|
ibutton_key_free(key);
|
||||||
ibutton_worker_free(worker);
|
ibutton_worker_free(worker);
|
||||||
ibutton_protocols_free(protocols);
|
ibutton_protocols_free(protocols);
|
||||||
};
|
}
|
||||||
|
|
||||||
void ibutton_cli(Cli* cli, FuriString* args, void* context) {
|
void ibutton_cli(Cli* cli, FuriString* args, void* context) {
|
||||||
UNUSED(cli);
|
UNUSED(cli);
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
#include "ibutton_custom_event.h"
|
#include "ibutton_custom_event.h"
|
||||||
#include "scenes/ibutton_scene.h"
|
#include "scenes/ibutton_scene.h"
|
||||||
|
|
||||||
#define IBUTTON_APP_FOLDER ANY_PATH("ibutton")
|
#define IBUTTON_APP_FOLDER ANY_PATH("ibutton")
|
||||||
#define IBUTTON_APP_FILENAME_PREFIX "iBtn"
|
#define IBUTTON_APP_FILENAME_PREFIX "iBtn"
|
||||||
#define IBUTTON_APP_FILENAME_EXTENSION ".ibtn"
|
#define IBUTTON_APP_FILENAME_EXTENSION ".ibtn"
|
||||||
|
|
||||||
#define IBUTTON_KEY_NAME_SIZE 22
|
#define IBUTTON_KEY_NAME_SIZE 22
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
#define TAG "InfraredApp"
|
#define TAG "InfraredApp"
|
||||||
|
|
||||||
#define INFRARED_TX_MIN_INTERVAL_MS (50U)
|
#define INFRARED_TX_MIN_INTERVAL_MS (50U)
|
||||||
#define INFRARED_TASK_STACK_SIZE (2048UL)
|
#define INFRARED_TASK_STACK_SIZE (2048UL)
|
||||||
|
|
||||||
#define INFRARED_SETTINGS_PATH INT_PATH(".infrared.settings")
|
#define INFRARED_SETTINGS_PATH INT_PATH(".infrared.settings")
|
||||||
#define INFRARED_SETTINGS_VERSION (1)
|
#define INFRARED_SETTINGS_VERSION (1)
|
||||||
#define INFRARED_SETTINGS_MAGIC (0x1F)
|
#define INFRARED_SETTINGS_MAGIC (0x1F)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FuriHalInfraredTxPin tx_pin;
|
FuriHalInfraredTxPin tx_pin;
|
||||||
|
|||||||
@@ -39,18 +39,18 @@
|
|||||||
#include "views/infrared_debug_view.h"
|
#include "views/infrared_debug_view.h"
|
||||||
#include "views/infrared_move_view.h"
|
#include "views/infrared_move_view.h"
|
||||||
|
|
||||||
#define INFRARED_FILE_NAME_SIZE 100
|
#define INFRARED_FILE_NAME_SIZE 100
|
||||||
#define INFRARED_TEXT_STORE_NUM 2
|
#define INFRARED_TEXT_STORE_NUM 2
|
||||||
#define INFRARED_TEXT_STORE_SIZE 128
|
#define INFRARED_TEXT_STORE_SIZE 128
|
||||||
|
|
||||||
#define INFRARED_MAX_BUTTON_NAME_LENGTH 22
|
#define INFRARED_MAX_BUTTON_NAME_LENGTH 22
|
||||||
#define INFRARED_MAX_REMOTE_NAME_LENGTH 22
|
#define INFRARED_MAX_REMOTE_NAME_LENGTH 22
|
||||||
|
|
||||||
#define INFRARED_APP_FOLDER ANY_PATH("infrared")
|
#define INFRARED_APP_FOLDER ANY_PATH("infrared")
|
||||||
#define INFRARED_APP_EXTENSION ".ir"
|
#define INFRARED_APP_EXTENSION ".ir"
|
||||||
|
|
||||||
#define INFRARED_DEFAULT_REMOTE_NAME "Remote"
|
#define INFRARED_DEFAULT_REMOTE_NAME "Remote"
|
||||||
#define INFRARED_LOG_TAG "InfraredApp"
|
#define INFRARED_LOG_TAG "InfraredApp"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enumeration of invalid remote button indices.
|
* @brief Enumeration of invalid remote button indices.
|
||||||
@@ -86,7 +86,7 @@ typedef struct {
|
|||||||
bool is_transmitting; /**< Whether a signal is currently being transmitted. */
|
bool is_transmitting; /**< Whether a signal is currently being transmitted. */
|
||||||
bool is_otg_enabled; /**< Whether OTG power (external 5V) is enabled. */
|
bool is_otg_enabled; /**< Whether OTG power (external 5V) is enabled. */
|
||||||
InfraredEditTarget edit_target : 8; /**< Selected editing target (a remote or a button). */
|
InfraredEditTarget edit_target : 8; /**< Selected editing target (a remote or a button). */
|
||||||
InfraredEditMode edit_mode : 8; /**< Selected editing operation (rename or delete). */
|
InfraredEditMode edit_mode : 8; /**< Selected editing operation (rename or delete). */
|
||||||
int32_t current_button_index; /**< Selected button index (move destination). */
|
int32_t current_button_index; /**< Selected button index (move destination). */
|
||||||
int32_t prev_button_index; /**< Previous button index (move source). */
|
int32_t prev_button_index; /**< Previous button index (move source). */
|
||||||
uint32_t last_transmit_time; /**< Lat time a signal was transmitted. */
|
uint32_t last_transmit_time; /**< Lat time a signal was transmitted. */
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
#include "infrared_signal.h"
|
#include "infrared_signal.h"
|
||||||
#include "infrared_brute_force.h"
|
#include "infrared_brute_force.h"
|
||||||
|
|
||||||
#define INFRARED_CLI_BUF_SIZE (10U)
|
#define INFRARED_CLI_BUF_SIZE (10U)
|
||||||
#define INFRARED_CLI_FILE_NAME_SIZE (256U)
|
#define INFRARED_CLI_FILE_NAME_SIZE (256U)
|
||||||
#define INFRARED_FILE_EXTENSION ".ir"
|
#define INFRARED_FILE_EXTENSION ".ir"
|
||||||
#define INFRARED_ASSETS_FOLDER EXT_PATH("infrared/assets")
|
#define INFRARED_ASSETS_FOLDER EXT_PATH("infrared/assets")
|
||||||
#define INFRARED_BRUTE_FORCE_DUMMY_INDEX 0
|
#define INFRARED_BRUTE_FORCE_DUMMY_INDEX 0
|
||||||
|
|
||||||
DICT_DEF2(dict_signals, FuriString*, FURI_STRING_OPLIST, int, M_DEFAULT_OPLIST)
|
DICT_DEF2(dict_signals, FuriString*, FURI_STRING_OPLIST, int, M_DEFAULT_OPLIST)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#define TAG "InfraredRemote"
|
#define TAG "InfraredRemote"
|
||||||
|
|
||||||
#define INFRARED_FILE_HEADER "IR signals file"
|
#define INFRARED_FILE_HEADER "IR signals file"
|
||||||
#define INFRARED_FILE_VERSION (1)
|
#define INFRARED_FILE_VERSION (1)
|
||||||
|
|
||||||
ARRAY_DEF(StringArray, const char*, M_CSTR_DUP_OPLIST); //-V575
|
ARRAY_DEF(StringArray, const char*, M_CSTR_DUP_OPLIST); //-V575
|
||||||
|
|||||||
@@ -13,18 +13,18 @@
|
|||||||
#define INFRARED_SIGNAL_TYPE_KEY "type"
|
#define INFRARED_SIGNAL_TYPE_KEY "type"
|
||||||
|
|
||||||
// Type key values
|
// Type key values
|
||||||
#define INFRARED_SIGNAL_TYPE_RAW "raw"
|
#define INFRARED_SIGNAL_TYPE_RAW "raw"
|
||||||
#define INFRARED_SIGNAL_TYPE_PARSED "parsed"
|
#define INFRARED_SIGNAL_TYPE_PARSED "parsed"
|
||||||
|
|
||||||
// Raw signal keys
|
// Raw signal keys
|
||||||
#define INFRARED_SIGNAL_DATA_KEY "data"
|
#define INFRARED_SIGNAL_DATA_KEY "data"
|
||||||
#define INFRARED_SIGNAL_FREQUENCY_KEY "frequency"
|
#define INFRARED_SIGNAL_FREQUENCY_KEY "frequency"
|
||||||
#define INFRARED_SIGNAL_DUTY_CYCLE_KEY "duty_cycle"
|
#define INFRARED_SIGNAL_DUTY_CYCLE_KEY "duty_cycle"
|
||||||
|
|
||||||
// Parsed signal keys
|
// Parsed signal keys
|
||||||
#define INFRARED_SIGNAL_PROTOCOL_KEY "protocol"
|
#define INFRARED_SIGNAL_PROTOCOL_KEY "protocol"
|
||||||
#define INFRARED_SIGNAL_ADDRESS_KEY "address"
|
#define INFRARED_SIGNAL_ADDRESS_KEY "address"
|
||||||
#define INFRARED_SIGNAL_COMMAND_KEY "command"
|
#define INFRARED_SIGNAL_COMMAND_KEY "command"
|
||||||
|
|
||||||
struct InfraredSignal {
|
struct InfraredSignal {
|
||||||
bool is_raw;
|
bool is_raw;
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
#include <toolbox/m_cstr_dup.h>
|
#include <toolbox/m_cstr_dup.h>
|
||||||
|
|
||||||
#define LIST_ITEMS 4U
|
#define LIST_ITEMS 4U
|
||||||
#define LIST_LINE_H 13U
|
#define LIST_LINE_H 13U
|
||||||
#define HEADER_H 12U
|
#define HEADER_H 12U
|
||||||
#define MOVE_X_OFFSET 5U
|
#define MOVE_X_OFFSET 5U
|
||||||
|
|
||||||
struct InfraredMoveView {
|
struct InfraredMoveView {
|
||||||
@@ -98,7 +98,7 @@ static bool infrared_move_view_input_callback(InputEvent* event, void* context)
|
|||||||
|
|
||||||
bool consumed = false;
|
bool consumed = false;
|
||||||
|
|
||||||
if(((event->type == InputTypeShort || event->type == InputTypeRepeat)) &&
|
if((event->type == InputTypeShort || event->type == InputTypeRepeat) &&
|
||||||
((event->key == InputKeyUp) || (event->key == InputKeyDown))) {
|
((event->key == InputKeyUp) || (event->key == InputKeyDown))) {
|
||||||
with_view_model(
|
with_view_model(
|
||||||
move_view->view,
|
move_view->view,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ static void lfrfid_cli_print_usage(void) {
|
|||||||
"rfid raw_emulate <filename> - emulate raw data (not very useful, but helps debug protocols)\r\n");
|
"rfid raw_emulate <filename> - emulate raw data (not very useful, but helps debug protocols)\r\n");
|
||||||
printf(
|
printf(
|
||||||
"rfid raw_analyze <filename> - outputs raw data to the cli and tries to decode it (useful for protocol development)\r\n");
|
"rfid raw_analyze <filename> - outputs raw data to the cli and tries to decode it (useful for protocol development)\r\n");
|
||||||
};
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ProtocolId protocol;
|
ProtocolId protocol;
|
||||||
|
|||||||
@@ -35,13 +35,13 @@
|
|||||||
|
|
||||||
#include <lfrfid/scenes/lfrfid_scene.h>
|
#include <lfrfid/scenes/lfrfid_scene.h>
|
||||||
|
|
||||||
#define LFRFID_KEY_NAME_SIZE 22
|
#define LFRFID_KEY_NAME_SIZE 22
|
||||||
#define LFRFID_TEXT_STORE_SIZE 40
|
#define LFRFID_TEXT_STORE_SIZE 40
|
||||||
|
|
||||||
#define LFRFID_APP_FOLDER ANY_PATH("lfrfid")
|
#define LFRFID_APP_FOLDER ANY_PATH("lfrfid")
|
||||||
#define LFRFID_SD_FOLDER EXT_PATH("lfrfid")
|
#define LFRFID_SD_FOLDER EXT_PATH("lfrfid")
|
||||||
#define LFRFID_APP_FILENAME_PREFIX "RFID"
|
#define LFRFID_APP_FILENAME_PREFIX "RFID"
|
||||||
#define LFRFID_APP_FILENAME_EXTENSION ".rfid"
|
#define LFRFID_APP_FILENAME_EXTENSION ".rfid"
|
||||||
#define LFRFID_APP_SHADOW_FILENAME_EXTENSION ".shd"
|
#define LFRFID_APP_SHADOW_FILENAME_EXTENSION ".shd"
|
||||||
|
|
||||||
#define LFRFID_APP_RAW_ASK_EXTENSION ".ask.raw"
|
#define LFRFID_APP_RAW_ASK_EXTENSION ".ask.raw"
|
||||||
|
|||||||
@@ -56,4 +56,4 @@ void gallagher_deobfuscate_and_parse_credential(
|
|||||||
((uint32_t)cardholder_data_deobfuscated[2] << 3) +
|
((uint32_t)cardholder_data_deobfuscated[2] << 3) +
|
||||||
(((uint32_t)cardholder_data_deobfuscated[3] >> 5) & 0x07);
|
(((uint32_t)cardholder_data_deobfuscated[3] >> 5) & 0x07);
|
||||||
credential->issue = cardholder_data_deobfuscated[7] & 0x0F;
|
credential->issue = cardholder_data_deobfuscated[7] & 0x0F;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ void gallagher_deobfuscate_and_parse_credential(
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ bool mosgortrans_parse_transport_block(const MfClassicBlock* block, FuriString*
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ void felica_auth_reset(FelicaAuthenticationContext* instance) {
|
|||||||
instance->skip_auth = true;
|
instance->skip_auth = true;
|
||||||
instance->auth_status.external = 0;
|
instance->auth_status.external = 0;
|
||||||
instance->auth_status.internal = 0;
|
instance->auth_status.internal = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <furi/furi.h>
|
#include <furi/furi.h>
|
||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
|
|
||||||
#define NFC_APP_KEYS_EXTENSION ".keys"
|
#define NFC_APP_KEYS_EXTENSION ".keys"
|
||||||
#define NFC_APP_KEY_CACHE_FOLDER "/ext/nfc/.cache"
|
#define NFC_APP_KEY_CACHE_FOLDER "/ext/nfc/.cache"
|
||||||
|
|
||||||
static const char* mf_classic_key_cache_file_header = "Flipper NFC keys";
|
static const char* mf_classic_key_cache_file_header = "Flipper NFC keys";
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <nfc/protocols/mf_classic/mf_classic.h>
|
#include <nfc/protocols/mf_classic/mf_classic.h>
|
||||||
#include <furi/furi.h>
|
#include <furi/furi.h>
|
||||||
|
|
||||||
#define NFC_APP_FOLDER ANY_PATH("nfc")
|
#define NFC_APP_FOLDER ANY_PATH("nfc")
|
||||||
#define NFC_APP_MF_CLASSIC_DICT_USER_PATH (NFC_APP_FOLDER "/assets/mf_classic_dict_user.nfc")
|
#define NFC_APP_MF_CLASSIC_DICT_USER_PATH (NFC_APP_FOLDER "/assets/mf_classic_dict_user.nfc")
|
||||||
|
|
||||||
struct MfUserDict {
|
struct MfUserDict {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#define TAG "NfcSupportedCards"
|
#define TAG "NfcSupportedCards"
|
||||||
|
|
||||||
#define NFC_SUPPORTED_CARDS_PLUGINS_PATH APP_DATA_PATH("plugins")
|
#define NFC_SUPPORTED_CARDS_PLUGINS_PATH APP_DATA_PATH("plugins")
|
||||||
#define NFC_SUPPORTED_CARDS_PLUGIN_SUFFIX "_parser.fal"
|
#define NFC_SUPPORTED_CARDS_PLUGIN_SUFFIX "_parser.fal"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ void nfc_render_felica_dump(const FelicaData* data, FuriString* str);
|
|||||||
void nfc_render_felica_idm(
|
void nfc_render_felica_idm(
|
||||||
const FelicaData* data,
|
const FelicaData* data,
|
||||||
NfcProtocolFormatType format_type,
|
NfcProtocolFormatType format_type,
|
||||||
FuriString* str);
|
FuriString* str);
|
||||||
|
|||||||
@@ -120,4 +120,4 @@ const NfcProtocolSupportBase nfc_protocol_support_mf_plus = {
|
|||||||
.on_enter = nfc_scene_emulate_on_enter_mf_plus,
|
.on_enter = nfc_scene_emulate_on_enter_mf_plus,
|
||||||
.on_event = nfc_protocol_support_common_on_event_empty,
|
.on_event = nfc_protocol_support_common_on_event_empty,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
#include "../nfc_protocol_support_base.h"
|
#include "../nfc_protocol_support_base.h"
|
||||||
|
|
||||||
extern const NfcProtocolSupportBase nfc_protocol_support_mf_plus;
|
extern const NfcProtocolSupportBase nfc_protocol_support_mf_plus;
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ void nfc_render_mf_ultralight_info(
|
|||||||
|
|
||||||
void nfc_render_mf_ultralight_dump(const MfUltralightData* data, FuriString* str);
|
void nfc_render_mf_ultralight_dump(const MfUltralightData* data, FuriString* str);
|
||||||
|
|
||||||
void nfc_render_mf_ultralight_pwd_pack(const MfUltralightData* data, FuriString* str);
|
void nfc_render_mf_ultralight_pwd_pack(const MfUltralightData* data, FuriString* str);
|
||||||
|
|||||||
@@ -113,4 +113,4 @@ bool nfc_protocol_support_on_event(
|
|||||||
*/
|
*/
|
||||||
void nfc_protocol_support_on_exit(NfcProtocolSupportScene scene, void* context);
|
void nfc_protocol_support_on_exit(NfcProtocolSupportScene scene, void* context);
|
||||||
|
|
||||||
bool nfc_protocol_support_has_feature(NfcProtocol protocol, NfcProtocolFeature feature);
|
bool nfc_protocol_support_has_feature(NfcProtocol protocol, NfcProtocolFeature feature);
|
||||||
|
|||||||
@@ -35,4 +35,4 @@ void nfc_unlock_helper_card_detected_handler(NfcApp* instance) {
|
|||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
instance->scene_manager, NfcSceneRead, NfcSceneReadMenuStateCardFound);
|
instance->scene_manager, NfcSceneRead, NfcSceneReadMenuStateCardFound);
|
||||||
nfc_scene_read_setup_view(instance);
|
nfc_scene_read_setup_view(instance);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ typedef enum {
|
|||||||
} NfcSceneUnlockReadState;
|
} NfcSceneUnlockReadState;
|
||||||
|
|
||||||
void nfc_unlock_helper_setup_from_state(NfcApp* instance);
|
void nfc_unlock_helper_setup_from_state(NfcApp* instance);
|
||||||
void nfc_unlock_helper_card_detected_handler(NfcApp* instance);
|
void nfc_unlock_helper_card_detected_handler(NfcApp* instance);
|
||||||
|
|||||||
@@ -61,19 +61,19 @@
|
|||||||
#include <toolbox/name_generator.h>
|
#include <toolbox/name_generator.h>
|
||||||
#include <dolphin/dolphin.h>
|
#include <dolphin/dolphin.h>
|
||||||
|
|
||||||
#define NFC_NAME_SIZE 22
|
#define NFC_NAME_SIZE 22
|
||||||
#define NFC_TEXT_STORE_SIZE 128
|
#define NFC_TEXT_STORE_SIZE 128
|
||||||
#define NFC_BYTE_INPUT_STORE_SIZE 10
|
#define NFC_BYTE_INPUT_STORE_SIZE 10
|
||||||
#define NFC_LOG_SIZE_MAX (1024)
|
#define NFC_LOG_SIZE_MAX (1024)
|
||||||
#define NFC_APP_FOLDER ANY_PATH("nfc")
|
#define NFC_APP_FOLDER ANY_PATH("nfc")
|
||||||
#define NFC_APP_EXTENSION ".nfc"
|
#define NFC_APP_EXTENSION ".nfc"
|
||||||
#define NFC_APP_SHADOW_EXTENSION ".shd"
|
#define NFC_APP_SHADOW_EXTENSION ".shd"
|
||||||
#define NFC_APP_FILENAME_PREFIX "NFC"
|
#define NFC_APP_FILENAME_PREFIX "NFC"
|
||||||
|
|
||||||
#define NFC_APP_MFKEY32_LOGS_FILE_NAME ".mfkey32.log"
|
#define NFC_APP_MFKEY32_LOGS_FILE_NAME ".mfkey32.log"
|
||||||
#define NFC_APP_MFKEY32_LOGS_FILE_PATH (NFC_APP_FOLDER "/" NFC_APP_MFKEY32_LOGS_FILE_NAME)
|
#define NFC_APP_MFKEY32_LOGS_FILE_PATH (NFC_APP_FOLDER "/" NFC_APP_MFKEY32_LOGS_FILE_NAME)
|
||||||
|
|
||||||
#define NFC_APP_MF_CLASSIC_DICT_USER_PATH (NFC_APP_FOLDER "/assets/mf_classic_dict_user.nfc")
|
#define NFC_APP_MF_CLASSIC_DICT_USER_PATH (NFC_APP_FOLDER "/assets/mf_classic_dict_user.nfc")
|
||||||
#define NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH (NFC_APP_FOLDER "/assets/mf_classic_dict.nfc")
|
#define NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH (NFC_APP_FOLDER "/assets/mf_classic_dict.nfc")
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@@ -85,4 +85,4 @@ static const FlipperAppPluginDescriptor gallagher_plugin_descriptor = {
|
|||||||
/* Plugin entry point */
|
/* Plugin entry point */
|
||||||
const FlipperAppPluginDescriptor* gallagher_plugin_ep(void) {
|
const FlipperAppPluginDescriptor* gallagher_plugin_ep(void) {
|
||||||
return &gallagher_plugin_descriptor;
|
return &gallagher_plugin_descriptor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,10 @@
|
|||||||
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
||||||
|
|
||||||
#define TAG "HI!"
|
#define TAG "HI!"
|
||||||
#define KEY_LENGTH 6
|
|
||||||
|
#define KEY_LENGTH 6
|
||||||
#define HI_KEY_TO_GEN 5
|
#define HI_KEY_TO_GEN 5
|
||||||
#define UID_LENGTH 7
|
#define UID_LENGTH 7
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t a;
|
uint64_t a;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
||||||
|
|
||||||
#define TAG "Microel"
|
#define TAG "Microel"
|
||||||
|
|
||||||
#define KEY_LENGTH 6
|
#define KEY_LENGTH 6
|
||||||
#define UID_LENGTH 4
|
#define UID_LENGTH 4
|
||||||
|
|
||||||
@@ -227,4 +228,4 @@ static const FlipperAppPluginDescriptor microel_plugin_descriptor = {
|
|||||||
/* Plugin entry point - must return a pointer to const descriptor */
|
/* Plugin entry point - must return a pointer to const descriptor */
|
||||||
const FlipperAppPluginDescriptor* microel_plugin_ep(void) {
|
const FlipperAppPluginDescriptor* microel_plugin_ep(void) {
|
||||||
return µel_plugin_descriptor;
|
return µel_plugin_descriptor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,10 @@
|
|||||||
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
||||||
|
|
||||||
#define TAG "MiZIP"
|
#define TAG "MiZIP"
|
||||||
#define KEY_LENGTH 6
|
|
||||||
|
#define KEY_LENGTH 6
|
||||||
#define MIZIP_KEY_TO_GEN 5
|
#define MIZIP_KEY_TO_GEN 5
|
||||||
#define UID_LENGTH 4
|
#define UID_LENGTH 4
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t a;
|
uint64_t a;
|
||||||
|
|||||||
@@ -62,18 +62,18 @@ static const char* opal_usages[14] = {
|
|||||||
|
|
||||||
// Opal file 0x7 structure. Assumes a little-endian CPU.
|
// Opal file 0x7 structure. Assumes a little-endian CPU.
|
||||||
typedef struct FURI_PACKED {
|
typedef struct FURI_PACKED {
|
||||||
uint32_t serial : 32;
|
uint32_t serial : 32;
|
||||||
uint8_t check_digit : 4;
|
uint8_t check_digit : 4;
|
||||||
bool blocked : 1;
|
bool blocked : 1;
|
||||||
uint16_t txn_number : 16;
|
uint16_t txn_number : 16;
|
||||||
int32_t balance : 21;
|
int32_t balance : 21;
|
||||||
uint16_t days : 15;
|
uint16_t days : 15;
|
||||||
uint16_t minutes : 11;
|
uint16_t minutes : 11;
|
||||||
uint8_t mode : 3;
|
uint8_t mode : 3;
|
||||||
uint16_t usage : 4;
|
uint16_t usage : 4;
|
||||||
bool auto_topup : 1;
|
bool auto_topup : 1;
|
||||||
uint8_t weekly_journeys : 4;
|
uint8_t weekly_journeys : 4;
|
||||||
uint16_t checksum : 16;
|
uint16_t checksum : 16;
|
||||||
} OpalFile;
|
} OpalFile;
|
||||||
|
|
||||||
static_assert(sizeof(OpalFile) == 16, "OpalFile");
|
static_assert(sizeof(OpalFile) == 16, "OpalFile");
|
||||||
|
|||||||
@@ -260,4 +260,4 @@ static const FlipperAppPluginDescriptor troika_plugin_descriptor = {
|
|||||||
/* Plugin entry point - must return a pointer to const descriptor */
|
/* Plugin entry point - must return a pointer to const descriptor */
|
||||||
const FlipperAppPluginDescriptor* troika_plugin_ep(void) {
|
const FlipperAppPluginDescriptor* troika_plugin_ep(void) {
|
||||||
return &troika_plugin_descriptor;
|
return &troika_plugin_descriptor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ bool parse_datetime(uint16_t date, DateTime* result) {
|
|||||||
result->year = 2000 + (date >> 9);
|
result->year = 2000 + (date >> 9);
|
||||||
result->month = date >> 5 & 0x0F;
|
result->month = date >> 5 & 0x0F;
|
||||||
result->day = date & 0x1F;
|
result->day = date & 0x1F;
|
||||||
return (date != 0);
|
return date != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool umarsh_parse(const NfcDevice* device, FuriString* parsed_data) {
|
static bool umarsh_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||||
|
|||||||
@@ -194,4 +194,4 @@ static const FlipperAppPluginDescriptor washcity_plugin_descriptor = {
|
|||||||
/* Plugin entry point - must return a pointer to const descriptor */
|
/* Plugin entry point - must return a pointer to const descriptor */
|
||||||
const FlipperAppPluginDescriptor* washcity_plugin_ep(void) {
|
const FlipperAppPluginDescriptor* washcity_plugin_ep(void) {
|
||||||
return &washcity_plugin_descriptor;
|
return &washcity_plugin_descriptor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#define NXP_MANUFACTURER_ID (0x04)
|
#define NXP_MANUFACTURER_ID (0x04)
|
||||||
|
|
||||||
#define NFC_SCENE_DETECT_READER_PAIR_NONCES_MAX (10U)
|
#define NFC_SCENE_DETECT_READER_PAIR_NONCES_MAX (10U)
|
||||||
#define NFC_SCENE_DETECT_READER_WAIT_NONCES_TIMEOUT_MS (1000)
|
#define NFC_SCENE_DETECT_READER_WAIT_NONCES_TIMEOUT_MS (1000)
|
||||||
|
|
||||||
static const NotificationSequence sequence_detect_reader = {
|
static const NotificationSequence sequence_detect_reader = {
|
||||||
|
|||||||
@@ -55,4 +55,4 @@ void nfc_scene_mf_classic_update_initial_wrong_card_on_exit(void* context) {
|
|||||||
NfcApp* instance = context;
|
NfcApp* instance = context;
|
||||||
|
|
||||||
widget_reset(instance->widget);
|
widget_reset(instance->widget);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,4 +54,4 @@ void nfc_scene_mf_classic_write_initial_wrong_card_on_exit(void* context) {
|
|||||||
NfcApp* instance = context;
|
NfcApp* instance = context;
|
||||||
|
|
||||||
widget_reset(instance->widget);
|
widget_reset(instance->widget);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,4 +55,4 @@ void nfc_scene_mf_ultralight_wrong_card_on_exit(void* context) {
|
|||||||
NfcApp* instance = context;
|
NfcApp* instance = context;
|
||||||
|
|
||||||
widget_reset(instance->widget);
|
widget_reset(instance->widget);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ void onewire_on_system_start(void) {
|
|||||||
static void onewire_cli_print_usage(void) {
|
static void onewire_cli_print_usage(void) {
|
||||||
printf("Usage:\r\n");
|
printf("Usage:\r\n");
|
||||||
printf("onewire search\r\n");
|
printf("onewire search\r\n");
|
||||||
};
|
}
|
||||||
|
|
||||||
static void onewire_cli_search(Cli* cli) {
|
static void onewire_cli_search(Cli* cli) {
|
||||||
UNUSED(cli);
|
UNUSED(cli);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <lib/subghz/subghz_tx_rx_worker.h>
|
#include <lib/subghz/subghz_tx_rx_worker.h>
|
||||||
|
|
||||||
#define TAG "SubGhzChat"
|
#define TAG "SubGhzChat"
|
||||||
|
|
||||||
#define SUBGHZ_CHAT_WORKER_TIMEOUT_BETWEEN_MESSAGES 500
|
#define SUBGHZ_CHAT_WORKER_TIMEOUT_BETWEEN_MESSAGES 500
|
||||||
|
|
||||||
struct SubGhzChatWorker {
|
struct SubGhzChatWorker {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <float_tools.h>
|
#include <float_tools.h>
|
||||||
|
|
||||||
#define TAG "SubGhzThresholdRssi"
|
#define TAG "SubGhzThresholdRssi"
|
||||||
|
|
||||||
#define THRESHOLD_RSSI_LOW_COUNT 10
|
#define THRESHOLD_RSSI_LOW_COUNT 10
|
||||||
|
|
||||||
struct SubGhzThresholdRssi {
|
struct SubGhzThresholdRssi {
|
||||||
|
|||||||
@@ -508,22 +508,19 @@ SubGhzProtocolDecoderBase* subghz_txrx_get_decoder(SubGhzTxRx* instance) {
|
|||||||
|
|
||||||
bool subghz_txrx_protocol_is_serializable(SubGhzTxRx* instance) {
|
bool subghz_txrx_protocol_is_serializable(SubGhzTxRx* instance) {
|
||||||
furi_assert(instance);
|
furi_assert(instance);
|
||||||
return (
|
return (instance->decoder_result->protocol->flag & SubGhzProtocolFlag_Save) ==
|
||||||
(instance->decoder_result->protocol->flag & SubGhzProtocolFlag_Save) ==
|
SubGhzProtocolFlag_Save;
|
||||||
SubGhzProtocolFlag_Save);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool subghz_txrx_protocol_is_transmittable(SubGhzTxRx* instance, bool check_type) {
|
bool subghz_txrx_protocol_is_transmittable(SubGhzTxRx* instance, bool check_type) {
|
||||||
furi_assert(instance);
|
furi_assert(instance);
|
||||||
const SubGhzProtocol* protocol = instance->decoder_result->protocol;
|
const SubGhzProtocol* protocol = instance->decoder_result->protocol;
|
||||||
if(check_type) {
|
if(check_type) {
|
||||||
return (
|
return ((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
||||||
((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
protocol->encoder->deserialize && protocol->type == SubGhzProtocolTypeStatic;
|
||||||
protocol->encoder->deserialize && protocol->type == SubGhzProtocolTypeStatic);
|
|
||||||
}
|
}
|
||||||
return (
|
return ((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
||||||
((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
protocol->encoder->deserialize;
|
||||||
protocol->encoder->deserialize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void subghz_txrx_receiver_set_filter(SubGhzTxRx* instance, SubGhzProtocolFlag filter) {
|
void subghz_txrx_receiver_set_filter(SubGhzTxRx* instance, SubGhzProtocolFlag filter) {
|
||||||
@@ -609,4 +606,4 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance) {
|
|||||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency) {
|
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency) {
|
||||||
furi_assert(instance);
|
furi_assert(instance);
|
||||||
return subghz_devices_is_frequency_valid(instance->radio_device, frequency);
|
return subghz_devices_is_frequency_valid(instance->radio_device, frequency);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -333,4 +333,4 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance);
|
|||||||
* @param instance Pointer to a SubGhzTxRx
|
* @param instance Pointer to a SubGhzTxRx
|
||||||
* @return bool True if the frequency is valid
|
* @return bool True if the frequency is valid
|
||||||
*/
|
*/
|
||||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency);
|
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency);
|
||||||
|
|||||||
@@ -93,4 +93,4 @@ SubGhzProtocolStatus subghz_txrx_gen_secplus_v2_protocol(
|
|||||||
SubGhzProtocolStatus subghz_txrx_gen_secplus_v1_protocol(
|
SubGhzProtocolStatus subghz_txrx_gen_secplus_v1_protocol(
|
||||||
SubGhzTxRx* instance,
|
SubGhzTxRx* instance,
|
||||||
const char* name_preset,
|
const char* name_preset,
|
||||||
uint32_t frequency);
|
uint32_t frequency);
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
#include <lib/subghz/protocols/raw.h>
|
#include <lib/subghz/protocols/raw.h>
|
||||||
#include <toolbox/path.h>
|
#include <toolbox/path.h>
|
||||||
|
|
||||||
#define RAW_FILE_NAME "Raw_signal_"
|
|
||||||
#define TAG "SubGhzSceneReadRaw"
|
#define TAG "SubGhzSceneReadRaw"
|
||||||
|
|
||||||
|
#define RAW_FILE_NAME "Raw_signal_"
|
||||||
|
|
||||||
bool subghz_scene_read_raw_update_filename(SubGhz* subghz) {
|
bool subghz_scene_read_raw_update_filename(SubGhz* subghz) {
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
//set the path to read the file
|
//set the path to read the file
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user