Fix node.info()

This commit is contained in:
Marcel Stör 2019-08-06 23:30:55 +02:00
parent 537c6f9909
commit 0b90495517
1 changed files with 33 additions and 32 deletions

View File

@ -283,43 +283,44 @@ Returns information about hardware, software version and build configuration.
`node.info([group])` `node.info([group])`
#### Parameters #### Parameters
`group` group of information (optional, if ommited return legacy information). May be one of `"hw"`, `"sw_version"`, `"build_config"`. `group` A designator for a group of properties. May be one of `"hw"`, `"sw_version"`, `"build_config"`. It is currently optional; if omitted the legacy structure is returned. However, not providing any value is deprecated.
#### Returns #### Returns
if a `group` is given the return value will be a table containing the following elements: If a `group` is given the return value will be a table containing the following elements:
- for `group` = `"hw"`
- `chip_id` (number) - for `group` = `"hw"`
- `flash_id` (number) - `chip_id` (number)
- `flash_size` (number) - `flash_id` (number)
- `flash_mode` (number) QIO = 0, QOUT = 1, DIO = 2, DOUT = 15. - `flash_size` (number)
- `flash_speed` (number) - `flash_mode` (number) 0 = QIO, 1 = QOUT, 2 = DIO, 15 = DOUT.
- for `group` = `"sw_version"` - `flash_speed` (number)
- `git_branch` (string) - for `group` = `"sw_version"`
- `git_commit_id` (string) - `git_branch` (string)
- `git_release` (string) Release name +additional commits e.g. "2.0.0-master_20170202 +403" - `git_commit_id` (string)
- `git_commit_dts` (string) in an ordering format. e.g. "201908111200" - `git_release` (string) release name +additional commits e.g. "2.0.0-master_20170202 +403"
- `node_verion_major` (number) - `git_commit_dts` (string) commit timestamp in an ordering format. e.g. "201908111200"
- `node_verion_minor` (number) - `node_verion_major` (number)
- `node_verion_revision` (number) - `node_verion_minor` (number)
- for `group` = `"build_config"` - `node_verion_revision` (number)
- `ssl` (boolean) - for `group` = `"build_config"`
- `lfs_size` (number) as defined at build time - `ssl` (boolean)
- `modules` (string) comma separated list - `lfs_size` (number) as defined at build time
- `number_type` (string) `integer` or `float` - `modules` (string) comma separated list
- `number_type` (string) `integer` or `float`
!!! attention !!! attention
This interface is deprecated and will be removed in one of the next releases. Use the above calls instead. Not providing a `group` is deprecated and support for that will be removed in one of the next releases.
- for no `group` given: --deprecated - for `group` = `nil`
- `majorVer` (number) - `majorVer` (number)
- `minorVer` (number) - `minorVer` (number)
- `devVer` (number) - `devVer` (number)
- `chipid` (number) - `chipid` (number)
- `flashid` (number) - `flashid` (number)
- `flashsize` (number) - `flashsize` (number)
- `flashmode` (number) - `flashmode` (number)
- `flashspeed` (number) - `flashspeed` (number)
#### Example #### Example
```lua ```lua
@ -329,7 +330,7 @@ print("NodeMCU "..majorVer.."."..minorVer.."."..devVer)
```lua ```lua
for k,v in pairs(node.info("build_config")) do for k,v in pairs(node.info("build_config")) do
print (k,v) print (k,v)
end end
``` ```