1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-14 10:38:09 +00:00
trezor-firmware/core/src/apps/management/ble/pairing_request.py
tychovrahe d237e155d6 feat(core): rudimentary BLE support
[no changelog]

Co-authored-by: Martin Milata <martin@martinmilata.cz>
2024-01-25 00:21:19 +01:00

20 lines
515 B
Python

from typing import TYPE_CHECKING
if TYPE_CHECKING:
from trezor.messages import BLEAuthKey, BLEPairingRequest
async def pairing_request(_msg: BLEPairingRequest) -> BLEAuthKey:
from trezor.messages import BLEAuthKey
from trezor.ui.layouts import request_pin_on_device
from trezor.wire import context
pin = await context.with_context(
None, request_pin_on_device("PAIRING", None, True, False)
)
if len(pin) != 6:
pin = "000000"
return BLEAuthKey(key=pin.encode())