Skip to content

Feature: Add min/max fields for device field definitions #216

@RaulTrombin

Description

@RaulTrombin

Protocols as JSON Schema allow us to validate messages — not only their structure but also their content and limits.

example of a auto-generated jsonschema part:

....
        "gain_setting": {
          "description": "Analog gain setting (0 = low, 1 = normal, 2 = high)",
          "type": "integer",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0
        },
....

The maximum and minimum could be set directly to 2 and 0,
but the current definitions/ping360 doesn't contain the min/max fields,
which would allow us to automate protocol definitions like this.

Current definitions:

....
                    {
                        "name": "gain_setting",
                        "type": "u8",
                        "description": "Analog gain setting (0 = low, 1 = normal, 2 = high)"
                    },
....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions