Add timeout parameter to hw raw

This commit is contained in:
Philippe Teuwen
2023-09-18 23:20:18 +02:00
parent c9261cc6eb
commit 9497ff7eab
2 changed files with 3 additions and 3 deletions
-1
View File
@@ -215,7 +215,6 @@ Notes:
* Command: no data
* Response: 1 byte, according to `mf1_darkside_status_t` enum
* CLI: unused
* **FIXME:** always `CANT_FIX_NT` or watchdog reset on static nonce cards
### 2004: MF1_DARKSIDE_ACQUIRE
* Command: 4 bytes: `type_target|block_target|first_recover|sync_max`
* Response: 1 byte if Darkside failed, according to `mf1_darkside_status_t` enum,
+3 -2
View File
@@ -1471,7 +1471,7 @@ class HWSettingsBLEKey(DeviceRequiredUnit):
@hw_settings.command('blepair', 'Check if BLE pairing is enabled, or set the enable switch for BLE pairing.')
class HWRaw(DeviceRequiredUnit):
class HWBlePair(DeviceRequiredUnit):
def args_parser(self) -> ArgumentParserNoExit or None:
parser = ArgumentParserNoExit()
@@ -1520,10 +1520,11 @@ class HWRaw(DeviceRequiredUnit):
parser = ArgumentParserNoExit()
parser.add_argument('-c', '--command', type=int, required=True, help="Command (Int) to send")
parser.add_argument('-d', '--data', type=str, help="Data (HEX) to send", default="")
parser.add_argument('-t', '--timeout', type=int, help="Timeout in seconds", default=3)
return parser
def on_exec(self, args: argparse.Namespace):
response = self.cmd.device.send_cmd_sync(args.command, data=bytes.fromhex(args.data), status=0x0)
response = self.cmd.device.send_cmd_sync(args.command, data=bytes.fromhex(args.data), status=0x0, timeout=args.timeout)
print(" - Received:")
print(f" Command: {response.cmd}")
status_string = f" Status: {response.status:#02x}"