Skip to content

feat: add PGNSS appID #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: v1
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions __tests__/schemas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { isValidSchema, getValidationWithDependencies } from '../utilities';

// @ts-ignore
const testGroup = ({ schemaName, schema, schemaTests }) => {
// pgps has an array response that is valid that needs to be converted to an array of arrays
// pgps and pgnss have an array response that is valid that needs to be converted to an array of arrays
const chosen =
schemaName === 'pgps' && Array.isArray(schemaTests)
['pgps', 'pgnss'].includes(schemaName.toLowerCase()) && Array.isArray(schemaTests)
? [schemaTests]
: schemaTests;

Expand Down
5 changes: 5 additions & 0 deletions schemas/cloudToDevice/pgnss-error/pgnss-err-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"appId": "PGNSS",
"messageType": "DATA",
"err": 42200
}
24 changes: 24 additions & 0 deletions schemas/cloudToDevice/pgnss-error/pgnss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"title":"PGNSS Position Error Response",
"description":"Responds with error. Successful response is documented in 'pgnss' directory.",
"type":"object",
"properties":{
"appId":{
"type":"string",
"const":"PGNSS"
},
"messageType":{
"type":"string",
"const":"DATA"
},
"err": {
"type":"integer"
}
},
"additionalProperties":false,
"required":[
"appId",
"messageType",
"err"
]
}
4 changes: 4 additions & 0 deletions schemas/cloudToDevice/pgnss/pgnss-config-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"pgps.nrfcloud.com",
"public/15286-79200_15293-64800.bin"
]
19 changes: 19 additions & 0 deletions schemas/cloudToDevice/pgnss/pgnss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"title": "PGNSS Success Response",
"description": "Responds with link to PGNSS file on success.",
"type": "array",
"prefixItems": [
{
"type": "string",
"description": "Host. The protocol agnostic URL for accessing PGNSS prediction files.",
"pattern": "pgps\\.nrfcloud\\.com"
},
{
"type": "string",
"description": "Path. The path to the file that contains PGNSS prediction data.",
"pattern": "public\\/.+.bin"
}
],
"minItems": 2,
"items": false
}
6 changes: 6 additions & 0 deletions schemas/deviceToCloud/pgnss/pgnss-default-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"appId": "PGNSS",
"messageType": "DATA",
"data": {
}
}
10 changes: 10 additions & 0 deletions schemas/deviceToCloud/pgnss/pgnss-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"appId": "PGNSS",
"messageType": "DATA",
"data": {
"startGpsDay": 234234,
"startGpsTimeOfDaySeconds": 85399,
"predictionCount": 84,
"predictionIntervalMinutes": 240
}
}
63 changes: 63 additions & 0 deletions schemas/deviceToCloud/pgnss/pgnss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"title": "PGNSS",
"description": "PGNSS request",
"type": "object",
"properties": {
"appId": {
"type": "string",
"const": "PGNSS"
},
"messageType": {
"type": "string",
"const": "DATA"
},
"data": {
"type": "object",
"properties": {
"startGpsDay": {
"$ref": "#/definitions/StartGpsDay"
},
"startGpsTimeOfDaySeconds": {
"$ref": "#/definitions/StartGpsTimeOfDaySeconds"
},
"predictionCount": {
"$ref": "#/definitions/PredictionCount"
},
"predictionIntervalMinutes": {
"$ref": "#/definitions/PredictionIntervalMinutes"
}
}
}
},
"definitions": {
"StartGpsDay": {
"type": "integer",
"description": "GPS day to start the predictions."
},
"StartGpsTimeOfDaySeconds": {
"type": "integer",
"description": "Time of day (in seconds) to start collecting the GPS predictions.",
"minimum": 0,
"maximum": 86400
},
"PredictionCount": {
"type": "integer",
"description": "Number of GPS predictions (4 hour periods) to return. There are 6 predictions per day. You can request up to 14 days.",
"minimum": 1,
"maximum": 84
},
"PredictionIntervalMinutes": {
"type": "integer",
"description": "The interval (in minutes) at which predictions are spaced.",
"minimum": 120,
"maximum": 480,
"multipleOf": 60
}
},
"required":[
"appId",
"messageType",
"data"
],
"additionalProperties": false
}