2024-10-28 07:48:23 +08:00
|
|
|
#!/usr/bin/env lua5.4
|
2020-05-28 08:13:21 +08:00
|
|
|
|
|
|
|
local pm3 = require("pm3")
|
|
|
|
p=pm3.pm3("/dev/ttyACM0")
|
2024-08-14 19:06:21 +08:00
|
|
|
|
2020-05-28 08:13:21 +08:00
|
|
|
p:console("hw status")
|
2024-08-14 19:06:21 +08:00
|
|
|
p:console("hw version")
|
|
|
|
for line in p.grabbed_output:gmatch("[^\r\n]+") do
|
|
|
|
if line:find("Unique ID") or line:find("uC:") then
|
|
|
|
print(line)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
print("Device:", p.name)
|
2024-10-30 04:12:20 +08:00
|
|
|
p:console("Rem passthru remark! :coffee:", false, false)
|
2024-10-27 18:19:59 +08:00
|
|
|
|
|
|
|
local json = require("dkjson")
|
|
|
|
print("Fetching prefs:")
|
|
|
|
p:console("prefs show --json")
|
|
|
|
local prefs, err = json.decode(p.grabbed_output)
|
|
|
|
if not prefs then
|
|
|
|
print("Error decoding JSON: ", err)
|
|
|
|
else
|
|
|
|
print("Save path: ", prefs['file.default.savepath'])
|
|
|
|
print("Dump path: ", prefs['file.default.dumppath'])
|
|
|
|
print("Trace path:", prefs['file.default.tracepath'])
|
|
|
|
end
|