Skip to content

Commit

Permalink
Merge pull request #152 from sunspec/development
Browse files Browse the repository at this point in the history
Models update
  • Loading branch information
bobfox authored Nov 2, 2020
2 parents 98b5343 + 7e0bb3a commit 4112252
Show file tree
Hide file tree
Showing 127 changed files with 37,411 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ addons:
packages:
# Needed for `xmllint`.
- libxml2-utils
# Needed for jsonschema
- python3-jsonschema

script:
- make -C smdx
- make -C json
11 changes: 11 additions & 0 deletions json/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
JSONFILES=$(shell (ls model_*.json))

SCHEMA=schema.json

all:: check

check: $(JSONFILES)
@# dump stdout to /dev/null to avoid cluttering the output
@# stuff we care about (errors and pass messages) are written to stderr
@echo Using jsonschema to validate all files...
@echo -n $^ | xargs --max-lines=1 --verbose --replace=% --delimiter=' ' jsonschema -i % $(SCHEMA) > /dev/null
78 changes: 78 additions & 0 deletions json/model_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"group": {
"desc": "All SunSpec compliant devices must include this as the first model",
"label": "Common",
"name": "common",
"points": [
{
"desc": "Model identifier",
"label": "Model ID",
"mandatory": "M",
"name": "ID",
"static": "S",
"type": "uint16",
"value": 1
},
{
"desc": "Model length",
"label": "Model Length",
"mandatory": "M",
"name": "L",
"static": "S",
"type": "uint16"
},
{
"desc": "Well known value registered with SunSpec for compliance",
"label": "Manufacturer",
"mandatory": "M",
"name": "Mn",
"size": 16,
"type": "string"
},
{
"desc": "Manufacturer specific value (32 chars)",
"label": "Model",
"mandatory": "M",
"name": "Md",
"size": 16,
"type": "string"
},
{
"desc": "Manufacturer specific value (16 chars)",
"label": "Options",
"name": "Opt",
"size": 8,
"type": "string"
},
{
"desc": "Manufacturer specific value (16 chars)",
"label": "Version",
"name": "Vr",
"size": 8,
"type": "string"
},
{
"desc": "Manufacturer specific value (32 chars)",
"label": "Serial Number",
"mandatory": "M",
"name": "SN",
"size": 16,
"type": "string"
},
{
"access": "RW",
"desc": "Modbus device address",
"label": "Device Address",
"name": "DA",
"type": "uint16"
},
{
"desc": "Force even alignment",
"name": "Pad",
"type": "pad"
}
],
"type": "group"
},
"id": 1
}
88 changes: 88 additions & 0 deletions json/model_10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"group": {
"desc": "To be included first for a complete interface description",
"label": "Communication Interface Header",
"name": "model_10",
"points": [
{
"desc": "Model identifier",
"label": "Model ID",
"mandatory": "M",
"name": "ID",
"static": "S",
"type": "uint16",
"value": 10
},
{
"desc": "Model length",
"label": "Model Length",
"mandatory": "M",
"name": "L",
"static": "S",
"type": "uint16"
},
{
"desc": "Overall interface status",
"label": "Interface Status",
"mandatory": "M",
"name": "St",
"symbols": [
{
"name": "DOWN",
"value": 0
},
{
"name": "UP",
"value": 1
},
{
"name": "FAULT",
"value": 2
}
],
"type": "enum16"
},
{
"access": "RW",
"desc": "Overall interface control (TBD)",
"label": "Interface Control",
"name": "Ctl",
"type": "uint16"
},
{
"desc": "Enumerated value. Type of physical media",
"label": "Physical Access Type",
"name": "Typ",
"symbols": [
{
"name": "UNKNOWN",
"value": 0
},
{
"name": "INTERNAL",
"value": 1
},
{
"name": "TWISTED_PAIR",
"value": 2
},
{
"name": "FIBER",
"value": 3
},
{
"name": "WIRELESS",
"value": 4
}
],
"type": "enum16"
},
{
"name": "Pad",
"type": "pad"
}
],
"type": "group"
},
"id": 10
}
Loading

0 comments on commit 4112252

Please sign in to comment.