]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_core/commitdiff
telnetd-diag: info commands now for new API
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sun, 31 May 2020 21:55:46 +0000 (22:55 +0100)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sun, 31 May 2020 21:55:46 +0000 (22:55 +0100)
telnetd/telnetd-diag.lua

index 4e49b1846c8393b969a7aa37f98d5eafa5559d5a..5089ab1a149e716540f7d7dd0c24d74e8854a513 100644 (file)
@@ -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