mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
implement set_flags (aka ApplyFlags)
This commit is contained in:
parent
36985519b5
commit
de6402e95e
14
trezorctl
14
trezorctl
@ -183,6 +183,20 @@ def set_label(client, label):
|
||||
return client.apply_settings(label=label)
|
||||
|
||||
|
||||
@cli.command(help='Set device flags.')
|
||||
@click.argument('flags')
|
||||
@click.pass_obj
|
||||
def set_flags(client, flags):
|
||||
flags = flags.lower()
|
||||
if flags.startswith('0b'):
|
||||
flags = int(flags, 2)
|
||||
elif flags.startswith('0x'):
|
||||
flags = int(flags, 16)
|
||||
else:
|
||||
flags = int(flags)
|
||||
return client.apply_flags(flags=flags)
|
||||
|
||||
|
||||
@cli.command(help='Set new homescreen.')
|
||||
@click.option('-f', '--filename', default=None)
|
||||
@click.pass_obj
|
||||
|
@ -624,6 +624,13 @@ class ProtocolMixin(object):
|
||||
self.init_device() # Reload Features
|
||||
return out
|
||||
|
||||
@field('message')
|
||||
@expect(proto.Success)
|
||||
def apply_flags(self, flags):
|
||||
out = self.call(proto.ApplyFlags(flags=flags))
|
||||
self.init_device() # Reload Features
|
||||
return out
|
||||
|
||||
@field('message')
|
||||
@expect(proto.Success)
|
||||
def clear_session(self):
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: types.proto
|
||||
# libprotoc 3.3.0
|
||||
# trezor-common b29b98d69ba43571dcbe54dc927aa3ecd2b95113
|
||||
# trezor-common 2eb9c7e352f708506d910f2d5b9aac1e85cafa10
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
|
Loading…
Reference in New Issue
Block a user