mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-27 15:22:29 +03:00
Merge branch 'fz-dev' into dev
This commit is contained in:
commit
b9351649ed
@ -70,7 +70,7 @@ void minunit_print_progress() {
|
||||
}
|
||||
|
||||
void minunit_print_fail(const char* str) {
|
||||
printf(FURI_LOG_CLR_E "%s\r\n" FURI_LOG_CLR_RESET, str);
|
||||
printf(_FURI_LOG_CLR_E "%s\r\n" _FURI_LOG_CLR_RESET, str);
|
||||
}
|
||||
|
||||
void unit_tests_cli(Cli* cli, FuriString* args, void* context) {
|
||||
|
@ -12,7 +12,7 @@ App(
|
||||
],
|
||||
provides=["subghz_start"],
|
||||
icon="A_Sub1ghz_14",
|
||||
stack_size=2 * 1024,
|
||||
stack_size=3 * 1024,
|
||||
order=10,
|
||||
)
|
||||
|
||||
|
@ -419,6 +419,6 @@ void subghz_scene_read_raw_on_exit(void* context) {
|
||||
subghz->state_notifications = SubGhzNotificationStateIDLE;
|
||||
notification_message(subghz->notifications, &sequence_reset_rgb);
|
||||
|
||||
// filter restoration
|
||||
subghz_receiver_set_filter(subghz->txrx->receiver, SubGhzProtocolFlag_Decodable);
|
||||
//filter restoration
|
||||
subghz_receiver_set_filter(subghz->txrx->receiver, subghz->txrx->filter);
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
#include "../subghz_i.h"
|
||||
#include "../views/receiver.h"
|
||||
#include <dolphin/dolphin.h>
|
||||
#include <lib/subghz/protocols/bin_raw.h>
|
||||
|
||||
#define TAG "SubGhzSceneReceiver"
|
||||
|
||||
@ -160,6 +161,11 @@ void subghz_scene_receiver_on_enter(void* context) {
|
||||
}
|
||||
subghz_view_receiver_set_idx_menu(subghz->subghz_receiver, subghz->txrx->idx_menu_chosen);
|
||||
|
||||
//to use a universal decoder, we are looking for a link to it
|
||||
subghz->txrx->decoder_result = subghz_receiver_search_decoder_base_by_name(
|
||||
subghz->txrx->receiver, SUBGHZ_PROTOCOL_BIN_RAW_NAME);
|
||||
furi_assert(subghz->txrx->decoder_result);
|
||||
|
||||
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdReceiver);
|
||||
}
|
||||
|
||||
@ -223,6 +229,13 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz_hopper_update(subghz);
|
||||
subghz_scene_receiver_update_statusbar(subghz);
|
||||
}
|
||||
|
||||
//get RSSI
|
||||
float rssi = furi_hal_subghz_get_rssi();
|
||||
subghz_receiver_rssi(subghz->subghz_receiver, rssi);
|
||||
subghz_protocol_decoder_bin_raw_data_input_rssi(
|
||||
(SubGhzProtocolDecoderBinRAW*)subghz->txrx->decoder_result, rssi);
|
||||
|
||||
switch(subghz->state_notifications) {
|
||||
case SubGhzNotificationStateRx:
|
||||
notification_message(subghz->notifications, &sequence_blink_cyan_10);
|
||||
|
@ -5,6 +5,7 @@ enum SubGhzSettingIndex {
|
||||
SubGhzSettingIndexFrequency,
|
||||
SubGhzSettingIndexHopping,
|
||||
SubGhzSettingIndexModulation,
|
||||
SubGhzSettingIndexBinRAW,
|
||||
SubGhzSettingIndexSound,
|
||||
SubGhzSettingIndexLock,
|
||||
SubGhzSettingIndexRAWThesholdRSSI,
|
||||
@ -58,6 +59,15 @@ const uint32_t speaker_value[SPEAKER_COUNT] = {
|
||||
SubGhzSpeakerStateShutdown,
|
||||
SubGhzSpeakerStateEnable,
|
||||
};
|
||||
#define BIN_RAW_COUNT 2
|
||||
const char* const bin_raw_text[BIN_RAW_COUNT] = {
|
||||
"OFF",
|
||||
"ON",
|
||||
};
|
||||
const uint32_t bin_raw_value[BIN_RAW_COUNT] = {
|
||||
SubGhzProtocolFlag_Decodable,
|
||||
SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_BinRAW,
|
||||
};
|
||||
|
||||
uint8_t subghz_scene_receiver_config_next_frequency(const uint32_t value, void* context) {
|
||||
furi_assert(context);
|
||||
@ -190,6 +200,15 @@ static void subghz_scene_receiver_config_set_speaker(VariableItem* item) {
|
||||
subghz->txrx->speaker_state = speaker_value[index];
|
||||
}
|
||||
|
||||
static void subghz_scene_receiver_config_set_bin_raw(VariableItem* item) {
|
||||
SubGhz* subghz = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
|
||||
variable_item_set_current_value_text(item, bin_raw_text[index]);
|
||||
subghz->txrx->filter = bin_raw_value[index];
|
||||
subghz_receiver_set_filter(subghz->txrx->receiver, subghz->txrx->filter);
|
||||
}
|
||||
|
||||
static void subghz_scene_receiver_config_set_raw_threshold_rssi(VariableItem* item) {
|
||||
SubGhz* subghz = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
@ -262,6 +281,19 @@ void subghz_scene_receiver_config_on_enter(void* context) {
|
||||
// Enable speaker, will send all incoming noises and signals to speaker so you can listen how your remote sounds like :)
|
||||
item = variable_item_list_add(
|
||||
subghz->variable_item_list,
|
||||
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) !=
|
||||
SubGhzCustomEventManagerSet) {
|
||||
item = variable_item_list_add(
|
||||
subghz->variable_item_list,
|
||||
"Bin_RAW:",
|
||||
BIN_RAW_COUNT,
|
||||
subghz_scene_receiver_config_set_bin_raw,
|
||||
subghz);
|
||||
value_index = value_index_uint32(subghz->txrx->filter, bin_raw_value, BIN_RAW_COUNT);
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, bin_raw_text[value_index]);
|
||||
}
|
||||
|
||||
"Sound:",
|
||||
SPEAKER_COUNT,
|
||||
subghz_scene_receiver_config_set_speaker,
|
||||
|
@ -279,8 +279,8 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
|
||||
subghz_environment_set_protocol_registry(
|
||||
subghz->txrx->environment, (void*)&subghz_protocol_registry);
|
||||
subghz->txrx->receiver = subghz_receiver_alloc_init(subghz->txrx->environment);
|
||||
|
||||
subghz_receiver_set_filter(subghz->txrx->receiver, SubGhzProtocolFlag_Decodable);
|
||||
subghz->txrx->filter = SubGhzProtocolFlag_Decodable;
|
||||
subghz_receiver_set_filter(subghz->txrx->receiver, subghz->txrx->filter);
|
||||
|
||||
subghz_worker_set_overrun_callback(
|
||||
subghz->txrx->worker, (SubGhzWorkerOverrunCallback)subghz_receiver_reset);
|
||||
@ -304,6 +304,8 @@ void subghz_free(SubGhz* subghz, bool alloc_for_tx_only) {
|
||||
subghz->rpc_ctx = NULL;
|
||||
}
|
||||
|
||||
subghz_speaker_off(subghz);
|
||||
|
||||
#if FURI_DEBUG
|
||||
// Packet Test
|
||||
view_dispatcher_remove_view(subghz->view_dispatcher, SubGhzViewIdTestPacket);
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <furi.h>
|
||||
|
||||
#define SUBGHZ_HISTORY_MAX 50
|
||||
#define SUBGHZ_HISTORY_FREE_HEAP 20480
|
||||
#define TAG "SubGhzHistory"
|
||||
|
||||
typedef struct {
|
||||
@ -120,8 +121,12 @@ FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx
|
||||
}
|
||||
bool subghz_history_get_text_space_left(SubGhzHistory* instance, FuriString* output) {
|
||||
furi_assert(instance);
|
||||
if(memmgr_get_free_heap() < SUBGHZ_HISTORY_FREE_HEAP) {
|
||||
if(output != NULL) furi_string_printf(output, " Free heap LOW");
|
||||
return true;
|
||||
}
|
||||
if(instance->last_index_write == SUBGHZ_HISTORY_MAX) {
|
||||
if(output != NULL) furi_string_printf(output, "Memory is FULL");
|
||||
if(output != NULL) furi_string_printf(output, " Memory is FULL");
|
||||
return true;
|
||||
}
|
||||
if(output != NULL)
|
||||
@ -144,6 +149,7 @@ bool subghz_history_add_to_history(
|
||||
furi_assert(instance);
|
||||
furi_assert(context);
|
||||
|
||||
if(memmgr_get_free_heap() < SUBGHZ_HISTORY_FREE_HEAP) return false;
|
||||
if(instance->last_index_write >= SUBGHZ_HISTORY_MAX) return false;
|
||||
|
||||
SubGhzProtocolDecoderBase* decoder_base = context;
|
||||
@ -202,27 +208,31 @@ bool subghz_history_add_to_history(
|
||||
}
|
||||
uint8_t key_data[sizeof(uint64_t)] = {0};
|
||||
if(!flipper_format_read_hex(item->flipper_string, "Key", key_data, sizeof(uint64_t))) {
|
||||
FURI_LOG_E(TAG, "Missing Key");
|
||||
break;
|
||||
FURI_LOG_D(TAG, "No Key");
|
||||
}
|
||||
uint64_t data = 0;
|
||||
for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
|
||||
data = (data << 8) | key_data[i];
|
||||
}
|
||||
if(!(uint32_t)(data >> 32)) {
|
||||
furi_string_printf(
|
||||
item->item_str,
|
||||
"%s %lX",
|
||||
furi_string_get_cstr(instance->tmp_string),
|
||||
(uint32_t)(data & 0xFFFFFFFF));
|
||||
if(data != 0) {
|
||||
if(!(uint32_t)(data >> 32)) {
|
||||
furi_string_printf(
|
||||
item->item_str,
|
||||
"%s %lX",
|
||||
furi_string_get_cstr(instance->tmp_string),
|
||||
(uint32_t)(data & 0xFFFFFFFF));
|
||||
} else {
|
||||
furi_string_printf(
|
||||
item->item_str,
|
||||
"%s %lX%08lX",
|
||||
furi_string_get_cstr(instance->tmp_string),
|
||||
(uint32_t)(data >> 32),
|
||||
(uint32_t)(data & 0xFFFFFFFF));
|
||||
}
|
||||
} else {
|
||||
furi_string_printf(
|
||||
item->item_str,
|
||||
"%s %lX%08lX",
|
||||
furi_string_get_cstr(instance->tmp_string),
|
||||
(uint32_t)(data >> 32),
|
||||
(uint32_t)(data & 0xFFFFFFFF));
|
||||
furi_string_printf(item->item_str, "%s", furi_string_get_cstr(instance->tmp_string));
|
||||
}
|
||||
|
||||
} while(false);
|
||||
|
||||
furi_string_free(text);
|
||||
|
@ -62,6 +62,7 @@ struct SubGhzTxRx {
|
||||
SubGhzEnvironment* environment;
|
||||
SubGhzReceiver* receiver;
|
||||
SubGhzTransmitter* transmitter;
|
||||
SubGhzProtocolFlag filter;
|
||||
SubGhzProtocolDecoderBase* decoder_result;
|
||||
FlipperFormat* fff_data;
|
||||
SecureData* secure_data;
|
||||
|
@ -12,6 +12,8 @@
|
||||
#define MENU_ITEMS 4u
|
||||
#define UNLOCK_CNT 3
|
||||
|
||||
#define SUBGHZ_RAW_TRESHOLD_MIN -90.0f
|
||||
|
||||
typedef struct {
|
||||
FuriString* item_str;
|
||||
uint8_t type;
|
||||
@ -62,6 +64,7 @@ typedef struct {
|
||||
uint16_t history_item;
|
||||
SubGhzViewReceiverBarShow bar_show;
|
||||
SubGhzViewReceiverMode mode;
|
||||
uint8_t u_rssi;
|
||||
} SubGhzViewReceiverModel;
|
||||
|
||||
void subghz_view_receiver_set_mode(
|
||||
@ -71,6 +74,21 @@ void subghz_view_receiver_set_mode(
|
||||
subghz_receiver->view, SubGhzViewReceiverModel * model, { model->mode = mode; }, true);
|
||||
}
|
||||
|
||||
void subghz_receiver_rssi(SubGhzViewReceiver* instance, float rssi) {
|
||||
furi_assert(instance);
|
||||
with_view_model(
|
||||
instance->view,
|
||||
SubGhzViewReceiverModel * model,
|
||||
{
|
||||
if(rssi < SUBGHZ_RAW_TRESHOLD_MIN) {
|
||||
model->u_rssi = 0;
|
||||
} else {
|
||||
model->u_rssi = (uint8_t)(rssi - SUBGHZ_RAW_TRESHOLD_MIN);
|
||||
}
|
||||
},
|
||||
true);
|
||||
}
|
||||
|
||||
void subghz_view_receiver_set_lock(SubGhzViewReceiver* subghz_receiver, SubGhzLock lock) {
|
||||
furi_assert(subghz_receiver);
|
||||
subghz_receiver->lock_count = 0;
|
||||
@ -189,6 +207,16 @@ static void subghz_view_receiver_draw_frame(Canvas* canvas, uint16_t idx, bool s
|
||||
canvas_draw_dot(canvas, scrollbar ? 121 : 126, (0 + idx * FRAME_HEIGHT) + 11);
|
||||
}
|
||||
|
||||
static void subghz_view_rssi_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
|
||||
for(uint8_t i = 1; i < model->u_rssi; i++) {
|
||||
if(i % 5) {
|
||||
canvas_draw_dot(canvas, 46 + i, 50);
|
||||
canvas_draw_dot(canvas, 47 + i, 51);
|
||||
canvas_draw_dot(canvas, 46 + i, 52);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
|
||||
canvas_clear(canvas);
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
@ -251,6 +279,7 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
|
||||
}
|
||||
}
|
||||
|
||||
subghz_view_rssi_draw(canvas, model);
|
||||
switch(model->bar_show) {
|
||||
case SubGhzViewReceiverBarShowLock:
|
||||
canvas_draw_icon(canvas, 64, 55, &I_Lock_7x8);
|
||||
|
@ -12,6 +12,8 @@ void subghz_view_receiver_set_mode(
|
||||
SubGhzViewReceiver* subghz_receiver,
|
||||
SubGhzViewReceiverMode mode);
|
||||
|
||||
void subghz_receiver_rssi(SubGhzViewReceiver* instance, float rssi);
|
||||
|
||||
void subghz_view_receiver_set_lock(SubGhzViewReceiver* subghz_receiver, SubGhzLock keyboard);
|
||||
|
||||
void subghz_view_receiver_set_callback(
|
||||
|
@ -84,7 +84,8 @@ void subghz_view_transmitter_draw(Canvas* canvas, SubGhzViewTransmitterModel* mo
|
||||
canvas_clear(canvas);
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
elements_multiline_text(canvas, 0, 7, furi_string_get_cstr(model->key_str));
|
||||
elements_multiline_text_aligned(
|
||||
canvas, 0, 0, AlignLeft, AlignTop, furi_string_get_cstr(model->key_str));
|
||||
canvas_draw_str(canvas, 78, 7, furi_string_get_cstr(model->frequency_str));
|
||||
canvas_draw_str(canvas, 113, 7, furi_string_get_cstr(model->preset_str));
|
||||
|
||||
|
@ -69,6 +69,19 @@ void picopass_scene_read_card_success_on_enter(void* context) {
|
||||
furi_string_cat_printf(sio_str, "+SIO");
|
||||
}
|
||||
|
||||
if(pacs->key) {
|
||||
if(pacs->sio) {
|
||||
furi_string_cat_printf(sio_str, " ");
|
||||
}
|
||||
furi_string_cat_printf(sio_str, "Key: ");
|
||||
|
||||
uint8_t key[PICOPASS_BLOCK_LEN];
|
||||
memcpy(key, &pacs->key, PICOPASS_BLOCK_LEN);
|
||||
for(uint8_t i = 0; i < PICOPASS_BLOCK_LEN; i++) {
|
||||
furi_string_cat_printf(sio_str, "%02X", key[i]);
|
||||
}
|
||||
}
|
||||
|
||||
widget_add_button_element(
|
||||
widget,
|
||||
GuiButtonTypeLeft,
|
||||
|
@ -58,7 +58,7 @@ uint8_t* canvas_get_buffer(Canvas* canvas) {
|
||||
return u8g2_GetBufferPtr(&canvas->fb);
|
||||
}
|
||||
|
||||
size_t canvas_get_buffer_size(Canvas* canvas) {
|
||||
size_t canvas_get_buffer_size(const Canvas* canvas) {
|
||||
furi_assert(canvas);
|
||||
return u8g2_GetBufferTileWidth(&canvas->fb) * u8g2_GetBufferTileHeight(&canvas->fb) * 8;
|
||||
}
|
||||
@ -76,17 +76,17 @@ void canvas_frame_set(
|
||||
canvas->height = height;
|
||||
}
|
||||
|
||||
uint8_t canvas_width(Canvas* canvas) {
|
||||
uint8_t canvas_width(const Canvas* canvas) {
|
||||
furi_assert(canvas);
|
||||
return canvas->width;
|
||||
}
|
||||
|
||||
uint8_t canvas_height(Canvas* canvas) {
|
||||
uint8_t canvas_height(const Canvas* canvas) {
|
||||
furi_assert(canvas);
|
||||
return canvas->height;
|
||||
}
|
||||
|
||||
uint8_t canvas_current_font_height(Canvas* canvas) {
|
||||
uint8_t canvas_current_font_height(const Canvas* canvas) {
|
||||
furi_assert(canvas);
|
||||
uint8_t font_height = u8g2_GetMaxCharHeight(&canvas->fb);
|
||||
|
||||
@ -97,10 +97,10 @@ uint8_t canvas_current_font_height(Canvas* canvas) {
|
||||
return font_height;
|
||||
}
|
||||
|
||||
CanvasFontParameters* canvas_get_font_params(Canvas* canvas, Font font) {
|
||||
const CanvasFontParameters* canvas_get_font_params(const Canvas* canvas, Font font) {
|
||||
furi_assert(canvas);
|
||||
furi_assert(font < FontTotalNumber);
|
||||
return (CanvasFontParameters*)&canvas_font_params[font];
|
||||
return &canvas_font_params[font];
|
||||
}
|
||||
|
||||
void canvas_clear(Canvas* canvas) {
|
||||
|
@ -86,7 +86,7 @@ void canvas_commit(Canvas* canvas);
|
||||
*
|
||||
* @return width in pixels.
|
||||
*/
|
||||
uint8_t canvas_width(Canvas* canvas);
|
||||
uint8_t canvas_width(const Canvas* canvas);
|
||||
|
||||
/** Get Canvas height
|
||||
*
|
||||
@ -94,7 +94,7 @@ uint8_t canvas_width(Canvas* canvas);
|
||||
*
|
||||
* @return height in pixels.
|
||||
*/
|
||||
uint8_t canvas_height(Canvas* canvas);
|
||||
uint8_t canvas_height(const Canvas* canvas);
|
||||
|
||||
/** Get current font height
|
||||
*
|
||||
@ -102,7 +102,7 @@ uint8_t canvas_height(Canvas* canvas);
|
||||
*
|
||||
* @return height in pixels.
|
||||
*/
|
||||
uint8_t canvas_current_font_height(Canvas* canvas);
|
||||
uint8_t canvas_current_font_height(const Canvas* canvas);
|
||||
|
||||
/** Get font parameters
|
||||
*
|
||||
@ -111,7 +111,7 @@ uint8_t canvas_current_font_height(Canvas* canvas);
|
||||
*
|
||||
* @return pointer to CanvasFontParameters structure
|
||||
*/
|
||||
CanvasFontParameters* canvas_get_font_params(Canvas* canvas, Font font);
|
||||
const CanvasFontParameters* canvas_get_font_params(const Canvas* canvas, Font font);
|
||||
|
||||
/** Clear canvas
|
||||
*
|
||||
|
@ -49,7 +49,7 @@ uint8_t* canvas_get_buffer(Canvas* canvas);
|
||||
*
|
||||
* @return size of canvas in bytes
|
||||
*/
|
||||
size_t canvas_get_buffer_size(Canvas* canvas);
|
||||
size_t canvas_get_buffer_size(const Canvas* canvas);
|
||||
|
||||
/** Set drawing region relative to real screen buffer
|
||||
*
|
||||
|
@ -639,7 +639,7 @@ void elements_text_box(
|
||||
bool inversed_present = false;
|
||||
Font current_font = FontSecondary;
|
||||
Font prev_font = FontSecondary;
|
||||
CanvasFontParameters* font_params = canvas_get_font_params(canvas, current_font);
|
||||
const CanvasFontParameters* font_params = canvas_get_font_params(canvas, current_font);
|
||||
|
||||
// Fill line parameters
|
||||
uint8_t line_leading_min = font_params->leading_min;
|
||||
|
@ -467,7 +467,7 @@ void gui_remove_framebuffer_callback(Gui* gui, GuiCanvasCommitCallback callback,
|
||||
gui_unlock(gui);
|
||||
}
|
||||
|
||||
size_t gui_get_framebuffer_size(Gui* gui) {
|
||||
size_t gui_get_framebuffer_size(const Gui* gui) {
|
||||
furi_assert(gui);
|
||||
return canvas_get_buffer_size(gui->canvas);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ void gui_remove_framebuffer_callback(Gui* gui, GuiCanvasCommitCallback callback,
|
||||
* @param gui Gui instance
|
||||
* @return size_t size of frame buffer in bytes
|
||||
*/
|
||||
size_t gui_get_framebuffer_size(Gui* gui);
|
||||
size_t gui_get_framebuffer_size(const Gui* gui);
|
||||
|
||||
/** Set lockdown mode
|
||||
*
|
||||
|
@ -29,7 +29,7 @@ void icon_animation_set_update_callback(
|
||||
instance->callback_context = context;
|
||||
}
|
||||
|
||||
const uint8_t* icon_animation_get_data(IconAnimation* instance) {
|
||||
const uint8_t* icon_animation_get_data(const IconAnimation* instance) {
|
||||
return instance->icon->frames[instance->frame];
|
||||
}
|
||||
|
||||
@ -51,12 +51,12 @@ void icon_animation_timer_callback(void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t icon_animation_get_width(IconAnimation* instance) {
|
||||
uint8_t icon_animation_get_width(const IconAnimation* instance) {
|
||||
furi_assert(instance);
|
||||
return instance->icon->width;
|
||||
}
|
||||
|
||||
uint8_t icon_animation_get_height(IconAnimation* instance) {
|
||||
uint8_t icon_animation_get_height(const IconAnimation* instance) {
|
||||
furi_assert(instance);
|
||||
return instance->icon->height;
|
||||
}
|
||||
@ -83,7 +83,7 @@ void icon_animation_stop(IconAnimation* instance) {
|
||||
}
|
||||
}
|
||||
|
||||
bool icon_animation_is_last_frame(IconAnimation* instance) {
|
||||
bool icon_animation_is_last_frame(const IconAnimation* instance) {
|
||||
furi_assert(instance);
|
||||
return instance->icon->frame_count - instance->frame <= 1;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ void icon_animation_set_update_callback(
|
||||
*
|
||||
* @return width in pixels
|
||||
*/
|
||||
uint8_t icon_animation_get_width(IconAnimation* instance);
|
||||
uint8_t icon_animation_get_width(const IconAnimation* instance);
|
||||
|
||||
/** Get icon animation height
|
||||
*
|
||||
@ -63,7 +63,7 @@ uint8_t icon_animation_get_width(IconAnimation* instance);
|
||||
*
|
||||
* @return height in pixels
|
||||
*/
|
||||
uint8_t icon_animation_get_height(IconAnimation* instance);
|
||||
uint8_t icon_animation_get_height(const IconAnimation* instance);
|
||||
|
||||
/** Start icon animation
|
||||
*
|
||||
@ -83,7 +83,7 @@ void icon_animation_stop(IconAnimation* instance);
|
||||
*
|
||||
* @return true if last frame
|
||||
*/
|
||||
bool icon_animation_is_last_frame(IconAnimation* instance);
|
||||
bool icon_animation_is_last_frame(const IconAnimation* instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ struct IconAnimation {
|
||||
*
|
||||
* @return pointer to current frame XBM bitmap data
|
||||
*/
|
||||
const uint8_t* icon_animation_get_data(IconAnimation* instance);
|
||||
const uint8_t* icon_animation_get_data(const IconAnimation* instance);
|
||||
|
||||
/** Advance to next frame
|
||||
*
|
||||
|
@ -74,7 +74,7 @@ static void widget_element_text_scroll_fill_lines(Canvas* canvas, WidgetElement*
|
||||
}
|
||||
// Set canvas font
|
||||
canvas_set_font(canvas, line_tmp.font);
|
||||
CanvasFontParameters* params = canvas_get_font_params(canvas, line_tmp.font);
|
||||
const CanvasFontParameters* params = canvas_get_font_params(canvas, line_tmp.font);
|
||||
total_height += params->height;
|
||||
if(total_height > model->height) {
|
||||
model->scroll_pos_total++;
|
||||
@ -138,7 +138,7 @@ static void widget_element_text_scroll_draw(Canvas* canvas, WidgetElement* eleme
|
||||
TextScrollLineArray_next(it), curr_line++) {
|
||||
if(curr_line < model->scroll_pos_current) continue;
|
||||
TextScrollLineArray* line = TextScrollLineArray_ref(it);
|
||||
CanvasFontParameters* params = canvas_get_font_params(canvas, line->font);
|
||||
const CanvasFontParameters* params = canvas_get_font_params(canvas, line->font);
|
||||
if(y + params->descender > model->y + model->height) break;
|
||||
canvas_set_font(canvas, line->font);
|
||||
if(line->horizontal == AlignLeft) {
|
||||
|
@ -34,7 +34,7 @@ void scene_manager_set_scene_state(SceneManager* scene_manager, uint32_t scene_i
|
||||
scene_manager->scene[scene_id].state = state;
|
||||
}
|
||||
|
||||
uint32_t scene_manager_get_scene_state(SceneManager* scene_manager, uint32_t scene_id) {
|
||||
uint32_t scene_manager_get_scene_state(const SceneManager* scene_manager, uint32_t scene_id) {
|
||||
furi_assert(scene_manager);
|
||||
furi_assert(scene_id < scene_manager->scene_handlers->scene_num);
|
||||
|
||||
@ -184,7 +184,7 @@ bool scene_manager_search_and_switch_to_previous_scene_one_of(
|
||||
return scene_found;
|
||||
}
|
||||
|
||||
bool scene_manager_has_previous_scene(SceneManager* scene_manager, uint32_t scene_id) {
|
||||
bool scene_manager_has_previous_scene(const SceneManager* scene_manager, uint32_t scene_id) {
|
||||
furi_assert(scene_manager);
|
||||
bool scene_found = false;
|
||||
|
||||
|
@ -63,7 +63,7 @@ void scene_manager_set_scene_state(SceneManager* scene_manager, uint32_t scene_i
|
||||
*
|
||||
* @return Scene state
|
||||
*/
|
||||
uint32_t scene_manager_get_scene_state(SceneManager* scene_manager, uint32_t scene_id);
|
||||
uint32_t scene_manager_get_scene_state(const SceneManager* scene_manager, uint32_t scene_id);
|
||||
|
||||
/** Scene Manager allocation and configuration
|
||||
*
|
||||
@ -134,7 +134,7 @@ bool scene_manager_previous_scene(SceneManager* scene_manager);
|
||||
*
|
||||
* @return true if previous scene was found, false otherwise
|
||||
*/
|
||||
bool scene_manager_has_previous_scene(SceneManager* scene_manager, uint32_t scene_id);
|
||||
bool scene_manager_has_previous_scene(const SceneManager* scene_manager, uint32_t scene_id);
|
||||
|
||||
/** Search and switch to previous Scene
|
||||
*
|
||||
|
@ -89,7 +89,7 @@ void view_port_set_width(ViewPort* view_port, uint8_t width) {
|
||||
view_port->width = width;
|
||||
}
|
||||
|
||||
uint8_t view_port_get_width(ViewPort* view_port) {
|
||||
uint8_t view_port_get_width(const ViewPort* view_port) {
|
||||
furi_assert(view_port);
|
||||
return view_port->width;
|
||||
}
|
||||
@ -99,7 +99,7 @@ void view_port_set_height(ViewPort* view_port, uint8_t height) {
|
||||
view_port->height = height;
|
||||
}
|
||||
|
||||
uint8_t view_port_get_height(ViewPort* view_port) {
|
||||
uint8_t view_port_get_height(const ViewPort* view_port) {
|
||||
furi_assert(view_port);
|
||||
return view_port->height;
|
||||
}
|
||||
@ -112,7 +112,7 @@ void view_port_enabled_set(ViewPort* view_port, bool enabled) {
|
||||
}
|
||||
}
|
||||
|
||||
bool view_port_is_enabled(ViewPort* view_port) {
|
||||
bool view_port_is_enabled(const ViewPort* view_port) {
|
||||
furi_assert(view_port);
|
||||
return view_port->is_enabled;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ void view_port_free(ViewPort* view_port);
|
||||
* @param width wanted width, 0 - auto.
|
||||
*/
|
||||
void view_port_set_width(ViewPort* view_port, uint8_t width);
|
||||
uint8_t view_port_get_width(ViewPort* view_port);
|
||||
uint8_t view_port_get_width(const ViewPort* view_port);
|
||||
|
||||
/** Set view_port height.
|
||||
*
|
||||
@ -66,7 +66,7 @@ uint8_t view_port_get_width(ViewPort* view_port);
|
||||
* @param height wanted height, 0 - auto.
|
||||
*/
|
||||
void view_port_set_height(ViewPort* view_port, uint8_t height);
|
||||
uint8_t view_port_get_height(ViewPort* view_port);
|
||||
uint8_t view_port_get_height(const ViewPort* view_port);
|
||||
|
||||
/** Enable or disable view_port rendering.
|
||||
*
|
||||
@ -75,7 +75,7 @@ uint8_t view_port_get_height(ViewPort* view_port);
|
||||
* @warning automatically dispatches update event
|
||||
*/
|
||||
void view_port_enabled_set(ViewPort* view_port, bool enabled);
|
||||
bool view_port_is_enabled(ViewPort* view_port);
|
||||
bool view_port_is_enabled(const ViewPort* view_port);
|
||||
|
||||
/** ViewPort event callbacks
|
||||
*
|
||||
|
@ -262,7 +262,7 @@ void loader_unlock(Loader* instance) {
|
||||
FURI_CRITICAL_EXIT();
|
||||
}
|
||||
|
||||
bool loader_is_locked(Loader* instance) {
|
||||
bool loader_is_locked(const Loader* instance) {
|
||||
return instance->lock_count > 0;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ bool loader_lock(Loader* instance);
|
||||
void loader_unlock(Loader* instance);
|
||||
|
||||
/** Get loader lock status */
|
||||
bool loader_is_locked(Loader* instance);
|
||||
bool loader_is_locked(const Loader* instance);
|
||||
|
||||
/** Show primary loader */
|
||||
void loader_show_menu();
|
||||
|
@ -81,7 +81,7 @@ void locale_format_time(
|
||||
*
|
||||
* @return The Locale DateFormat.
|
||||
*/
|
||||
LocaleDateFormat locale_get_date_format();
|
||||
LocaleDateFormat locale_get_date_format(void);
|
||||
|
||||
/** Set Locale DateFormat
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,13.1,,
|
||||
Version,+,14.0,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@ -522,7 +522,7 @@ Function,-,bzero,void,"void*, size_t"
|
||||
Function,-,calloc,void*,"size_t, size_t"
|
||||
Function,+,canvas_clear,void,Canvas*
|
||||
Function,+,canvas_commit,void,Canvas*
|
||||
Function,+,canvas_current_font_height,uint8_t,Canvas*
|
||||
Function,+,canvas_current_font_height,uint8_t,const Canvas*
|
||||
Function,+,canvas_draw_bitmap,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t, const uint8_t*"
|
||||
Function,+,canvas_draw_box,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t"
|
||||
Function,+,canvas_draw_circle,void,"Canvas*, uint8_t, uint8_t, uint8_t"
|
||||
@ -539,9 +539,9 @@ Function,+,canvas_draw_str,void,"Canvas*, uint8_t, uint8_t, const char*"
|
||||
Function,+,canvas_draw_str_aligned,void,"Canvas*, uint8_t, uint8_t, Align, Align, const char*"
|
||||
Function,+,canvas_draw_triangle,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t, CanvasDirection"
|
||||
Function,+,canvas_draw_xbm,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t, const uint8_t*"
|
||||
Function,+,canvas_get_font_params,CanvasFontParameters*,"Canvas*, Font"
|
||||
Function,+,canvas_get_font_params,const CanvasFontParameters*,"const Canvas*, Font"
|
||||
Function,+,canvas_glyph_width,uint8_t,"Canvas*, char"
|
||||
Function,+,canvas_height,uint8_t,Canvas*
|
||||
Function,+,canvas_height,uint8_t,const Canvas*
|
||||
Function,+,canvas_invert_color,void,Canvas*
|
||||
Function,+,canvas_reset,void,Canvas*
|
||||
Function,+,canvas_set_bitmap_mode,void,"Canvas*, _Bool"
|
||||
@ -550,7 +550,7 @@ Function,+,canvas_set_custom_u8g2_font,void,"Canvas*, const uint8_t*"
|
||||
Function,+,canvas_set_font,void,"Canvas*, Font"
|
||||
Function,+,canvas_set_font_direction,void,"Canvas*, CanvasDirection"
|
||||
Function,+,canvas_string_width,uint16_t,"Canvas*, const char*"
|
||||
Function,+,canvas_width,uint8_t,Canvas*
|
||||
Function,+,canvas_width,uint8_t,const Canvas*
|
||||
Function,-,cfree,void,void*
|
||||
Function,-,clearerr,void,FILE*
|
||||
Function,-,clearerr_unlocked,void,FILE*
|
||||
@ -1063,9 +1063,9 @@ Function,+,furi_hal_spi_bus_handle_deinit,void,FuriHalSpiBusHandle*
|
||||
Function,+,furi_hal_spi_bus_handle_init,void,FuriHalSpiBusHandle*
|
||||
Function,+,furi_hal_spi_bus_init,void,FuriHalSpiBus*
|
||||
Function,+,furi_hal_spi_bus_rx,_Bool,"FuriHalSpiBusHandle*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_trx,_Bool,"FuriHalSpiBusHandle*, uint8_t*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_trx,_Bool,"FuriHalSpiBusHandle*, const uint8_t*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_trx_dma,_Bool,"FuriHalSpiBusHandle*, uint8_t*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_tx,_Bool,"FuriHalSpiBusHandle*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_tx,_Bool,"FuriHalSpiBusHandle*, const uint8_t*, size_t, uint32_t"
|
||||
Function,-,furi_hal_spi_config_deinit_early,void,
|
||||
Function,-,furi_hal_spi_config_init,void,
|
||||
Function,-,furi_hal_spi_config_init_early,void,
|
||||
@ -1123,6 +1123,7 @@ Function,+,furi_kernel_unlock,int32_t,
|
||||
Function,+,furi_log_get_level,FuriLogLevel,
|
||||
Function,-,furi_log_init,void,
|
||||
Function,+,furi_log_print_format,void,"FuriLogLevel, const char*, const char*, ..."
|
||||
Function,+,furi_log_print_raw_format,void,"FuriLogLevel, const char*, ..."
|
||||
Function,+,furi_log_set_level,void,FuriLogLevel
|
||||
Function,-,furi_log_set_puts,void,FuriLogPuts
|
||||
Function,-,furi_log_set_timestamp,void,FuriLogTimestamp
|
||||
@ -1287,7 +1288,7 @@ Function,+,gui_add_framebuffer_callback,void,"Gui*, GuiCanvasCommitCallback, voi
|
||||
Function,+,gui_add_view_port,void,"Gui*, ViewPort*, GuiLayer"
|
||||
Function,+,gui_direct_draw_acquire,Canvas*,Gui*
|
||||
Function,+,gui_direct_draw_release,void,Gui*
|
||||
Function,+,gui_get_framebuffer_size,size_t,Gui*
|
||||
Function,+,gui_get_framebuffer_size,size_t,const Gui*
|
||||
Function,+,gui_remove_framebuffer_callback,void,"Gui*, GuiCanvasCommitCallback, void*"
|
||||
Function,+,gui_remove_view_port,void,"Gui*, ViewPort*"
|
||||
Function,+,gui_set_lockdown,void,"Gui*, _Bool"
|
||||
@ -1301,9 +1302,9 @@ Function,+,hmac_sha256_init,void,"hmac_sha256_context*, const uint8_t*"
|
||||
Function,+,hmac_sha256_update,void,"const hmac_sha256_context*, const uint8_t*, unsigned"
|
||||
Function,+,icon_animation_alloc,IconAnimation*,const Icon*
|
||||
Function,+,icon_animation_free,void,IconAnimation*
|
||||
Function,+,icon_animation_get_height,uint8_t,IconAnimation*
|
||||
Function,+,icon_animation_get_width,uint8_t,IconAnimation*
|
||||
Function,+,icon_animation_is_last_frame,_Bool,IconAnimation*
|
||||
Function,+,icon_animation_get_height,uint8_t,const IconAnimation*
|
||||
Function,+,icon_animation_get_width,uint8_t,const IconAnimation*
|
||||
Function,+,icon_animation_is_last_frame,_Bool,const IconAnimation*
|
||||
Function,+,icon_animation_set_update_callback,void,"IconAnimation*, IconAnimationCallback, void*"
|
||||
Function,+,icon_animation_start,void,IconAnimation*
|
||||
Function,+,icon_animation_stop,void,IconAnimation*
|
||||
@ -1352,7 +1353,7 @@ Function,-,ldiv,ldiv_t,"long, long"
|
||||
Function,-,llabs,long long,long long
|
||||
Function,-,lldiv,lldiv_t,"long long, long long"
|
||||
Function,+,loader_get_pubsub,FuriPubSub*,Loader*
|
||||
Function,+,loader_is_locked,_Bool,Loader*
|
||||
Function,+,loader_is_locked,_Bool,const Loader*
|
||||
Function,+,loader_lock,_Bool,Loader*
|
||||
Function,+,loader_show_menu,void,
|
||||
Function,+,loader_start,LoaderStatus,"Loader*, const char*, const char*"
|
||||
@ -1570,11 +1571,11 @@ Function,+,saved_struct_save,_Bool,"const char*, void*, size_t, uint8_t, uint8_t
|
||||
Function,-,scanf,int,"const char*, ..."
|
||||
Function,+,scene_manager_alloc,SceneManager*,"const SceneManagerHandlers*, void*"
|
||||
Function,+,scene_manager_free,void,SceneManager*
|
||||
Function,+,scene_manager_get_scene_state,uint32_t,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_get_scene_state,uint32_t,"const SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_handle_back_event,_Bool,SceneManager*
|
||||
Function,+,scene_manager_handle_custom_event,_Bool,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_handle_tick_event,void,SceneManager*
|
||||
Function,+,scene_manager_has_previous_scene,_Bool,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_has_previous_scene,_Bool,"const SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_next_scene,void,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_previous_scene,_Bool,SceneManager*
|
||||
Function,+,scene_manager_search_and_switch_to_another_scene,_Bool,"SceneManager*, uint32_t"
|
||||
@ -1946,11 +1947,11 @@ Function,+,view_port_alloc,ViewPort*,
|
||||
Function,+,view_port_draw_callback_set,void,"ViewPort*, ViewPortDrawCallback, void*"
|
||||
Function,+,view_port_enabled_set,void,"ViewPort*, _Bool"
|
||||
Function,+,view_port_free,void,ViewPort*
|
||||
Function,+,view_port_get_height,uint8_t,ViewPort*
|
||||
Function,+,view_port_get_height,uint8_t,const ViewPort*
|
||||
Function,+,view_port_get_orientation,ViewPortOrientation,const ViewPort*
|
||||
Function,+,view_port_get_width,uint8_t,ViewPort*
|
||||
Function,+,view_port_get_width,uint8_t,const ViewPort*
|
||||
Function,+,view_port_input_callback_set,void,"ViewPort*, ViewPortInputCallback, void*"
|
||||
Function,+,view_port_is_enabled,_Bool,ViewPort*
|
||||
Function,+,view_port_is_enabled,_Bool,const ViewPort*
|
||||
Function,+,view_port_set_height,void,"ViewPort*, uint8_t"
|
||||
Function,+,view_port_set_orientation,void,"ViewPort*, ViewPortOrientation"
|
||||
Function,+,view_port_set_width,void,"ViewPort*, uint8_t"
|
||||
|
|
@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,13.1,,
|
||||
Version,+,14.0,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@ -615,7 +615,7 @@ Function,-,bzero,void,"void*, size_t"
|
||||
Function,-,calloc,void*,"size_t, size_t"
|
||||
Function,+,canvas_clear,void,Canvas*
|
||||
Function,+,canvas_commit,void,Canvas*
|
||||
Function,+,canvas_current_font_height,uint8_t,Canvas*
|
||||
Function,+,canvas_current_font_height,uint8_t,const Canvas*
|
||||
Function,+,canvas_draw_bitmap,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t, const uint8_t*"
|
||||
Function,+,canvas_draw_box,void,"Canvas*, uint8_t, uint8_t, uint8_t, uint8_t"
|
||||
Function,+,canvas_draw_circle,void,"Canvas*, uint8_t, uint8_t, uint8_t"
|
||||
@ -651,7 +651,7 @@ Function,+,canvas_set_font,void,"Canvas*, Font"
|
||||
Function,+,canvas_set_font_direction,void,"Canvas*, CanvasDirection"
|
||||
Function,-,canvas_set_orientation,void,"Canvas*, CanvasOrientation"
|
||||
Function,+,canvas_string_width,uint16_t,"Canvas*, const char*"
|
||||
Function,+,canvas_width,uint8_t,Canvas*
|
||||
Function,+,canvas_width,uint8_t,const Canvas*
|
||||
Function,-,cbrt,double,double
|
||||
Function,-,cbrtf,float,float
|
||||
Function,-,cbrtl,long double,long double
|
||||
@ -1334,9 +1334,9 @@ Function,+,furi_hal_spi_bus_handle_deinit,void,FuriHalSpiBusHandle*
|
||||
Function,+,furi_hal_spi_bus_handle_init,void,FuriHalSpiBusHandle*
|
||||
Function,+,furi_hal_spi_bus_init,void,FuriHalSpiBus*
|
||||
Function,+,furi_hal_spi_bus_rx,_Bool,"FuriHalSpiBusHandle*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_trx,_Bool,"FuriHalSpiBusHandle*, uint8_t*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_trx,_Bool,"FuriHalSpiBusHandle*, const uint8_t*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_trx_dma,_Bool,"FuriHalSpiBusHandle*, uint8_t*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_tx,_Bool,"FuriHalSpiBusHandle*, uint8_t*, size_t, uint32_t"
|
||||
Function,+,furi_hal_spi_bus_tx,_Bool,"FuriHalSpiBusHandle*, const uint8_t*, size_t, uint32_t"
|
||||
Function,-,furi_hal_spi_config_deinit_early,void,
|
||||
Function,-,furi_hal_spi_config_init,void,
|
||||
Function,-,furi_hal_spi_config_init_early,void,
|
||||
@ -1433,6 +1433,7 @@ Function,+,furi_kernel_unlock,int32_t,
|
||||
Function,+,furi_log_get_level,FuriLogLevel,
|
||||
Function,-,furi_log_init,void,
|
||||
Function,+,furi_log_print_format,void,"FuriLogLevel, const char*, const char*, ..."
|
||||
Function,+,furi_log_print_raw_format,void,"FuriLogLevel, const char*, ..."
|
||||
Function,+,furi_log_set_level,void,FuriLogLevel
|
||||
Function,-,furi_log_set_puts,void,FuriLogPuts
|
||||
Function,-,furi_log_set_timestamp,void,FuriLogTimestamp
|
||||
@ -1601,7 +1602,7 @@ Function,+,gui_add_framebuffer_callback,void,"Gui*, GuiCanvasCommitCallback, voi
|
||||
Function,+,gui_add_view_port,void,"Gui*, ViewPort*, GuiLayer"
|
||||
Function,+,gui_direct_draw_acquire,Canvas*,Gui*
|
||||
Function,+,gui_direct_draw_release,void,Gui*
|
||||
Function,+,gui_get_framebuffer_size,size_t,Gui*
|
||||
Function,+,gui_get_framebuffer_size,size_t,const Gui*
|
||||
Function,+,gui_remove_framebuffer_callback,void,"Gui*, GuiCanvasCommitCallback, void*"
|
||||
Function,+,gui_remove_view_port,void,"Gui*, ViewPort*"
|
||||
Function,+,gui_set_lockdown,void,"Gui*, _Bool"
|
||||
@ -1644,9 +1645,9 @@ Function,+,ibutton_worker_write_set_callback,void,"iButtonWorker*, iButtonWorker
|
||||
Function,+,ibutton_worker_write_start,void,"iButtonWorker*, iButtonKey*"
|
||||
Function,+,icon_animation_alloc,IconAnimation*,const Icon*
|
||||
Function,+,icon_animation_free,void,IconAnimation*
|
||||
Function,+,icon_animation_get_height,uint8_t,IconAnimation*
|
||||
Function,+,icon_animation_get_width,uint8_t,IconAnimation*
|
||||
Function,+,icon_animation_is_last_frame,_Bool,IconAnimation*
|
||||
Function,+,icon_animation_get_height,uint8_t,const IconAnimation*
|
||||
Function,+,icon_animation_get_width,uint8_t,const IconAnimation*
|
||||
Function,+,icon_animation_is_last_frame,_Bool,const IconAnimation*
|
||||
Function,+,icon_animation_set_update_callback,void,"IconAnimation*, IconAnimationCallback, void*"
|
||||
Function,+,icon_animation_start,void,IconAnimation*
|
||||
Function,+,icon_animation_stop,void,IconAnimation*
|
||||
@ -1788,7 +1789,7 @@ Function,-,llround,long long int,double
|
||||
Function,-,llroundf,long long int,float
|
||||
Function,-,llroundl,long long int,long double
|
||||
Function,+,loader_get_pubsub,FuriPubSub*,Loader*
|
||||
Function,+,loader_is_locked,_Bool,Loader*
|
||||
Function,+,loader_is_locked,_Bool,const Loader*
|
||||
Function,+,loader_lock,_Bool,Loader*
|
||||
Function,+,loader_show_menu,void,
|
||||
Function,+,loader_start,LoaderStatus,"Loader*, const char*, const char*"
|
||||
@ -2397,11 +2398,11 @@ Function,-,scalbnl,long double,"long double, int"
|
||||
Function,-,scanf,int,"const char*, ..."
|
||||
Function,+,scene_manager_alloc,SceneManager*,"const SceneManagerHandlers*, void*"
|
||||
Function,+,scene_manager_free,void,SceneManager*
|
||||
Function,+,scene_manager_get_scene_state,uint32_t,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_get_scene_state,uint32_t,"const SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_handle_back_event,_Bool,SceneManager*
|
||||
Function,+,scene_manager_handle_custom_event,_Bool,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_handle_tick_event,void,SceneManager*
|
||||
Function,+,scene_manager_has_previous_scene,_Bool,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_has_previous_scene,_Bool,"const SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_next_scene,void,"SceneManager*, uint32_t"
|
||||
Function,+,scene_manager_previous_scene,_Bool,SceneManager*
|
||||
Function,+,scene_manager_search_and_switch_to_another_scene,_Bool,"SceneManager*, uint32_t"
|
||||
@ -2627,7 +2628,7 @@ Function,+,subghz_protocol_blocks_crc8le,uint8_t,"const uint8_t[], size_t, uint8
|
||||
Function,+,subghz_protocol_blocks_get_bit_array,_Bool,"uint8_t[], size_t"
|
||||
Function,+,subghz_protocol_blocks_get_hash_data,uint8_t,"SubGhzBlockDecoder*, size_t"
|
||||
Function,+,subghz_protocol_blocks_get_parity,uint8_t,"uint64_t, uint8_t"
|
||||
Function,+,subghz_protocol_blocks_get_upload,size_t,"uint8_t[], size_t, LevelDuration*, size_t, uint32_t"
|
||||
Function,+,subghz_protocol_blocks_get_upload_from_bit_array,size_t,"uint8_t[], size_t, LevelDuration*, size_t, uint32_t, SubGhzProtocolBlockAlignBit"
|
||||
Function,+,subghz_protocol_blocks_lfsr_digest16,uint16_t,"const uint8_t[], size_t, uint16_t, uint16_t"
|
||||
Function,+,subghz_protocol_blocks_lfsr_digest8,uint8_t,"const uint8_t[], size_t, uint8_t, uint8_t"
|
||||
Function,+,subghz_protocol_blocks_lfsr_digest8_reflect,uint8_t,"const uint8_t[], size_t, uint8_t, uint8_t"
|
||||
@ -4489,11 +4490,11 @@ Function,+,view_port_alloc,ViewPort*,
|
||||
Function,+,view_port_draw_callback_set,void,"ViewPort*, ViewPortDrawCallback, void*"
|
||||
Function,+,view_port_enabled_set,void,"ViewPort*, _Bool"
|
||||
Function,+,view_port_free,void,ViewPort*
|
||||
Function,+,view_port_get_height,uint8_t,ViewPort*
|
||||
Function,+,view_port_get_height,uint8_t,const ViewPort*
|
||||
Function,+,view_port_get_orientation,ViewPortOrientation,const ViewPort*
|
||||
Function,+,view_port_get_width,uint8_t,ViewPort*
|
||||
Function,+,view_port_get_width,uint8_t,const ViewPort*
|
||||
Function,+,view_port_input_callback_set,void,"ViewPort*, ViewPortInputCallback, void*"
|
||||
Function,+,view_port_is_enabled,_Bool,ViewPort*
|
||||
Function,+,view_port_is_enabled,_Bool,const ViewPort*
|
||||
Function,+,view_port_set_height,void,"ViewPort*, uint8_t"
|
||||
Function,+,view_port_set_orientation,void,"ViewPort*, ViewPortOrientation"
|
||||
Function,+,view_port_set_width,void,"ViewPort*, uint8_t"
|
||||
|
|
@ -103,7 +103,7 @@ bool furi_hal_spi_bus_rx(
|
||||
|
||||
bool furi_hal_spi_bus_tx(
|
||||
FuriHalSpiBusHandle* handle,
|
||||
uint8_t* buffer,
|
||||
const uint8_t* buffer,
|
||||
size_t size,
|
||||
uint32_t timeout) {
|
||||
furi_assert(handle);
|
||||
@ -128,7 +128,7 @@ bool furi_hal_spi_bus_tx(
|
||||
|
||||
bool furi_hal_spi_bus_trx(
|
||||
FuriHalSpiBusHandle* handle,
|
||||
uint8_t* tx_buffer,
|
||||
const uint8_t* tx_buffer,
|
||||
uint8_t* rx_buffer,
|
||||
size_t size,
|
||||
uint32_t timeout) {
|
||||
|
@ -85,7 +85,7 @@ bool furi_hal_spi_bus_rx(
|
||||
*/
|
||||
bool furi_hal_spi_bus_tx(
|
||||
FuriHalSpiBusHandle* handle,
|
||||
uint8_t* buffer,
|
||||
const uint8_t* buffer,
|
||||
size_t size,
|
||||
uint32_t timeout);
|
||||
|
||||
@ -101,7 +101,7 @@ bool furi_hal_spi_bus_tx(
|
||||
*/
|
||||
bool furi_hal_spi_bus_trx(
|
||||
FuriHalSpiBusHandle* handle,
|
||||
uint8_t* tx_buffer,
|
||||
const uint8_t* tx_buffer,
|
||||
uint8_t* rx_buffer,
|
||||
size_t size,
|
||||
uint32_t timeout);
|
||||
|
@ -28,27 +28,27 @@ void furi_log_print_format(FuriLogLevel level, const char* tag, const char* form
|
||||
FuriString* string;
|
||||
string = furi_string_alloc();
|
||||
|
||||
const char* color = FURI_LOG_CLR_RESET;
|
||||
const char* color = _FURI_LOG_CLR_RESET;
|
||||
const char* log_letter = " ";
|
||||
switch(level) {
|
||||
case FuriLogLevelError:
|
||||
color = FURI_LOG_CLR_E;
|
||||
color = _FURI_LOG_CLR_E;
|
||||
log_letter = "E";
|
||||
break;
|
||||
case FuriLogLevelWarn:
|
||||
color = FURI_LOG_CLR_W;
|
||||
color = _FURI_LOG_CLR_W;
|
||||
log_letter = "W";
|
||||
break;
|
||||
case FuriLogLevelInfo:
|
||||
color = FURI_LOG_CLR_I;
|
||||
color = _FURI_LOG_CLR_I;
|
||||
log_letter = "I";
|
||||
break;
|
||||
case FuriLogLevelDebug:
|
||||
color = FURI_LOG_CLR_D;
|
||||
color = _FURI_LOG_CLR_D;
|
||||
log_letter = "D";
|
||||
break;
|
||||
case FuriLogLevelTrace:
|
||||
color = FURI_LOG_CLR_T;
|
||||
color = _FURI_LOG_CLR_T;
|
||||
log_letter = "T";
|
||||
break;
|
||||
default:
|
||||
@ -58,7 +58,7 @@ void furi_log_print_format(FuriLogLevel level, const char* tag, const char* form
|
||||
// Timestamp
|
||||
furi_string_printf(
|
||||
string,
|
||||
"%lu %s[%s][%s] " FURI_LOG_CLR_RESET,
|
||||
"%lu %s[%s][%s] " _FURI_LOG_CLR_RESET,
|
||||
furi_log.timestamp(),
|
||||
color,
|
||||
log_letter,
|
||||
@ -80,6 +80,23 @@ void furi_log_print_format(FuriLogLevel level, const char* tag, const char* form
|
||||
}
|
||||
}
|
||||
|
||||
void furi_log_print_raw_format(FuriLogLevel level, const char* format, ...) {
|
||||
if(level <= furi_log.log_level &&
|
||||
furi_mutex_acquire(furi_log.mutex, FuriWaitForever) == FuriStatusOk) {
|
||||
FuriString* string;
|
||||
string = furi_string_alloc();
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
furi_string_vprintf(string, format, args);
|
||||
va_end(args);
|
||||
|
||||
furi_log.puts(furi_string_get_cstr(string));
|
||||
furi_string_free(string);
|
||||
|
||||
furi_mutex_release(furi_log.mutex);
|
||||
}
|
||||
}
|
||||
|
||||
void furi_log_set_level(FuriLogLevel level) {
|
||||
if(level == FuriLogLevelDefault) {
|
||||
level = FURI_LOG_LEVEL_DEFAULT;
|
||||
|
@ -22,21 +22,21 @@ typedef enum {
|
||||
FuriLogLevelTrace = 6,
|
||||
} FuriLogLevel;
|
||||
|
||||
#define FURI_LOG_CLR(clr) "\033[0;" clr "m"
|
||||
#define FURI_LOG_CLR_RESET "\033[0m"
|
||||
#define _FURI_LOG_CLR(clr) "\033[0;" clr "m"
|
||||
#define _FURI_LOG_CLR_RESET "\033[0m"
|
||||
|
||||
#define FURI_LOG_CLR_BLACK "30"
|
||||
#define FURI_LOG_CLR_RED "31"
|
||||
#define FURI_LOG_CLR_GREEN "32"
|
||||
#define FURI_LOG_CLR_BROWN "33"
|
||||
#define FURI_LOG_CLR_BLUE "34"
|
||||
#define FURI_LOG_CLR_PURPLE "35"
|
||||
#define _FURI_LOG_CLR_BLACK "30"
|
||||
#define _FURI_LOG_CLR_RED "31"
|
||||
#define _FURI_LOG_CLR_GREEN "32"
|
||||
#define _FURI_LOG_CLR_BROWN "33"
|
||||
#define _FURI_LOG_CLR_BLUE "34"
|
||||
#define _FURI_LOG_CLR_PURPLE "35"
|
||||
|
||||
#define FURI_LOG_CLR_E FURI_LOG_CLR(FURI_LOG_CLR_RED)
|
||||
#define FURI_LOG_CLR_W FURI_LOG_CLR(FURI_LOG_CLR_BROWN)
|
||||
#define FURI_LOG_CLR_I FURI_LOG_CLR(FURI_LOG_CLR_GREEN)
|
||||
#define FURI_LOG_CLR_D FURI_LOG_CLR(FURI_LOG_CLR_BLUE)
|
||||
#define FURI_LOG_CLR_T FURI_LOG_CLR(FURI_LOG_CLR_PURPLE)
|
||||
#define _FURI_LOG_CLR_E _FURI_LOG_CLR(_FURI_LOG_CLR_RED)
|
||||
#define _FURI_LOG_CLR_W _FURI_LOG_CLR(_FURI_LOG_CLR_BROWN)
|
||||
#define _FURI_LOG_CLR_I _FURI_LOG_CLR(_FURI_LOG_CLR_GREEN)
|
||||
#define _FURI_LOG_CLR_D _FURI_LOG_CLR(_FURI_LOG_CLR_BLUE)
|
||||
#define _FURI_LOG_CLR_T _FURI_LOG_CLR(_FURI_LOG_CLR_PURPLE)
|
||||
|
||||
typedef void (*FuriLogPuts)(const char* data);
|
||||
typedef uint32_t (*FuriLogTimestamp)(void);
|
||||
@ -54,6 +54,15 @@ void furi_log_init();
|
||||
void furi_log_print_format(FuriLogLevel level, const char* tag, const char* format, ...)
|
||||
_ATTRIBUTE((__format__(__printf__, 3, 4)));
|
||||
|
||||
/** Print log record
|
||||
*
|
||||
* @param level
|
||||
* @param format
|
||||
* @param ...
|
||||
*/
|
||||
void furi_log_print_raw_format(FuriLogLevel level, const char* format, ...)
|
||||
_ATTRIBUTE((__format__(__printf__, 2, 3)));
|
||||
|
||||
/** Set log level
|
||||
*
|
||||
* @param[in] level The level
|
||||
@ -95,6 +104,22 @@ void furi_log_set_timestamp(FuriLogTimestamp timestamp);
|
||||
#define FURI_LOG_T(tag, format, ...) \
|
||||
furi_log_print_format(FuriLogLevelTrace, tag, format, ##__VA_ARGS__)
|
||||
|
||||
/** Log methods
|
||||
*
|
||||
* @param format The raw format
|
||||
* @param ... VA Args
|
||||
*/
|
||||
#define FURI_LOG_RAW_E(format, ...) \
|
||||
furi_log_print_raw_format(FuriLogLevelError, format, ##__VA_ARGS__)
|
||||
#define FURI_LOG_RAW_W(format, ...) \
|
||||
furi_log_print_raw_format(FuriLogLevelWarn, format, ##__VA_ARGS__)
|
||||
#define FURI_LOG_RAW_I(format, ...) \
|
||||
furi_log_print_raw_format(FuriLogLevelInfo, format, ##__VA_ARGS__)
|
||||
#define FURI_LOG_RAW_D(format, ...) \
|
||||
furi_log_print_raw_format(FuriLogLevelDebug, format, ##__VA_ARGS__)
|
||||
#define FURI_LOG_RAW_T(format, ...) \
|
||||
furi_log_print_raw_format(FuriLogLevelTrace, format, ##__VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include "math.h"
|
||||
#include <core/check.h>
|
||||
|
||||
#include "furi.h"
|
||||
|
||||
#define TAG "SubGhzBlockEncoder"
|
||||
|
||||
void subghz_protocol_blocks_set_bit_array(
|
||||
@ -17,21 +19,32 @@ bool subghz_protocol_blocks_get_bit_array(uint8_t data_array[], size_t read_inde
|
||||
return bit_read(data_array[read_index_bit >> 3], 7 - (read_index_bit & 0x7));
|
||||
}
|
||||
|
||||
size_t subghz_protocol_blocks_get_upload(
|
||||
size_t subghz_protocol_blocks_get_upload_from_bit_array(
|
||||
uint8_t data_array[],
|
||||
size_t count_bit_data_array,
|
||||
LevelDuration* upload,
|
||||
size_t max_size_upload,
|
||||
uint32_t duration_bit) {
|
||||
size_t index_bit = 0;
|
||||
uint32_t duration_bit,
|
||||
SubGhzProtocolBlockAlignBit align_bit) {
|
||||
size_t bias_bit = 0;
|
||||
size_t size_upload = 0;
|
||||
uint32_t duration = duration_bit;
|
||||
|
||||
if(align_bit == SubGhzProtocolBlockAlignBitRight) {
|
||||
if(count_bit_data_array & 0x7) {
|
||||
bias_bit = 8 - (count_bit_data_array & 0x7);
|
||||
}
|
||||
}
|
||||
size_t index_bit = bias_bit;
|
||||
|
||||
bool last_bit = subghz_protocol_blocks_get_bit_array(data_array, index_bit++);
|
||||
for(size_t i = 1; i < count_bit_data_array; i++) {
|
||||
for(size_t i = 1 + bias_bit; i < count_bit_data_array + bias_bit; i++) {
|
||||
if(last_bit == subghz_protocol_blocks_get_bit_array(data_array, index_bit)) {
|
||||
duration += duration_bit;
|
||||
} else {
|
||||
furi_assert(max_size_upload > size_upload);
|
||||
if(size_upload > max_size_upload) {
|
||||
furi_crash("SubGhz: Encoder buffer overflow");
|
||||
}
|
||||
upload[size_upload++] = level_duration_make(
|
||||
subghz_protocol_blocks_get_bit_array(data_array, index_bit - 1), duration);
|
||||
last_bit = !last_bit;
|
||||
|
@ -19,6 +19,11 @@ typedef struct {
|
||||
|
||||
} SubGhzProtocolBlockEncoder;
|
||||
|
||||
typedef enum {
|
||||
SubGhzProtocolBlockAlignBitLeft,
|
||||
SubGhzProtocolBlockAlignBitRight,
|
||||
} SubGhzProtocolBlockAlignBit;
|
||||
|
||||
/**
|
||||
* Set data bit when encoding HEX array.
|
||||
* @param bit_value The value of the bit to be set
|
||||
@ -47,13 +52,15 @@ bool subghz_protocol_blocks_get_bit_array(uint8_t data_array[], size_t read_inde
|
||||
* @param upload Pointer to a LevelDuration
|
||||
* @param max_size_upload upload size, check not to overflow
|
||||
* @param duration_bit duration 1 bit
|
||||
* @param align_bit alignment of useful bits in an array
|
||||
*/
|
||||
size_t subghz_protocol_blocks_get_upload(
|
||||
size_t subghz_protocol_blocks_get_upload_from_bit_array(
|
||||
uint8_t data_array[],
|
||||
size_t count_bit_data_array,
|
||||
LevelDuration* upload,
|
||||
size_t max_size_upload,
|
||||
uint32_t duration_bit);
|
||||
uint32_t duration_bit,
|
||||
SubGhzProtocolBlockAlignBit align_bit);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ bool subghz_block_generic_deserialize(SubGhzBlockGeneric* instance, FlipperForma
|
||||
FURI_LOG_E(TAG, "Missing Bit");
|
||||
break;
|
||||
}
|
||||
instance->data_count_bit = (uint8_t)temp_data;
|
||||
instance->data_count_bit = (uint16_t)temp_data;
|
||||
|
||||
uint8_t key_data[sizeof(uint64_t)] = {0};
|
||||
if(!flipper_format_read_hex(flipper_format, "Key", key_data, sizeof(uint64_t))) {
|
||||
|
@ -20,7 +20,7 @@ struct SubGhzBlockGeneric {
|
||||
uint64_t data;
|
||||
uint64_t data_2;
|
||||
uint32_t serial;
|
||||
uint8_t data_count_bit;
|
||||
uint16_t data_count_bit;
|
||||
uint8_t btn;
|
||||
uint32_t cnt;
|
||||
uint8_t cnt_2;
|
||||
|
1120
lib/subghz/protocols/bin_raw.c
Normal file
1120
lib/subghz/protocols/bin_raw.c
Normal file
File diff suppressed because it is too large
Load Diff
111
lib/subghz/protocols/bin_raw.h
Normal file
111
lib/subghz/protocols/bin_raw.h
Normal file
@ -0,0 +1,111 @@
|
||||
#pragma once
|
||||
|
||||
#include "base.h"
|
||||
|
||||
#define SUBGHZ_PROTOCOL_BIN_RAW_NAME "BinRAW"
|
||||
|
||||
typedef struct SubGhzProtocolDecoderBinRAW SubGhzProtocolDecoderBinRAW;
|
||||
typedef struct SubGhzProtocolEncoderBinRAW SubGhzProtocolEncoderBinRAW;
|
||||
|
||||
extern const SubGhzProtocolDecoder subghz_protocol_bin_raw_decoder;
|
||||
extern const SubGhzProtocolEncoder subghz_protocol_bin_raw_encoder;
|
||||
extern const SubGhzProtocol subghz_protocol_bin_raw;
|
||||
|
||||
/**
|
||||
* Allocate SubGhzProtocolEncoderBinRAW.
|
||||
* @param environment Pointer to a SubGhzEnvironment instance
|
||||
* @return SubGhzProtocolEncoderBinRAW* pointer to a SubGhzProtocolEncoderBinRAW instance
|
||||
*/
|
||||
void* subghz_protocol_encoder_bin_raw_alloc(SubGhzEnvironment* environment);
|
||||
|
||||
/**
|
||||
* Free SubGhzProtocolEncoderBinRAW.
|
||||
* @param context Pointer to a SubGhzProtocolEncoderBinRAW instance
|
||||
*/
|
||||
void subghz_protocol_encoder_bin_raw_free(void* context);
|
||||
|
||||
/**
|
||||
* Deserialize and generating an upload to send.
|
||||
* @param context Pointer to a SubGhzProtocolEncoderBinRAW instance
|
||||
* @param flipper_format Pointer to a FlipperFormat instance
|
||||
* @return true On success
|
||||
*/
|
||||
bool subghz_protocol_encoder_bin_raw_deserialize(void* context, FlipperFormat* flipper_format);
|
||||
|
||||
/**
|
||||
* Forced transmission stop.
|
||||
* @param context Pointer to a SubGhzProtocolEncoderBinRAW instance
|
||||
*/
|
||||
void subghz_protocol_encoder_bin_raw_stop(void* context);
|
||||
|
||||
/**
|
||||
* Getting the level and duration of the upload to be loaded into DMA.
|
||||
* @param context Pointer to a SubGhzProtocolEncoderBinRAW instance
|
||||
* @return LevelDuration
|
||||
*/
|
||||
LevelDuration subghz_protocol_encoder_bin_raw_yield(void* context);
|
||||
|
||||
/**
|
||||
* Allocate SubGhzProtocolDecoderBinRAW.
|
||||
* @param environment Pointer to a SubGhzEnvironment instance
|
||||
* @return SubGhzProtocolDecoderBinRAW* pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
*/
|
||||
void* subghz_protocol_decoder_bin_raw_alloc(SubGhzEnvironment* environment);
|
||||
|
||||
/**
|
||||
* Free SubGhzProtocolDecoderBinRAW.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
*/
|
||||
void subghz_protocol_decoder_bin_raw_free(void* context);
|
||||
|
||||
/**
|
||||
* Reset decoder SubGhzProtocolDecoderBinRAW.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
*/
|
||||
void subghz_protocol_decoder_bin_raw_reset(void* context);
|
||||
|
||||
/**
|
||||
* Parse a raw sequence of levels and durations received from the air.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
* @param level Signal level true-high false-low
|
||||
* @param duration Duration of this level in, us
|
||||
*/
|
||||
void subghz_protocol_decoder_bin_raw_feed(void* context, bool level, uint32_t duration);
|
||||
|
||||
/**
|
||||
* Getting the hash sum of the last randomly received parcel.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
* @return hash Hash sum
|
||||
*/
|
||||
uint8_t subghz_protocol_decoder_bin_raw_get_hash_data(void* context);
|
||||
|
||||
void subghz_protocol_decoder_bin_raw_data_input_rssi(
|
||||
SubGhzProtocolDecoderBinRAW* instance,
|
||||
float rssi);
|
||||
|
||||
/**
|
||||
* Serialize data SubGhzProtocolDecoderBinRAW.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
* @param flipper_format Pointer to a FlipperFormat instance
|
||||
* @param preset The modulation on which the signal was received, SubGhzRadioPreset
|
||||
* @return true On success
|
||||
*/
|
||||
bool subghz_protocol_decoder_bin_raw_serialize(
|
||||
void* context,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzRadioPreset* preset);
|
||||
|
||||
/**
|
||||
* Deserialize data SubGhzProtocolDecoderBinRAW.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
* @param flipper_format Pointer to a FlipperFormat instance
|
||||
* @return true On success
|
||||
*/
|
||||
bool subghz_protocol_decoder_bin_raw_deserialize(void* context, FlipperFormat* flipper_format);
|
||||
|
||||
/**
|
||||
* Getting a textual representation of the received data.
|
||||
* @param context Pointer to a SubGhzProtocolDecoderBinRAW instance
|
||||
* @param output Resulting text
|
||||
*/
|
||||
void subghz_protocol_decoder_bin_raw_get_string(void* context, FuriString* output);
|
@ -196,12 +196,13 @@ static bool
|
||||
break;
|
||||
}
|
||||
|
||||
instance->encoder.size_upload = subghz_protocol_blocks_get_upload(
|
||||
instance->encoder.size_upload = subghz_protocol_blocks_get_upload_from_bit_array(
|
||||
upload_hex_data,
|
||||
upload_hex_count_bit,
|
||||
instance->encoder.upload,
|
||||
instance->encoder.size_upload,
|
||||
subghz_protocol_chamb_code_const.te_short);
|
||||
subghz_protocol_chamb_code_const.te_short,
|
||||
SubGhzProtocolBlockAlignBitLeft);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ const SubGhzProtocol* subghz_protocol_registry_items[] = {
|
||||
&subghz_protocol_dooya,
|
||||
&subghz_protocol_alutech_at_4n,
|
||||
&subghz_protocol_kinggates_stylo_4k,
|
||||
&subghz_protocol_bin_raw,
|
||||
};
|
||||
|
||||
const SubGhzProtocolRegistry subghz_protocol_registry = {
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "dooya.h"
|
||||
#include "alutech_at_4n.h"
|
||||
#include "kinggates_stylo_4k.h"
|
||||
#include "bin_raw.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -261,16 +261,16 @@ static bool
|
||||
data = order << 4 | invert;
|
||||
int k = 0;
|
||||
for(int i = 6; i >= 0; i -= 2) {
|
||||
roll_array[k++] = (data >> i) & 0x03;
|
||||
if(roll_array[k] == 3) {
|
||||
roll_array[k] = (data >> i) & 0x03;
|
||||
if(roll_array[k++] == 3) {
|
||||
FURI_LOG_E(TAG, "Roll_Array FAIL");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 8; i >= 0; i -= 2) {
|
||||
roll_array[k++] = (p[2] >> i) & 0x03;
|
||||
if(roll_array[k] == 3) {
|
||||
roll_array[k] = (p[2] >> i) & 0x03;
|
||||
if(roll_array[k++] == 3) {
|
||||
FURI_LOG_E(TAG, "Roll_Array FAIL");
|
||||
return false;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ void subghz_receiver_decode(SubGhzReceiver* instance, bool level, uint32_t durat
|
||||
|
||||
for
|
||||
M_EACH(slot, instance->slots, SubGhzReceiverSlotArray_t) {
|
||||
if((slot->base->protocol->flag & instance->filter) == instance->filter) {
|
||||
if((slot->base->protocol->flag & instance->filter) != 0) {
|
||||
slot->base->protocol->decoder->feed(slot->base, level, duration);
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ typedef enum {
|
||||
SubGhzProtocolFlag_Save = (1 << 7),
|
||||
SubGhzProtocolFlag_Load = (1 << 8),
|
||||
SubGhzProtocolFlag_Send = (1 << 9),
|
||||
SubGhzProtocolFlag_BinRAW = (1 << 10),
|
||||
} SubGhzProtocolFlag;
|
||||
|
||||
typedef struct {
|
||||
|
@ -13,8 +13,8 @@
|
||||
#define LEVEL_DURATION_RESERVED 0x800000U
|
||||
|
||||
typedef struct {
|
||||
uint32_t level;
|
||||
uint32_t duration;
|
||||
uint32_t duration : 30;
|
||||
uint8_t level : 2;
|
||||
} LevelDuration;
|
||||
|
||||
static inline LevelDuration level_duration_make(bool level, uint32_t duration) {
|
||||
|
@ -47,6 +47,7 @@ def generate(env, **kw):
|
||||
"source ${FBT_DEBUG_DIR}/gdbinit",
|
||||
],
|
||||
GDBOPTS_BLACKMAGIC=[
|
||||
"-q",
|
||||
"-ex",
|
||||
"monitor swdp_scan",
|
||||
"-ex",
|
||||
|
Loading…
Reference in New Issue
Block a user