Merge pull request #2605 from stuiterveer/numhex
[RRG-proxmark3.git] / client / experimental_lib / example_lua / test.lua
blob03c0dc149e5fee3151f3c8b48f800611bcc19237
1 #!/usr/bin/env lua5.4
3 local pm3 = require("pm3")
4 p=pm3.pm3("/dev/ttyACM0")
6 p:console("hw status")
7 p:console("hw version")
8 for line in p.grabbed_output:gmatch("[^\r\n]+") do
9 if line:find("Unique ID") or line:find("uC:") then
10 print(line)
11 end
12 end
14 print("Device:", p.name)
15 p:console("Rem passthru remark! :coffee:", false, false)
17 local json = require("dkjson")
18 print("Fetching prefs:")
19 p:console("prefs show --json")
20 local prefs, err = json.decode(p.grabbed_output)
21 if not prefs then
22 print("Error decoding JSON: ", err)
23 else
24 print("Save path: ", prefs['file.default.savepath'])
25 print("Dump path: ", prefs['file.default.dumppath'])
26 print("Trace path:", prefs['file.default.tracepath'])
27 end