From 85b9af7ee43c09e4e99093b872b3ad3c58e1b17f Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 31 May 2020 22:55:46 +0100 Subject: [PATCH] telnetd-diag: info commands now for new API --- telnetd/telnetd-diag.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/telnetd/telnetd-diag.lua b/telnetd/telnetd-diag.lua index 4e49b18..5089ab1 100644 --- a/telnetd/telnetd-diag.lua +++ b/telnetd/telnetd-diag.lua @@ -1,7 +1,19 @@ -- DEPENDS: node, rtcfifo? return { ["boot"] = function(_,s) s(string.format("raw=%d reason=%d",node.bootreason())) end, - ["info"] = function(_,s) s(string.format("major=%d minor=%d dev=%d chip=%d flash=%d fs=%d fm=%d fs=%d",node.info())) end, + ["hwinfo"] = function(_,s) + local ni = node.info('hw') + s(("chipid=%d flashsize=%d"):format(ni.chip_id,ni.flash_size)) + end, + ["swinfo"] = function(_,s) + local nis = node.info('sw_version') + local nic = node.info('build_config') + s(("git=%s ssl=%s num=%s modules=%s"):format( + nis.git_commit_id, + tostring(nic.ssl), + nic.number_type, + nic.modules)) + end, ["heap"] = function(_,s) s(string.format("free=%d",node.heap())) end, ["fifo"] = function(_,s) if rtcfifo and rtcfifo.ready() ~= 0 then s(string.format("fifo=%d",rtcfifo.count())) else s("no rtcfifo") end end, -- restart in some ticks, so that network callbacks have a chance to fire -- 2.50.1