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
37 changes: 24 additions & 13 deletions schemas/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,56 @@
},
"source": {
"type": "object",
"description": "Source of data. An object containing at least the properties defined in 'properties', but can contain anything beyond that.",
"description": "Source of data, a record of where the data was received from. An object containing at least the properties defined in 'properties', but can contain anything beyond that.",
"required": [
"label",
"type"
],
"properties": {
"label": {
"type": "string"
"type": "string",
"description":"A label to identify the source bus, eg serial-COM1, eth-local,etc . Can be anything but should follow a predicatable format",
"example": "N2K-1"
},
"type": {
"type": "string",
"default": "NMEA2000"
"description":"A human name to identify the type. NMEA0183, NMEA2000, signalk",
"default": "NMEA2000",
"example": "NMEA2000"
},
"src": {
"type": "string",
"description": "NMEA2000 src value or any similar value for encapsulating the original source of the data"
"description": "NMEA2000 src value or any similar value for encapsulating the original source of the data",
"example":"36"
},
"pgn": {
"type": "number",
"description": "NMEA2000 pgn of the source message"
"description": "NMEA2000 pgn of the source message",
"example":"130312"
},
"sentence": {
"type": "string",
"description": "Sentence type of the source NMEA0183 sentence"
"description": "Sentence type of the source NMEA0183 sentence, $GP[RMC],092750.000,A,5321.6802,N,00630.3372,W,0.02,31.66,280511,,,A*43",
"example":"RMC"
},
"talker": {
"type": "string",
"description": "Talker id of the source NMEA0183 sentence"
"description": "Talker id of the source NMEA0183 sentence, $[GP]RMC,092750.000,A,5321.6802,N,00630.3372,W,0.02,31.66,280511,,,A*43",
"example":"GP"
}
}
},

"sourceRef": {
"type": "string",
"description": "Reference to the source under vessel's sources"
"description": "Reference to the source under vessel's sources. A dot spearated path to the data. eg [type].[bus].[device]",
"example":"NMEA0183.COM1.GP"
},

"version": {
"type": "string",
"description": "Version of the Signal K root object.",
"example": "1.0"
"description": "Version of the Signal K schema/APIs used by the root object.",
"example": "1.0.0"
},
"units": {
"type": "string",
Expand All @@ -69,7 +78,7 @@
"display": "Hz",
"quantity": "Frequency",
"quantityDisplay": "F",
"description": "Frequency in Herz"
"description": "Frequency in Hertz"
},
"m3": {
"display": "m\u00b3",
Expand Down Expand Up @@ -216,7 +225,8 @@
"description": "Maritime Mobile Service Identity (MMSI). Has to be 9 digits. See http://en.wikipedia.org/wiki/Maritime_Mobile_Service_Identity for information.",
"pattern": "^[2-7][0-9]{8,8}$",
"maxLength": 9,
"minLength": 9
"minLength": 9,
"example": "503123456"
},
"uuid": {
"type": "string",
Expand All @@ -226,7 +236,8 @@
},
"url": {
"type": "string",
"description": "A location of a resource, potentially relative. For hierarchical schemes (like http), applications must resolve relative URIs (e.g. './v1/api/'). Implementations should support the following schemes: http:, https:, mailto:, tel:, and ws:."
"description": "A location of a resource, potentially relative. For hierarchical schemes (like http), applications must resolve relative URIs (e.g. './v1/api/'). Implementations should support the following schemes: http:, https:, mailto:, tel:, and ws:.",
"example":"http://localhost:8080/signalk/v1/api/vessels/self/environment"
},

"commonValueFields": {
Expand Down
174 changes: 149 additions & 25 deletions schemas/delta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,186 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://signalk.github.io/specification/schemas/delta.json#",
"title": "SignalK Delta message schema",
"description": "Schema for defining updates to parts of a SignalK data model, for example for communicating updates of data",
"required": ["updates"],
"description": "Schema for defining updates and subscriptions to parts of a SignalK data model, for example for communicating updates of data",
"required": [
"updates" ],
"properties": {
"context": {
"type": "string",
"description": "The context path of the updates, eg. the top level path plus object identifier."
},

"description": "The context path of the updates, eg. the top level path plus object identifier.",
"example": "vessels.urn:mrn:signalk:uuid:6b0e776f-811a-4b35-980e-b93405371bc5" },
"updates": {
"type": "array",
"description": "The updates",
"items": {
"type": "object",
"required": ["values"],
"required": [
"values" ],
"properties": {
"source": {
"allOf": [{
"$ref": "./definitions.json#/definitions/source"
}, {
"properties": {
"instance": {
"type": "string"
"allOf": [
{
"$ref": "./definitions.json#/definitions/source" },
{
"properties": {
"instance": {
"type": "string" }
}
}
}]
]
},
"timestamp": {
"$ref": "./definitions.json#/definitions/timestamp"
},

"$ref": "./definitions.json#/definitions/timestamp" },
"values": {
"type": "array",
"items": {
"type": "object",
"required": ["path", "value"],
"required": [
"path",
"value" ],
"properties": {
"path": {
"type": "string"
},

"type": "string",
"description": "The local path to the data value",
"example": "navigation.courseOverGroundMagnetic" },
"value": {
"type": [
"string",
"number",
"object",
"boolean",
"null"
],

"additionalProperties": true
}
"null" ],
"additionalProperties": true }
}
}
}
}
}
},
"subscribe": {
"type": "array",
"description": "A subscription request",
"items": {
"type": "object",
"properties": {
"path": {
"description": "The relative path of the subscription, supports jsonPath syntax for complex matches",
"type": "string" },
"period": {
"description": "The period to repeat the message in millisecs",
"example": 1000,
"default": 1000,
"type": "integer" },
"format": {
"type": "string",
"description": "The message format for periodic messages",
"enum": [
"full",
"delta" ],
"default":"delta" },
"policy": {
"type": "string",
"description": "The policy rules for repetition. [instant]=send all changes as fast as they are received, but no faster than minPeriod. [ideal]=use instant policy, but send the value every `period` millisecs anyway, whether changed or not. [fixed]=send the last known values every period. ",
"enum": [
"instant",
"ideal",
"fixed" ],
"default":"ideal" },
"minPeriod": {
"type": "integer",
"description": "The the fastest message transmission rate allowed, e.g. every `minPeriod/1000` seconds." }
},
"required": [
"path" ]
}
},
"unsubscribe": {
"type": "array",
"description": "An unsubscribe request.",
"items": {
"type": "object",
"properties": {
"path": {
"description": "The relative path to unsubscribe, supports jsonPath syntax for complex matches",
"type": "string" },
"period": {
"description": "The period to repeat the message in millisecs",
"example": 1000,
"default": 1000,
"type": "integer" },
"format": {
"type": "string",
"description": "The message format for periodic messages",
"enum": [
"full",
"delta" ],
"default":"delta" },
"policy": {
"type": "string",
"description": "The policy rules for repetition. [instant]=send all changes as fast as they are received, but no faster than minPeriod. [ideal]=use instant policy, but send the value every `period` millisecs anyway, whether changed or not. [fixed]=send the last known values every period. ",
"enum": [
"instant",
"ideal",
"fixed" ],
"default":"ideal" },
"minPeriod": {
"type": "integer",
"description": "The the fastest message transmission rate allowed, e.g. every `minPeriod/1000` seconds." }
},
"required": [
"path" ]
}
},
"get": {
"type": "array",
"description": "A websockets equivalent to a REST GET request.This is for one-off requests, use the subscribe message for regular changes.",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path to GET, supports jsonPath syntax for complex matches" }
},
"required": [
"path" ]
}
},
"list": {
"type": "array",
"description": "Gets a list of known keys for this path",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path to list keys for, supports jsonPath syntax for complex matches" }
},
"required": [
"path" ]
}
},
"put": {
"type": "array",
"description": "A websockets equivalent to a REST PUT request. This is for one-off changes, use the updates message for regular changes.",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The relative path to set." },
"value": {
"type": [
"string",
"number",
"object",
"boolean",
"null" ],
"description": "The value to set at the path" },
"required": [
"path",
"value" ]
}
}
}
}
}
4 changes: 3 additions & 1 deletion schemas/discovery.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
".*": {
"description": "The name of a group of endpoints at the same version level",
"type": "object",
"required": ["version"],
"required": [
"version"
],
"properties": {
"version": {
"description": "The version this group supports",
Expand Down
15 changes: 11 additions & 4 deletions schemas/groups/environment.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,24 @@
"units": "ratio"
},
"engineRoom": {
"description": "Current engine room air temperature",
"$ref": "#/definitions/objectWithTemperature"
},
"mainCabin": {
"description": "Current main cabin air temperature",
"$ref": "#/definitions/objectWithTemperature"
},

"refrigerator": {
"description": "Current refrigerator temperature",
"$ref": "#/definitions/objectWithTemperature"
},
"freezer": {
"description": "Current freezer temperature",
"$ref": "#/definitions/objectWithTemperature"
},
"heating": {
"description": "Current heating temperature",
"$ref": "#/definitions/objectWithTemperature"
}
}
Expand All @@ -103,9 +108,11 @@
"units": "ratio"
},
"liveWell": {
"description": "Current livewell temperature",
"$ref": "#/definitions/objectWithTemperature"
},
"baitWell": {
"description": "Current baitwell air temperature",
"$ref": "#/definitions/objectWithTemperature"
}
}
Expand Down Expand Up @@ -141,7 +148,7 @@
},

"surfaceToTransducer": {
"description": "Depth transducer is below the water",
"description": "Depth transducer is below the water surface",
"$ref": "../definitions.json#/definitions/numberValue",
"units": "m"
}
Expand Down Expand Up @@ -185,19 +192,19 @@
"description": "Tide data",
"properties": {
"heightHigh": {
"description": "Next high tide",
"description": "Next high tide height relative to lowest astronomical tide (LAT/Chart Datum)",
"$ref": "../definitions.json#/definitions/numberValue",
"units": "m"
},

"heightNow": {
"description": "The current tide height",
"description": "The current tide height relative to lowest astronomical tide (LAT/Chart Datum)",
"$ref": "../definitions.json#/definitions/numberValue",
"units": "m"
},

"heightLow": {
"description": "The next low tide height",
"description": "The next low tide height relative to lowest astronomical tide (LAT/Chart Datum)",
"$ref": "../definitions.json#/definitions/numberValue",
"units": "m"
},
Expand Down
Loading