Skip to content

Commit

Permalink
feat: added 'alt' and 'dist' to ground fix schema
Browse files Browse the repository at this point in the history
  • Loading branch information
coleHafner committed Oct 17, 2024
1 parent ece32ca commit 1b074ce
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 75 deletions.
19 changes: 19 additions & 0 deletions schemas/cloudToDevice/ground_fix/ground-fix-example-with-alt.json
Original file line number Diff line number Diff line change
@@ -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"
}
}]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"lon": 100,
"uncertainty": 500,
"fulfilledWith": "ANCHOR",
"anchors": [{
"anchors": [{
"macAddress": "9F:11:7D:3A:4F:FF",
"name": "PDX office"
}]
Expand Down
199 changes: 126 additions & 73 deletions schemas/cloudToDevice/ground_fix/ground-fix.json
Original file line number Diff line number Diff line change
@@ -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."
}
}
}
}
4 changes: 3 additions & 1 deletion schemas/deviceToCloud/ground_fix/ground-fix-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"doReply": true,
"hiConf": false,
"fallback": true,
"cont": false
"cont": false,
"alt": true,
"dist": 25
},
"data": {
"wifi": {
Expand Down
10 changes: 10 additions & 0 deletions schemas/deviceToCloud/ground_fix/ground-fix.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b074ce

Please sign in to comment.