Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dfu.status.rsp.notecard.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"error",
"downloading",
"ready",
"outboard-ready",
"completed"
],
"sub-descriptions": [
Expand All @@ -43,6 +44,10 @@
"const": "ready",
"description": "The firmware data is fully downloaded."
},
{
"const": "outboard-ready",
"description": "The firmware data is fully downloaded and ready for an outboard DFU operation, where the Notecard will flash the firmware to the host MCU via the AUX or ALT_DFU pins."
},
{
"const": "completed",
"description": "The firmware has been installed."
Expand Down Expand Up @@ -87,6 +92,11 @@
"title": "DFU Error Status",
"description": "Example response showing download error.",
"json": "{\"mode\": \"error\", \"status\": \"download failed: checksum mismatch\", \"on\": true}"
},
{
"title": "DFU Outboard Ready Status",
"description": "Example response showing firmware is ready for an outboard DFU operation.",
"json": "{\"mode\": \"outboard-ready\", \"status\": \"successfully downloaded\", \"on\": true}"
}
]
}
4 changes: 2 additions & 2 deletions tests/test_dfu_status_rsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_minimal_valid_rsp(schema):

def test_valid_mode_enums(schema):
"""Tests valid mode enum values."""
valid_modes = ["idle", "error", "downloading", "ready", "completed"]
valid_modes = ["idle", "error", "downloading", "ready", "outboard-ready", "completed"]
for mode in valid_modes:
instance = {"mode": mode}
jsonschema.validate(instance=instance, schema=schema)
Expand All @@ -21,7 +21,7 @@ def test_mode_invalid_enum(schema):
instance = {"mode": "invalid"}
with pytest.raises(jsonschema.ValidationError) as excinfo:
jsonschema.validate(instance=instance, schema=schema)
assert "'invalid' is not one of ['idle', 'error', 'downloading', 'ready', 'completed']" in str(excinfo.value)
assert "'invalid' is not one of" in str(excinfo.value)

def test_mode_invalid_type(schema):
"""Tests invalid type for mode."""
Expand Down
Loading