add convenience functions to client object to get firmware version
This commit is contained in:
parent
f87d30f220
commit
c9ddf5d2a8
@ -334,6 +334,18 @@ class ColdcardDevice:
|
||||
|
||||
return pbkdf2_hmac('sha256' if v3 else 'sha512', text_password, salt, PBKDF2_ITER_COUNT)[:32]
|
||||
|
||||
def firmware_version(self):
|
||||
return self.send_recv(CCProtocolPacker.version()).split("\n")[1]
|
||||
|
||||
def is_edge(self):
|
||||
# returns True if device is running EDGE firmware version
|
||||
if self.is_simulator:
|
||||
cmd = "import version; RV.write(str(int(getattr(version, 'is_edge', 0))))"
|
||||
rv = self.send_recv(b'EXEC' + cmd.encode('utf-8'), timeout=60000, encrypt=False)
|
||||
return rv == b"1"
|
||||
|
||||
return self.firmware_version()[-1] == "X"
|
||||
|
||||
|
||||
class UnixSimulatorPipe:
|
||||
# Use a UNIX pipe to the simulator instead of a real USB connection.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user