mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 12:08:36 -07:00
Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into xfw-dev
Oh thank you OFW for your immense wisdom of shuffling code FOR NO REASON Was it so difficult to add A SINGLE BOOL to lock with PIN or not?????
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
#include <notification/notification_messages.h>
|
#include <notification/notification_messages.h>
|
||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
|
#include <cli/cli.h>
|
||||||
|
#include <cli/cli_vcp.h>
|
||||||
|
|
||||||
#include "animations/animation_manager.h"
|
#include "animations/animation_manager.h"
|
||||||
#include "desktop/scenes/desktop_scene.h"
|
#include "desktop/scenes/desktop_scene.h"
|
||||||
@@ -14,7 +16,7 @@
|
|||||||
#include "desktop/views/desktop_view_pin_input.h"
|
#include "desktop/views/desktop_view_pin_input.h"
|
||||||
#include "desktop/views/desktop_view_pin_timeout.h"
|
#include "desktop/views/desktop_view_pin_timeout.h"
|
||||||
#include "desktop_i.h"
|
#include "desktop_i.h"
|
||||||
#include "helpers/pin_lock.h"
|
#include "helpers/pin.h"
|
||||||
|
|
||||||
#define TAG "Desktop"
|
#define TAG "Desktop"
|
||||||
|
|
||||||
@@ -63,10 +65,7 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) {
|
|||||||
return true;
|
return true;
|
||||||
case DesktopGlobalAutoLock:
|
case DesktopGlobalAutoLock:
|
||||||
if(!loader_is_locked(desktop->loader)) {
|
if(!loader_is_locked(desktop->loader)) {
|
||||||
if(desktop->settings.auto_lock_with_pin && desktop->settings.pin_code.length > 0) {
|
desktop_lock(desktop, desktop->settings.auto_lock_with_pin);
|
||||||
desktop_pin_lock(&desktop->settings);
|
|
||||||
}
|
|
||||||
desktop_lock(desktop);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -127,7 +126,18 @@ static void desktop_auto_lock_inhibit(Desktop* desktop) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void desktop_lock(Desktop* desktop) {
|
void desktop_lock(Desktop* desktop, bool pin_lock) {
|
||||||
|
pin_lock = pin_lock && desktop->settings.pin_code.length > 0;
|
||||||
|
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||||
|
furi_hal_rtc_set_pin_fails(0);
|
||||||
|
}
|
||||||
|
if(pin_lock) {
|
||||||
|
furi_hal_rtc_set_flag(FuriHalRtcFlagLock);
|
||||||
|
Cli* cli = furi_record_open(RECORD_CLI);
|
||||||
|
cli_session_close(cli);
|
||||||
|
furi_record_close(RECORD_CLI);
|
||||||
|
}
|
||||||
|
|
||||||
desktop_auto_lock_inhibit(desktop);
|
desktop_auto_lock_inhibit(desktop);
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
desktop->scene_manager, DesktopSceneLocked, SCENE_LOCKED_FIRST_ENTER);
|
desktop->scene_manager, DesktopSceneLocked, SCENE_LOCKED_FIRST_ENTER);
|
||||||
@@ -142,6 +152,13 @@ void desktop_unlock(Desktop* desktop) {
|
|||||||
desktop_view_locked_unlock(desktop->locked_view);
|
desktop_view_locked_unlock(desktop->locked_view);
|
||||||
scene_manager_search_and_switch_to_previous_scene(desktop->scene_manager, DesktopSceneMain);
|
scene_manager_search_and_switch_to_previous_scene(desktop->scene_manager, DesktopSceneMain);
|
||||||
desktop_auto_lock_arm(desktop);
|
desktop_auto_lock_arm(desktop);
|
||||||
|
|
||||||
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||||
|
furi_hal_rtc_reset_flag(FuriHalRtcFlagLock);
|
||||||
|
Cli* cli = furi_record_open(RECORD_CLI);
|
||||||
|
cli_session_open(cli, &cli_vcp);
|
||||||
|
furi_record_close(RECORD_CLI);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void desktop_set_stealth_mode_state(Desktop* desktop, bool enabled) {
|
void desktop_set_stealth_mode_state(Desktop* desktop, bool enabled) {
|
||||||
@@ -268,11 +285,14 @@ Desktop* desktop_alloc() {
|
|||||||
desktop->auto_lock_timer =
|
desktop->auto_lock_timer =
|
||||||
furi_timer_alloc(desktop_auto_lock_timer_callback, FuriTimerTypeOnce, desktop);
|
furi_timer_alloc(desktop_auto_lock_timer_callback, FuriTimerTypeOnce, desktop);
|
||||||
|
|
||||||
|
furi_record_create(RECORD_DESKTOP, desktop);
|
||||||
|
|
||||||
return desktop;
|
return desktop;
|
||||||
}
|
}
|
||||||
|
|
||||||
void desktop_free(Desktop* desktop) {
|
void desktop_free(Desktop* desktop) {
|
||||||
furi_assert(desktop);
|
furi_assert(desktop);
|
||||||
|
furi_check(furi_record_destroy(RECORD_DESKTOP));
|
||||||
|
|
||||||
furi_pubsub_unsubscribe(
|
furi_pubsub_unsubscribe(
|
||||||
loader_get_pubsub(desktop->loader), desktop->app_start_stop_subscription);
|
loader_get_pubsub(desktop->loader), desktop->app_start_stop_subscription);
|
||||||
@@ -330,6 +350,16 @@ static bool desktop_check_file_flag(const char* flag_path) {
|
|||||||
return exists;
|
return exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool desktop_api_is_locked(Desktop* instance) {
|
||||||
|
furi_assert(instance);
|
||||||
|
return furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock);
|
||||||
|
}
|
||||||
|
|
||||||
|
void desktop_api_unlock(Desktop* instance) {
|
||||||
|
furi_assert(instance);
|
||||||
|
view_dispatcher_send_custom_event(instance->view_dispatcher, DesktopLockedEventUnlocked);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t desktop_srv(void* p) {
|
int32_t desktop_srv(void* p) {
|
||||||
UNUSED(p);
|
UNUSED(p);
|
||||||
|
|
||||||
@@ -356,14 +386,12 @@ int32_t desktop_srv(void* p) {
|
|||||||
|
|
||||||
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
|
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
|
||||||
|
|
||||||
desktop_pin_lock_init(&desktop->settings);
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||||
|
desktop_lock(desktop, true);
|
||||||
if(!desktop_pin_lock_is_locked()) {
|
} else {
|
||||||
if(!loader_is_locked(desktop->loader)) {
|
if(!loader_is_locked(desktop->loader)) {
|
||||||
desktop_auto_lock_arm(desktop);
|
desktop_auto_lock_arm(desktop);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
desktop_lock(desktop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(desktop_check_file_flag(SLIDESHOW_FS_PATH)) {
|
if(desktop_check_file_flag(SLIDESHOW_FS_PATH)) {
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
typedef struct Desktop Desktop;
|
typedef struct Desktop Desktop;
|
||||||
|
|
||||||
|
#define RECORD_DESKTOP "desktop"
|
||||||
|
|
||||||
|
bool desktop_api_is_locked(Desktop* instance);
|
||||||
|
|
||||||
|
void desktop_api_unlock(Desktop* instance);
|
||||||
|
|||||||
@@ -76,6 +76,6 @@ struct Desktop {
|
|||||||
Desktop* desktop_alloc();
|
Desktop* desktop_alloc();
|
||||||
|
|
||||||
void desktop_free(Desktop* desktop);
|
void desktop_free(Desktop* desktop);
|
||||||
void desktop_lock(Desktop* desktop);
|
void desktop_lock(Desktop* desktop, bool pin_lock);
|
||||||
void desktop_unlock(Desktop* desktop);
|
void desktop_unlock(Desktop* desktop);
|
||||||
void desktop_set_stealth_mode_state(Desktop* desktop, bool enabled);
|
void desktop_set_stealth_mode_state(Desktop* desktop, bool enabled);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
#include <loader/loader.h>
|
#include <loader/loader.h>
|
||||||
|
|
||||||
#define DESKTOP_SETTINGS_VER (7)
|
#define DESKTOP_SETTINGS_VER (8)
|
||||||
|
|
||||||
#define DESKTOP_SETTINGS_OLD_PATH INT_PATH(".desktop.settings")
|
#define DESKTOP_SETTINGS_OLD_PATH INT_PATH(".desktop.settings")
|
||||||
#define DESKTOP_SETTINGS_PATH CFG_PATH("desktop.settings")
|
#define DESKTOP_SETTINGS_PATH CFG_PATH("desktop.settings")
|
||||||
@@ -34,7 +34,6 @@ typedef struct {
|
|||||||
FavoriteApp favorite_primary;
|
FavoriteApp favorite_primary;
|
||||||
FavoriteApp favorite_secondary;
|
FavoriteApp favorite_secondary;
|
||||||
PinCode pin_code;
|
PinCode pin_code;
|
||||||
uint8_t is_locked;
|
|
||||||
uint32_t auto_lock_delay_ms;
|
uint32_t auto_lock_delay_ms;
|
||||||
bool auto_lock_with_pin;
|
bool auto_lock_with_pin;
|
||||||
} DesktopSettings;
|
} DesktopSettings;
|
||||||
|
|||||||
55
applications/services/desktop/helpers/pin.c
Normal file
55
applications/services/desktop/helpers/pin.c
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#include "pin.h"
|
||||||
|
|
||||||
|
#include <notification/notification.h>
|
||||||
|
#include <notification/notification_messages.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <furi.h>
|
||||||
|
#include <furi_hal.h>
|
||||||
|
#include <gui/gui.h>
|
||||||
|
|
||||||
|
#include "../desktop_i.h"
|
||||||
|
|
||||||
|
static const NotificationSequence sequence_pin_fail = {
|
||||||
|
&message_display_backlight_on,
|
||||||
|
|
||||||
|
&message_red_255,
|
||||||
|
&message_vibro_on,
|
||||||
|
&message_delay_100,
|
||||||
|
&message_vibro_off,
|
||||||
|
&message_red_0,
|
||||||
|
|
||||||
|
&message_delay_250,
|
||||||
|
|
||||||
|
&message_red_255,
|
||||||
|
&message_vibro_on,
|
||||||
|
&message_delay_100,
|
||||||
|
&message_vibro_off,
|
||||||
|
&message_red_0,
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
void desktop_pin_lock_error_notify() {
|
||||||
|
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
||||||
|
notification_message(notification, &sequence_pin_fail);
|
||||||
|
furi_record_close(RECORD_NOTIFICATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t desktop_pin_lock_get_fail_timeout() {
|
||||||
|
uint32_t pin_fails = furi_hal_rtc_get_pin_fails();
|
||||||
|
if(pin_fails < 3) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 30 * pow(2, pin_fails - 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool desktop_pin_compare(const PinCode* pin_code1, const PinCode* pin_code2) {
|
||||||
|
furi_assert(pin_code1);
|
||||||
|
furi_assert(pin_code2);
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
if(pin_code1->length == pin_code2->length) {
|
||||||
|
result = !memcmp(pin_code1->data, pin_code2->data, pin_code1->length);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
11
applications/services/desktop/helpers/pin.h
Normal file
11
applications/services/desktop/helpers/pin.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "../desktop.h"
|
||||||
|
#include <desktop/desktop_settings.h>
|
||||||
|
|
||||||
|
void desktop_pin_lock_error_notify();
|
||||||
|
|
||||||
|
uint32_t desktop_pin_lock_get_fail_timeout();
|
||||||
|
|
||||||
|
bool desktop_pin_compare(const PinCode* pin_code1, const PinCode* pin_code2);
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
|
|
||||||
#include <notification/notification.h>
|
|
||||||
#include <notification/notification_messages.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <furi.h>
|
|
||||||
#include <furi_hal.h>
|
|
||||||
#include <gui/gui.h>
|
|
||||||
|
|
||||||
#include "../helpers/pin_lock.h"
|
|
||||||
#include "../desktop_i.h"
|
|
||||||
#include <cli/cli.h>
|
|
||||||
#include <cli/cli_vcp.h>
|
|
||||||
#include <xtreme.h>
|
|
||||||
|
|
||||||
static const NotificationSequence sequence_pin_fail = {
|
|
||||||
&message_display_backlight_on,
|
|
||||||
|
|
||||||
&message_red_255,
|
|
||||||
&message_vibro_on,
|
|
||||||
&message_delay_100,
|
|
||||||
&message_vibro_off,
|
|
||||||
&message_red_0,
|
|
||||||
|
|
||||||
&message_delay_250,
|
|
||||||
|
|
||||||
&message_red_255,
|
|
||||||
&message_vibro_on,
|
|
||||||
&message_delay_100,
|
|
||||||
&message_vibro_off,
|
|
||||||
&message_red_0,
|
|
||||||
NULL,
|
|
||||||
};
|
|
||||||
|
|
||||||
void desktop_pin_lock_error_notify() {
|
|
||||||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
|
||||||
notification_message(notification, &sequence_pin_fail);
|
|
||||||
furi_record_close(RECORD_NOTIFICATION);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t desktop_pin_lock_get_fail_timeout() {
|
|
||||||
uint32_t pin_fails = furi_hal_rtc_get_pin_fails();
|
|
||||||
if(pin_fails < 3) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 30 * pow(2, pin_fails - 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void desktop_pin_lock(DesktopSettings* settings) {
|
|
||||||
furi_assert(settings);
|
|
||||||
|
|
||||||
furi_hal_rtc_set_pin_fails(0);
|
|
||||||
furi_hal_rtc_set_flag(FuriHalRtcFlagLock);
|
|
||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
|
||||||
cli_session_close(cli);
|
|
||||||
furi_record_close(RECORD_CLI);
|
|
||||||
settings->is_locked = 1;
|
|
||||||
DESKTOP_SETTINGS_SAVE(settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
void desktop_pin_unlock(DesktopSettings* settings) {
|
|
||||||
furi_assert(settings);
|
|
||||||
|
|
||||||
furi_hal_rtc_reset_flag(FuriHalRtcFlagLock);
|
|
||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
|
||||||
cli_session_open(cli, &cli_vcp);
|
|
||||||
furi_record_close(RECORD_CLI);
|
|
||||||
settings->is_locked = 0;
|
|
||||||
DESKTOP_SETTINGS_SAVE(settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
void desktop_pin_lock_init(DesktopSettings* settings) {
|
|
||||||
furi_assert(settings);
|
|
||||||
|
|
||||||
if(settings->pin_code.length > 0) {
|
|
||||||
if(settings->is_locked == 1) {
|
|
||||||
furi_hal_rtc_set_flag(FuriHalRtcFlagLock);
|
|
||||||
} else {
|
|
||||||
if(desktop_pin_lock_is_locked()) {
|
|
||||||
settings->is_locked = 1;
|
|
||||||
DESKTOP_SETTINGS_SAVE(settings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
furi_hal_rtc_set_pin_fails(0);
|
|
||||||
furi_hal_rtc_reset_flag(FuriHalRtcFlagLock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(desktop_pin_lock_is_locked()) {
|
|
||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
|
||||||
cli_session_close(cli);
|
|
||||||
furi_record_close(RECORD_CLI);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool desktop_pin_lock_verify(const PinCode* pin_set, const PinCode* pin_entered) {
|
|
||||||
bool result = false;
|
|
||||||
if(desktop_pins_are_equal(pin_set, pin_entered)) {
|
|
||||||
furi_hal_rtc_set_pin_fails(0);
|
|
||||||
result = true;
|
|
||||||
} else {
|
|
||||||
uint32_t pin_fails = furi_hal_rtc_get_pin_fails();
|
|
||||||
if(pin_fails >= 9 && XTREME_SETTINGS()->bad_pins_format) {
|
|
||||||
furi_hal_rtc_set_pin_fails(0);
|
|
||||||
furi_hal_rtc_set_flag(FuriHalRtcFlagFactoryReset);
|
|
||||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
|
||||||
storage_simply_remove(storage, INT_PATH(".cnt.u2f"));
|
|
||||||
storage_simply_remove(storage, INT_PATH(".key.u2f"));
|
|
||||||
storage_sd_format(storage);
|
|
||||||
furi_record_close(RECORD_STORAGE);
|
|
||||||
power_reboot(PowerBootModeNormal);
|
|
||||||
}
|
|
||||||
furi_hal_rtc_set_pin_fails(pin_fails + 1);
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool desktop_pin_lock_is_locked() {
|
|
||||||
return furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool desktop_pins_are_equal(const PinCode* pin_code1, const PinCode* pin_code2) {
|
|
||||||
furi_assert(pin_code1);
|
|
||||||
furi_assert(pin_code2);
|
|
||||||
bool result = false;
|
|
||||||
|
|
||||||
if(pin_code1->length == pin_code2->length) {
|
|
||||||
result = !memcmp(pin_code1->data, pin_code2->data, pin_code1->length);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "../desktop.h"
|
|
||||||
#include <desktop/desktop_settings.h>
|
|
||||||
|
|
||||||
void desktop_pin_lock_error_notify();
|
|
||||||
|
|
||||||
uint32_t desktop_pin_lock_get_fail_timeout();
|
|
||||||
|
|
||||||
void desktop_pin_lock(DesktopSettings* settings);
|
|
||||||
|
|
||||||
void desktop_pin_unlock(DesktopSettings* settings);
|
|
||||||
|
|
||||||
bool desktop_pin_lock_is_locked();
|
|
||||||
|
|
||||||
void desktop_pin_lock_init(DesktopSettings* settings);
|
|
||||||
|
|
||||||
bool desktop_pin_lock_verify(const PinCode* pin_set, const PinCode* pin_entered);
|
|
||||||
|
|
||||||
bool desktop_pins_are_equal(const PinCode* pin_code1, const PinCode* pin_code2);
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
#include "../views/desktop_view_lock_menu.h"
|
#include "../views/desktop_view_lock_menu.h"
|
||||||
#include "desktop_scene_i.h"
|
#include "desktop_scene_i.h"
|
||||||
#include "desktop_scene.h"
|
#include "desktop_scene.h"
|
||||||
#include "../helpers/pin_lock.h"
|
#include "../helpers/pin.h"
|
||||||
#include <power/power_service/power.h>
|
#include <power/power_service/power.h>
|
||||||
#define TAG "DesktopSceneLock"
|
#define TAG "DesktopSceneLock"
|
||||||
|
|
||||||
@@ -66,8 +66,7 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(desktop->settings.pin_code.length > 0) {
|
if(desktop->settings.pin_code.length > 0) {
|
||||||
desktop_lock_menu_set_pin_state(desktop->lock_menu, true);
|
desktop_lock_menu_set_pin_state(desktop->lock_menu, true);
|
||||||
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 0);
|
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 0);
|
||||||
desktop_pin_lock(&desktop->settings);
|
desktop_lock(desktop, true);
|
||||||
desktop_lock(desktop);
|
|
||||||
if(check_pin_changed == 2) {
|
if(check_pin_changed == 2) {
|
||||||
Power* power = furi_record_open(RECORD_POWER);
|
Power* power = furi_record_open(RECORD_POWER);
|
||||||
furi_delay_ms(500);
|
furi_delay_ms(500);
|
||||||
@@ -86,15 +85,13 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
case DesktopLockMenuEventLock:
|
case DesktopLockMenuEventLock:
|
||||||
desktop_scene_lock_menu_save_settings(desktop);
|
desktop_scene_lock_menu_save_settings(desktop);
|
||||||
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 0);
|
desktop_lock(desktop, false);
|
||||||
desktop_lock(desktop);
|
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case DesktopLockMenuEventLockPin:
|
case DesktopLockMenuEventLockPin:
|
||||||
desktop_scene_lock_menu_save_settings(desktop);
|
desktop_scene_lock_menu_save_settings(desktop);
|
||||||
if(desktop->settings.pin_code.length > 0) {
|
if(desktop->settings.pin_code.length > 0) {
|
||||||
desktop_pin_lock(&desktop->settings);
|
desktop_lock(desktop, true);
|
||||||
desktop_lock(desktop);
|
|
||||||
} else {
|
} else {
|
||||||
LoaderStatus status =
|
LoaderStatus status =
|
||||||
loader_start(desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG);
|
loader_start(desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG);
|
||||||
@@ -109,8 +106,7 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
|
|||||||
case DesktopLockMenuEventLockPinOff:
|
case DesktopLockMenuEventLockPinOff:
|
||||||
desktop_scene_lock_menu_save_settings(desktop);
|
desktop_scene_lock_menu_save_settings(desktop);
|
||||||
if(desktop->settings.pin_code.length > 0) {
|
if(desktop->settings.pin_code.length > 0) {
|
||||||
desktop_pin_lock(&desktop->settings);
|
desktop_lock(desktop, true);
|
||||||
desktop_lock(desktop);
|
|
||||||
Power* power = furi_record_open(RECORD_POWER);
|
Power* power = furi_record_open(RECORD_POWER);
|
||||||
furi_delay_ms(500);
|
furi_delay_ms(500);
|
||||||
power_off(power);
|
power_off(power);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "../desktop.h"
|
#include "../desktop.h"
|
||||||
#include "../desktop_i.h"
|
#include "../desktop_i.h"
|
||||||
#include "../helpers/pin_lock.h"
|
#include "../helpers/pin.h"
|
||||||
#include "../animations/animation_manager.h"
|
#include "../animations/animation_manager.h"
|
||||||
#include "../views/desktop_events.h"
|
#include "../views/desktop_events.h"
|
||||||
#include "../views/desktop_view_pin_input.h"
|
#include "../views/desktop_view_pin_input.h"
|
||||||
@@ -45,7 +45,7 @@ void desktop_scene_locked_on_enter(void* context) {
|
|||||||
bool switch_to_timeout_scene = false;
|
bool switch_to_timeout_scene = false;
|
||||||
uint32_t state = scene_manager_get_scene_state(desktop->scene_manager, DesktopSceneLocked);
|
uint32_t state = scene_manager_get_scene_state(desktop->scene_manager, DesktopSceneLocked);
|
||||||
if(state == SCENE_LOCKED_FIRST_ENTER) {
|
if(state == SCENE_LOCKED_FIRST_ENTER) {
|
||||||
bool pin_locked = desktop_pin_lock_is_locked();
|
bool pin_locked = furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock);
|
||||||
view_port_enabled_set(desktop->lock_icon_viewport, true);
|
view_port_enabled_set(desktop->lock_icon_viewport, true);
|
||||||
Gui* gui = furi_record_open(RECORD_GUI);
|
Gui* gui = furi_record_open(RECORD_GUI);
|
||||||
gui_set_lockdown(gui, true);
|
gui_set_lockdown(gui, true);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "../views/desktop_view_main.h"
|
#include "../views/desktop_view_main.h"
|
||||||
#include "desktop_scene.h"
|
#include "desktop_scene.h"
|
||||||
#include "desktop_scene_i.h"
|
#include "desktop_scene_i.h"
|
||||||
#include "../helpers/pin_lock.h"
|
|
||||||
|
|
||||||
#define TAG "DesktopSrv"
|
#define TAG "DesktopSrv"
|
||||||
|
|
||||||
@@ -108,11 +107,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DesktopMainEventLock:
|
case DesktopMainEventLock:
|
||||||
if(desktop->settings.pin_code.length > 0) {
|
desktop_lock(desktop, true);
|
||||||
desktop_pin_lock(&desktop->settings);
|
|
||||||
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 0);
|
|
||||||
}
|
|
||||||
desktop_lock(desktop);
|
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,14 @@
|
|||||||
#include <portmacro.h>
|
#include <portmacro.h>
|
||||||
#include <notification/notification.h>
|
#include <notification/notification.h>
|
||||||
#include <notification/notification_messages.h>
|
#include <notification/notification_messages.h>
|
||||||
|
#include <xtreme.h>
|
||||||
|
|
||||||
#include "../desktop.h"
|
#include "../desktop.h"
|
||||||
#include "../desktop_i.h"
|
#include "../desktop_i.h"
|
||||||
#include "../animations/animation_manager.h"
|
#include "../animations/animation_manager.h"
|
||||||
#include "../views/desktop_events.h"
|
#include "../views/desktop_events.h"
|
||||||
#include "../views/desktop_view_pin_input.h"
|
#include "../views/desktop_view_pin_input.h"
|
||||||
#include "../helpers/pin_lock.h"
|
#include "../helpers/pin.h"
|
||||||
#include "desktop_scene.h"
|
#include "desktop_scene.h"
|
||||||
#include "desktop_scene_i.h"
|
#include "desktop_scene_i.h"
|
||||||
|
|
||||||
@@ -54,9 +55,19 @@ static void desktop_scene_pin_input_back_callback(void* context) {
|
|||||||
|
|
||||||
static void desktop_scene_pin_input_done_callback(const PinCode* pin_code, void* context) {
|
static void desktop_scene_pin_input_done_callback(const PinCode* pin_code, void* context) {
|
||||||
Desktop* desktop = (Desktop*)context;
|
Desktop* desktop = (Desktop*)context;
|
||||||
if(desktop_pin_lock_verify(&desktop->settings.pin_code, pin_code)) {
|
if(desktop_pin_compare(&desktop->settings.pin_code, pin_code)) {
|
||||||
|
furi_hal_rtc_set_pin_fails(0);
|
||||||
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopPinInputEventUnlocked);
|
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopPinInputEventUnlocked);
|
||||||
} else {
|
} else {
|
||||||
|
uint32_t pin_fails = furi_hal_rtc_get_pin_fails() + 1;
|
||||||
|
if(pin_fails >= 10 && XTREME_SETTINGS()->bad_pins_format) {
|
||||||
|
furi_hal_rtc_set_pin_fails(0);
|
||||||
|
furi_hal_rtc_set_flag(FuriHalRtcFlagFactoryReset);
|
||||||
|
storage_sd_format(furi_record_open(RECORD_STORAGE));
|
||||||
|
furi_record_close(RECORD_STORAGE);
|
||||||
|
power_reboot(PowerBootModeNormal);
|
||||||
|
}
|
||||||
|
furi_hal_rtc_set_pin_fails(pin_fails);
|
||||||
view_dispatcher_send_custom_event(
|
view_dispatcher_send_custom_event(
|
||||||
desktop->view_dispatcher, DesktopPinInputEventUnlockFailed);
|
desktop->view_dispatcher, DesktopPinInputEventUnlockFailed);
|
||||||
}
|
}
|
||||||
@@ -126,7 +137,6 @@ bool desktop_scene_pin_input_on_event(void* context, SceneManagerEvent event) {
|
|||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case DesktopPinInputEventUnlocked:
|
case DesktopPinInputEventUnlocked:
|
||||||
desktop_pin_unlock(&desktop->settings);
|
|
||||||
desktop_unlock(desktop);
|
desktop_unlock(desktop);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
#include <furi.h>
|
|
||||||
#include <furi_hal.h>
|
|
||||||
#include <gui/elements.h>
|
|
||||||
#include <gui/canvas.h>
|
|
||||||
#include <toolbox/version.h>
|
|
||||||
#include <assets_icons.h>
|
|
||||||
#include <dolphin/helpers/dolphin_state.h>
|
|
||||||
#include <dolphin/dolphin.h>
|
|
||||||
|
|
||||||
#include "../desktop_i.h"
|
|
||||||
#include "desktop_view_pin_setup_done.h"
|
|
||||||
|
|
||||||
struct DesktopViewPinSetupDone {
|
|
||||||
View* view;
|
|
||||||
DesktopViewPinSetupDoneDoneCallback callback;
|
|
||||||
void* context;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void desktop_view_pin_done_draw(Canvas* canvas, void* model) {
|
|
||||||
furi_assert(canvas);
|
|
||||||
UNUSED(model);
|
|
||||||
|
|
||||||
canvas_set_font(canvas, FontPrimary);
|
|
||||||
elements_multiline_text_aligned(
|
|
||||||
canvas, 64, 0, AlignCenter, AlignTop, "Prepare to use\narrows as\nPIN symbols");
|
|
||||||
|
|
||||||
canvas_set_font(canvas, FontSecondary);
|
|
||||||
elements_multiline_text(canvas, 58, 24, "Prepare to use\narrows as\nPIN symbols");
|
|
||||||
|
|
||||||
canvas_draw_icon(canvas, 16, 18, &I_Pin_attention_dpad_29x29);
|
|
||||||
elements_button_right(canvas, "Next");
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool desktop_view_pin_done_input(InputEvent* event, void* context) {
|
|
||||||
furi_assert(event);
|
|
||||||
furi_assert(context);
|
|
||||||
|
|
||||||
DesktopViewPinSetupDone* instance = context;
|
|
||||||
bool consumed = false;
|
|
||||||
|
|
||||||
if((event->key == InputKeyRight) && (event->type == InputTypeShort)) {
|
|
||||||
instance->callback(instance->context);
|
|
||||||
consumed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return consumed;
|
|
||||||
}
|
|
||||||
|
|
||||||
void desktop_view_pin_done_set_callback(
|
|
||||||
DesktopViewPinSetupDone* instance,
|
|
||||||
DesktopViewPinSetupDoneDoneCallback callback,
|
|
||||||
void* context) {
|
|
||||||
furi_assert(instance);
|
|
||||||
furi_assert(callback);
|
|
||||||
instance->callback = callback;
|
|
||||||
instance->context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
DesktopViewPinSetupDone* desktop_view_pin_done_alloc() {
|
|
||||||
DesktopViewPinSetupDone* view = malloc(sizeof(DesktopViewPinSetupDone));
|
|
||||||
view->view = view_alloc();
|
|
||||||
view_set_context(view->view, view);
|
|
||||||
view_set_draw_callback(view->view, desktop_view_pin_done_draw);
|
|
||||||
view_set_input_callback(view->view, desktop_view_pin_done_input);
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
void desktop_view_pin_done_free(DesktopViewPinSetupDone* instance) {
|
|
||||||
furi_assert(instance);
|
|
||||||
|
|
||||||
view_free(instance->view);
|
|
||||||
free(instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
View* desktop_view_pin_done_get_view(DesktopViewPinSetupDone* instance) {
|
|
||||||
furi_assert(instance);
|
|
||||||
return instance->view;
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <gui/view.h>
|
|
||||||
|
|
||||||
typedef struct DesktopViewPinSetupDone DesktopViewPinSetupDone;
|
|
||||||
|
|
||||||
typedef void (*DesktopViewPinSetupDoneDoneCallback)(void*);
|
|
||||||
|
|
||||||
void desktop_view_pin_done_set_callback(
|
|
||||||
DesktopViewPinSetupDone* instance,
|
|
||||||
DesktopViewPinSetupDoneDoneCallback callback,
|
|
||||||
void* context);
|
|
||||||
DesktopViewPinSetupDone* desktop_view_pin_done_alloc();
|
|
||||||
void desktop_view_pin_done_free(DesktopViewPinSetupDone* instance);
|
|
||||||
View* desktop_view_pin_done_get_view(DesktopViewPinSetupDone* instance);
|
|
||||||
@@ -57,6 +57,10 @@ static RpcSystemCallbacks rpc_systems[] = {
|
|||||||
.alloc = rpc_system_property_alloc,
|
.alloc = rpc_system_property_alloc,
|
||||||
.free = NULL,
|
.free = NULL,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.alloc = rpc_desktop_alloc,
|
||||||
|
.free = rpc_desktop_free,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RpcSession {
|
struct RpcSession {
|
||||||
|
|||||||
73
applications/services/rpc/rpc_desktop.c
Normal file
73
applications/services/rpc/rpc_desktop.c
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#include "flipper.pb.h"
|
||||||
|
#include "rpc_i.h"
|
||||||
|
#include <desktop/desktop.h>
|
||||||
|
#include "desktop.pb.h"
|
||||||
|
|
||||||
|
#define TAG "RpcDesktop"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
RpcSession* session;
|
||||||
|
Desktop* desktop;
|
||||||
|
} RpcDesktop;
|
||||||
|
|
||||||
|
static void rpc_desktop_on_is_locked_request(const PB_Main* request, void* context) {
|
||||||
|
furi_assert(request);
|
||||||
|
furi_assert(context);
|
||||||
|
furi_assert(request->which_content == PB_Main_desktop_is_locked_request_tag);
|
||||||
|
|
||||||
|
FURI_LOG_D(TAG, "IsLockedRequest");
|
||||||
|
RpcDesktop* rpc_desktop = context;
|
||||||
|
RpcSession* session = rpc_desktop->session;
|
||||||
|
|
||||||
|
PB_CommandStatus ret = desktop_api_is_locked(rpc_desktop->desktop) ? PB_CommandStatus_OK :
|
||||||
|
PB_CommandStatus_ERROR;
|
||||||
|
|
||||||
|
rpc_send_and_release_empty(session, request->command_id, ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rpc_desktop_on_unlock_request(const PB_Main* request, void* context) {
|
||||||
|
furi_assert(request);
|
||||||
|
furi_assert(context);
|
||||||
|
furi_assert(request->which_content == PB_Main_desktop_unlock_request_tag);
|
||||||
|
|
||||||
|
FURI_LOG_D(TAG, "UnlockRequest");
|
||||||
|
RpcDesktop* rpc_desktop = context;
|
||||||
|
RpcSession* session = rpc_desktop->session;
|
||||||
|
|
||||||
|
desktop_api_unlock(rpc_desktop->desktop);
|
||||||
|
|
||||||
|
rpc_send_and_release_empty(session, request->command_id, PB_CommandStatus_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* rpc_desktop_alloc(RpcSession* session) {
|
||||||
|
furi_assert(session);
|
||||||
|
|
||||||
|
RpcDesktop* rpc_desktop = malloc(sizeof(RpcDesktop));
|
||||||
|
rpc_desktop->desktop = furi_record_open(RECORD_DESKTOP);
|
||||||
|
rpc_desktop->session = session;
|
||||||
|
|
||||||
|
RpcHandler rpc_handler = {
|
||||||
|
.message_handler = NULL,
|
||||||
|
.decode_submessage = NULL,
|
||||||
|
.context = rpc_desktop,
|
||||||
|
};
|
||||||
|
|
||||||
|
rpc_handler.message_handler = rpc_desktop_on_is_locked_request;
|
||||||
|
rpc_add_handler(session, PB_Main_desktop_is_locked_request_tag, &rpc_handler);
|
||||||
|
|
||||||
|
rpc_handler.message_handler = rpc_desktop_on_unlock_request;
|
||||||
|
rpc_add_handler(session, PB_Main_desktop_unlock_request_tag, &rpc_handler);
|
||||||
|
|
||||||
|
return rpc_desktop;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rpc_desktop_free(void* context) {
|
||||||
|
furi_assert(context);
|
||||||
|
RpcDesktop* rpc_desktop = context;
|
||||||
|
|
||||||
|
furi_assert(rpc_desktop->desktop);
|
||||||
|
furi_record_close(RECORD_DESKTOP);
|
||||||
|
|
||||||
|
rpc_desktop->session = NULL;
|
||||||
|
free(rpc_desktop);
|
||||||
|
}
|
||||||
@@ -36,6 +36,9 @@ void* rpc_system_gpio_alloc(RpcSession* session);
|
|||||||
void rpc_system_gpio_free(void* ctx);
|
void rpc_system_gpio_free(void* ctx);
|
||||||
void* rpc_system_property_alloc(RpcSession* session);
|
void* rpc_system_property_alloc(RpcSession* session);
|
||||||
|
|
||||||
|
void* rpc_desktop_alloc(RpcSession* session);
|
||||||
|
void rpc_desktop_free(void* ctx);
|
||||||
|
|
||||||
void rpc_debug_print_message(const PB_Main* message);
|
void rpc_debug_print_message(const PB_Main* message);
|
||||||
void rpc_debug_print_data(const char* prefix, uint8_t* buffer, size_t size);
|
void rpc_debug_print_data(const char* prefix, uint8_t* buffer, size_t size);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <core/check.h>
|
#include <core/check.h>
|
||||||
#include <gui/scene_manager.h>
|
#include <gui/scene_manager.h>
|
||||||
#include <desktop/helpers/pin_lock.h>
|
#include <desktop/helpers/pin.h>
|
||||||
#include "../desktop_settings_app.h"
|
#include "../desktop_settings_app.h"
|
||||||
#include <desktop/desktop_settings.h>
|
#include <desktop/desktop_settings.h>
|
||||||
#include <desktop/views/desktop_view_pin_input.h>
|
#include <desktop/views/desktop_view_pin_input.h>
|
||||||
@@ -18,7 +18,7 @@ static void pin_auth_done_callback(const PinCode* pin_code, void* context) {
|
|||||||
DesktopSettingsApp* app = context;
|
DesktopSettingsApp* app = context;
|
||||||
|
|
||||||
app->pincode_buffer = *pin_code;
|
app->pincode_buffer = *pin_code;
|
||||||
if(desktop_pins_are_equal(&app->settings.pin_code, pin_code)) {
|
if(desktop_pin_compare(&app->settings.pin_code, pin_code)) {
|
||||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_EQUAL);
|
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_EQUAL);
|
||||||
} else {
|
} else {
|
||||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_DIFFERENT);
|
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_DIFFERENT);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <desktop/views/desktop_view_pin_input.h>
|
#include <desktop/views/desktop_view_pin_input.h>
|
||||||
#include "desktop_settings_scene.h"
|
#include "desktop_settings_scene.h"
|
||||||
#include "desktop_settings_scene_i.h"
|
#include "desktop_settings_scene_i.h"
|
||||||
#include <desktop/helpers/pin_lock.h>
|
#include <desktop/helpers/pin.h>
|
||||||
#include "../desktop_settings_app.h"
|
#include "../desktop_settings_app.h"
|
||||||
|
|
||||||
#define SCENE_EVENT_EXIT (0U)
|
#define SCENE_EVENT_EXIT (0U)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <desktop/views/desktop_view_pin_input.h>
|
#include <desktop/views/desktop_view_pin_input.h>
|
||||||
#include "desktop_settings_scene.h"
|
#include "desktop_settings_scene.h"
|
||||||
#include "desktop_settings_scene_i.h"
|
#include "desktop_settings_scene_i.h"
|
||||||
#include <desktop/helpers/pin_lock.h>
|
#include <desktop/helpers/pin.h>
|
||||||
|
|
||||||
#define SCENE_EVENT_EXIT (0U)
|
#define SCENE_EVENT_EXIT (0U)
|
||||||
#define SCENE_EVENT_1ST_PIN_ENTERED (1U)
|
#define SCENE_EVENT_1ST_PIN_ENTERED (1U)
|
||||||
@@ -25,7 +25,7 @@ static void pin_setup_done_callback(const PinCode* pin_code, void* context) {
|
|||||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_1ST_PIN_ENTERED);
|
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_1ST_PIN_ENTERED);
|
||||||
} else {
|
} else {
|
||||||
app->pincode_buffer_filled = false;
|
app->pincode_buffer_filled = false;
|
||||||
if(desktop_pins_are_equal(&app->pincode_buffer, pin_code)) {
|
if(desktop_pin_compare(&app->pincode_buffer, pin_code)) {
|
||||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_EQUAL);
|
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_EQUAL);
|
||||||
} else {
|
} else {
|
||||||
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_DIFFERENT);
|
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_PINS_DIFFERENT);
|
||||||
|
|||||||
Submodule assets/protobuf updated: 1f6b4a08c5...a13c5ddd03
@@ -2,6 +2,7 @@
|
|||||||
#include "app_common.h"
|
#include "app_common.h"
|
||||||
#include "ble_app.h"
|
#include "ble_app.h"
|
||||||
#include <ble/ble.h>
|
#include <ble/ble.h>
|
||||||
|
#include <hci_tl.h>
|
||||||
|
|
||||||
#include <interface/patterns/ble_thread/tl/tl.h>
|
#include <interface/patterns/ble_thread/tl/tl.h>
|
||||||
#include <interface/patterns/ble_thread/shci/shci.h>
|
#include <interface/patterns/ble_thread/shci/shci.h>
|
||||||
@@ -72,6 +73,20 @@ void shci_register_io_bus(tSHciIO* fops) {
|
|||||||
fops->Send = ble_glue_TL_SYS_SendCmd;
|
fops->Send = ble_glue_TL_SYS_SendCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t ble_glue_TL_BLE_SendCmd(uint8_t* buffer, uint16_t size) {
|
||||||
|
if(furi_hal_bt_get_hardfault_info()) {
|
||||||
|
furi_crash("ST(R) Copro(R) HardFault");
|
||||||
|
}
|
||||||
|
|
||||||
|
return TL_BLE_SendCmd(buffer, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hci_register_io_bus(tHciIO* fops) {
|
||||||
|
/* Register IO bus services */
|
||||||
|
fops->Init = TL_BLE_Init;
|
||||||
|
fops->Send = ble_glue_TL_BLE_SendCmd;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void ble_glue_init() {
|
void ble_glue_init() {
|
||||||
|
|||||||
@@ -48,7 +48,10 @@ sources += Glob(
|
|||||||
)
|
)
|
||||||
sources += Glob(
|
sources += Glob(
|
||||||
"stm32wb_copro/wpan/interface/patterns/ble_thread/tl/*_tl*.c",
|
"stm32wb_copro/wpan/interface/patterns/ble_thread/tl/*_tl*.c",
|
||||||
exclude="stm32wb_copro/wpan/interface/patterns/ble_thread/tl/shci_tl_if.c",
|
exclude=[
|
||||||
|
"stm32wb_copro/wpan/interface/patterns/ble_thread/tl/hci_tl_if.c",
|
||||||
|
"stm32wb_copro/wpan/interface/patterns/ble_thread/tl/shci_tl_if.c",
|
||||||
|
],
|
||||||
source=True,
|
source=True,
|
||||||
)
|
)
|
||||||
sources += [
|
sources += [
|
||||||
|
|||||||
Reference in New Issue
Block a user