Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 637f125

Browse files
committed
fix: update library usage
1 parent c78e48a commit 637f125

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/AGPS.tsx renamed to src/AGNSS.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { AGPSRequest } from '@nordicsemiconductor/asset-tracker-cloud-docs/protocol'
1+
import type { AGNSSRequest } from '@nordicsemiconductor/asset-tracker-cloud-docs/protocol'
22
import type { Static } from '@sinclair/typebox'
33
import { useContext, useState } from 'react'
44
import { MessageContext } from './Device.js'
55
import { useSettings } from './context/SettingsContext.js'
66
import { sendMessage } from './sendMessage.js'
77

8-
const AGPSDataTypes = {
8+
const AGNSSDataTypes = {
99
1: 'UTC parameters',
1010
2: 'Ephemerides',
1111
3: 'Almanac',
@@ -16,7 +16,7 @@ const AGPSDataTypes = {
1616
9: 'Satellite integrity data',
1717
}
1818

19-
export const AGPS = ({
19+
export const AGNSS = ({
2020
mcc,
2121
mnc,
2222
cell,
@@ -30,14 +30,14 @@ export const AGPS = ({
3030
const { endpoint } = useSettings()
3131
const [types, setTypes] = useState<number[]>([1, 2, 3, 4, 6, 7, 8, 9])
3232
const { messages } = useContext(MessageContext)
33-
const agpsMessages = messages.filter(({ topic }) => topic.endsWith('/agps'))
33+
const agnssMessages = messages.filter(({ topic }) => topic.endsWith('/agnss'))
3434

3535
return (
3636
<form className="card mt-4">
3737
<div className="card-header">Assisted GPS</div>
3838
<div className="card-body">
3939
<fieldset className="mb-3">
40-
{Object.entries(AGPSDataTypes).map(([k, v]) => {
40+
{Object.entries(AGNSSDataTypes).map(([k, v]) => {
4141
const t = parseInt(k, 10)
4242
return (
4343
<div className="form-check" key={k}>
@@ -60,9 +60,9 @@ export const AGPS = ({
6060
)
6161
})}
6262
</fieldset>
63-
{agpsMessages.length > 0 && (
63+
{agnssMessages.length > 0 && (
6464
<ul>
65-
{agpsMessages.map(({ payload }, k) => (
65+
{agnssMessages.map(({ payload }, k) => (
6666
<li key={k}>{payload.length} bytes</li>
6767
))}
6868
</ul>
@@ -73,14 +73,14 @@ export const AGPS = ({
7373
type="button"
7474
className="btn btn-primary"
7575
onClick={() => {
76-
const m: Static<typeof AGPSRequest> = {
76+
const m: Static<typeof AGNSSRequest> = {
7777
mcc,
7878
mnc,
7979
cell,
8080
area,
8181
types: types ?? [1, 2, 3, 4, 6, 7, 8, 9],
8282
}
83-
sendMessage({ endpoint })(m, 'agps/get').catch(console.error)
83+
sendMessage({ endpoint })(m, 'agnss/get').catch(console.error)
8484
}}
8585
>
8686
Request A-GPS data

src/UpdateUI.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as MccMncList from 'mcc-mnc-list'
22
import React, { useState } from 'react'
3-
import { AGPS } from './AGPS.js'
3+
import { AGNSS } from './AGNSS.js'
44
import { Device } from './Device.js'
55
import { GNSS } from './GNSS.js'
66
import { NetworkSurvey } from './NetworkSurvey.js'
@@ -376,7 +376,7 @@ export const UpdateUI = ({
376376
</div>
377377
<div className="col-12 col-md-8 col-lg-6 col-xl-5">
378378
<PGPS />
379-
<AGPS
379+
<AGNSS
380380
mnc={parseInt(mnc ?? '2', 10)}
381381
mcc={parseInt(mcc ?? '242', 10)}
382382
cell={cell ?? 33703719}

0 commit comments

Comments
 (0)