tychovrahe/bluetooth/cleaner_disc2
tychovrahe 1 year ago
parent 3a6523158f
commit 586c07ed71

@ -36,12 +36,13 @@ pub mod menu;
pub mod theme;
pub mod welcome;
use crate::ui::model_tt::{
bootloader::theme::TEXT_NORMAL,
component::{PinKeyboard},
};
use confirm::Confirm;
use intro::Intro;
use menu::Menu;
use crate::ui::model_tt::bootloader::theme::TEXT_NORMAL;
use crate::ui::model_tt::component::{PinKeyboard, PinKeyboardMsg};
use crate::ui::model_tt::theme::button_cancel;
use self::theme::{RESULT_FW_INSTALL, RESULT_INITIAL, RESULT_WIPE};
@ -446,12 +447,7 @@ extern "C" fn screen_pairing_confirm(buffer: *const cty::uint8_t) -> u32 {
#[no_mangle]
extern "C" fn screen_repair_confirm() -> u32 {
let msg = Label::new(
"Allow repair?",
Alignment::Center,
TEXT_NORMAL,
);
let msg = Label::new("Allow repair?", Alignment::Center, TEXT_NORMAL);
let right = Button::with_text("ALLOW").styled(button_confirm());
let left = Button::with_text("DENY").styled(button_bld());
let title = Label::new("REPAIR", Alignment::Start, theme::TEXT_BOLD)

@ -230,13 +230,7 @@ pub fn button_bld() -> ButtonStyleSheet {
}
}
pub const TEXT_NORMAL_BLACK: TextStyle = TextStyle::new(
Font::NORMAL,
WHITE,
BLACK,
WHITE,
WHITE,
);
pub const TEXT_NORMAL_BLACK: TextStyle = TextStyle::new(Font::NORMAL, WHITE, BLACK, WHITE, WHITE);
pub const TEXT_TITLE: TextStyle = TextStyle::new(
Font::BOLD,

@ -0,0 +1,14 @@
#include "ble/state.h"
static bool ble_state_connected = false;
static bool ble_state_initialized = false;
bool ble_connected(void) { return ble_state_connected; }
void set_connected(bool connected) { ble_state_connected = connected; }
void set_initialized(bool initialized) { ble_state_initialized = initialized; }
bool ble_initialized(void) { return ble_state_initialized; }

@ -0,0 +1,16 @@
#ifndef __BLE_STATE__
#define __BLE_STATE__
#include <stdbool.h>
#include <stdint.h>
bool ble_initialized(void);
void set_initialized(bool initialized);
bool ble_connected(void);
void set_connected(bool connected);
#endif

@ -16,4 +16,7 @@ async def pairing_request(ctx: GenericContext, _msg: PairingRequest) -> AuthKey:
pin = await request_pin_on_device(ctx, "PAIRING", None, True, False, True)
if len(pin) != 6:
pin = "000000"
return AuthKey(key=pin.encode())

Loading…
Cancel
Save