diff --git a/schemas/cloudToDevice/ground_fix/ground-fix-example-with-alt.json b/schemas/cloudToDevice/ground_fix/ground-fix-example-with-alt.json new file mode 100644 index 0000000..a0956e8 --- /dev/null +++ b/schemas/cloudToDevice/ground_fix/ground-fix-example-with-alt.json @@ -0,0 +1,19 @@ +{ + "appId": "GROUND_FIX", + "messageType": "DATA", + "data": { + "lat": -45, + "lon": 100, + "uncertainty": 33, + "fulfilledWith": "WIFI", + "alt": [{ + "dist": 200, + "loc": { + "lat": -45.2334, + "lon": 99.7666, + "uncertainty": 700, + "fulfilledWith": "MCELL" + } + }] + } +} diff --git a/schemas/cloudToDevice/ground_fix/ground-fix-example-with-extras.json b/schemas/cloudToDevice/ground_fix/ground-fix-example-with-anchors.json similarity index 92% rename from schemas/cloudToDevice/ground_fix/ground-fix-example-with-extras.json rename to schemas/cloudToDevice/ground_fix/ground-fix-example-with-anchors.json index 2fac9a6..5d654fd 100644 --- a/schemas/cloudToDevice/ground_fix/ground-fix-example-with-extras.json +++ b/schemas/cloudToDevice/ground_fix/ground-fix-example-with-anchors.json @@ -6,7 +6,7 @@ "lon": 100, "uncertainty": 500, "fulfilledWith": "ANCHOR", - "anchors": [{ + "anchors": [{ "macAddress": "9F:11:7D:3A:4F:FF", "name": "PDX office" }] diff --git a/schemas/cloudToDevice/ground_fix/ground-fix.json b/schemas/cloudToDevice/ground_fix/ground-fix.json index 4fd7ed6..5f22e10 100644 --- a/schemas/cloudToDevice/ground_fix/ground-fix.json +++ b/schemas/cloudToDevice/ground_fix/ground-fix.json @@ -1,76 +1,129 @@ { - "title":"Ground Fix Response", - "description":"Responds with coordinates", - "type":"object", - "properties":{ - "appId":{ - "type":"string", - "const":"GROUND_FIX" - }, - "messageType":{ - "type":"string", - "const":"DATA" - }, - "data":{ - "type":"object", - "properties":{ - "lat":{ - "$ref": "#/definitions/Lat" - }, - "lon":{ - "$ref": "#/definitions/Lon" - }, - "uncertainty":{ - "$ref": "#/definitions/Uncertainty" - }, - "fulfilledWith":{ - "$ref": "#/definitions/FulfilledWith" - }, - "anchors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "macAddress": { "type": "string", "pattern": "^((([0-9A-F]{2}:){5})|([0-9A-F]{10}))([0-9A-F]{2})$" }, - "name": { "type": "string" } - }, - "required": ["macAddress"], - "additionalProperties": false - } + "title": "Ground Fix Response", + "description": "Responds with coordinates", + "type": "object", + "properties": { + "appId": { + "type": "string", + "const": "GROUND_FIX" + }, + "messageType": { + "type": "string", + "const": "DATA" + }, + "data": { + "type": "object", + "properties": { + "lat": { + "$ref": "#/definitions/Lat" + }, + "lon": { + "$ref": "#/definitions/Lon" + }, + "uncertainty": { + "$ref": "#/definitions/Uncertainty" + }, + "fulfilledWith": { + "$ref": "#/definitions/FulfilledWith" + }, + "alt": { + "type": "object", + "properties": { + "dist": { + "type": "number", + "description": "Distance in meters between the alternate location and the main location." + }, + "loc": { + "type": "object", + "properties": { + "lat": { + "$ref": "#/definitions/Lat" + }, + "lon": { + "$ref": "#/definitions/Lon" + }, + "uncertainty": { + "$ref": "#/definitions/Uncertainty" + }, + "fulfilledWith": { + "$ref": "#/definitions/FulfilledWith" + } + }, + "required": [ + "lat", + "lon", + "uncertainty", + "fulfilledWith" + ], + "additionalProperties": false + } + }, + "required": [ + "dist", "loc" + ], + "additionalProperties": false + }, + "anchors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "macAddress": { + "type": "string", + "pattern": "^((([0-9A-F]{2}:){5})|([0-9A-F]{10}))([0-9A-F]{2})$" + }, + "name": { + "type": "string" + } + }, + "required": [ + "macAddress" + ], + "additionalProperties": false + } + } + }, + "required": [ + "lat", + "lon", + "uncertainty", + "fulfilledWith" + ], + "additionalProperties": false + }, + "err": { + "type": "integer" + }, + "additionalProperties": false, + "required": [ + "appId", + "messageType" + ], + "definitions": { + "Lat": { + "type": "number", + "description": "GPS latitude", + "minimum": -90, + "maximum": 90 + }, + "Lon": { + "type": "number", + "description": "GPS longitude", + "minimum": -180, + "maximum": 180 + }, + "Uncertainty": { + "type": "integer", + "description": "HPE (horizontal positioning error) in meters" + }, + "FulfilledWith": { + "enum": [ + "MCELL", + "SCELL", + "WIFI", + "ANCHOR" + ], + "description": "How the request was fulfilled. WIFI is prioritized by the cloud. Falls back to SCELL/MCELL." } - }, - "required": [ "lat", "lon", "uncertainty", "fulfilledWith" ], - "additionalProperties": false - }, - "err": { - "type": "integer" - } - }, - "additionalProperties":false, - "required":[ - "appId", - "messageType" - ], - "definitions": { - "Lat":{ - "type":"number", - "description":"GPS latitude", - "minimum": -90, - "maximum": 90 - }, - "Lon":{ - "type":"number", - "description":"GPS longitude", - "minimum": -180, - "maximum": 180 - }, - "Uncertainty":{ - "type":"integer", - "description":"HPE (horizontal positioning error) in meters" - }, - "FulfilledWith": { - "enum": ["MCELL", "SCELL", "WIFI", "ANCHOR"], - "description": "How the request was fulfilled. WIFI is prioritized by the cloud. Falls back to SCELL/MCELL." - } + } } - } diff --git a/schemas/deviceToCloud/ground_fix/ground-fix-example.json b/schemas/deviceToCloud/ground_fix/ground-fix-example.json index 1e5dd7a..5df31b5 100644 --- a/schemas/deviceToCloud/ground_fix/ground-fix-example.json +++ b/schemas/deviceToCloud/ground_fix/ground-fix-example.json @@ -5,7 +5,9 @@ "doReply": true, "hiConf": false, "fallback": true, - "cont": false + "cont": false, + "alt": true, + "dist": 25 }, "data": { "wifi": { diff --git a/schemas/deviceToCloud/ground_fix/ground-fix.json b/schemas/deviceToCloud/ground_fix/ground-fix.json index 0dc7cd2..a47d1ce 100644 --- a/schemas/deviceToCloud/ground_fix/ground-fix.json +++ b/schemas/deviceToCloud/ground_fix/ground-fix.json @@ -33,6 +33,16 @@ "type": "boolean", "description": "nRF Cloud automatically uses your contributions to override our usual location response. To disable this behavior, set cont=false. This will ignore the contributions and proceed with the usual process for resolving your location.", "default": true + }, + "dist": { + "type": "number", + "description": "nRF Cloud combats stale and inaccurate Wi-Fi location data by comparing the distance between Wi-Fi and cell location (if provided). This parameter allows the user to customize this behavior by setting the distance threshold used in that comparison, with the requirement that cell location is also provided in the request. Measured in meters (m).", + "default": 0 + }, + "alt": { + "type": "boolean", + "description": "nRF Cloud makes its best effort to return the most quality location data possible. Sometimes that means choosing one location and throwing out the other. These details are omitted from the response to keep a small and succinct payload. Sending alt=true will allow you to see this alternate location and its distance from the chosen location in meters.", + "default": false } }, "additionalProperties": false