Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix: hardcode network mode
Browse files Browse the repository at this point in the history
In the future this will be either LTE-m or NB-IoT
  • Loading branch information
coderbyheart committed Mar 3, 2021
1 parent b61c426 commit 851f6ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions geolocateCell/geolocateCell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { CosmosClient } from '@azure/cosmos'
import {
cellId,
cellFromGeolocations,
NetworkMode,
} from '@nordicsemiconductor/cell-geolocation-helpers'
import { isSome } from 'fp-ts/lib/Option'

Expand Down Expand Up @@ -41,6 +42,7 @@ const geolocateCell: AzureFunction = async (
mccmnc: string
}
const c = cellId({
nw: NetworkMode.LTEm, // FIXME: remove harcoded LTE-m network mode
cell: parseInt(cell, 10),
area: parseInt(area, 10),
mccmnc: parseInt(mccmnc, 10),
Expand Down
6 changes: 5 additions & 1 deletion geolocateCellFromUnwiredLabs/geolocateCellFromUnwiredLabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { log } from '../lib/log'
import { fromEnv } from '../lib/fromEnv'
import { parseConnectionString } from '../lib/parseConnectionString'
import { CosmosClient } from '@azure/cosmos'
import { cellId } from '@nordicsemiconductor/cell-geolocation-helpers'
import {
cellId,
NetworkMode,
} from '@nordicsemiconductor/cell-geolocation-helpers'
import { resolveFromAPI } from './resolveFromAPI'
import { isLeft } from 'fp-ts/lib/Either'

Expand Down Expand Up @@ -63,6 +66,7 @@ const geolocateCellFromUnwiredLabs: AzureFunction = async (
mccmnc: string
}
const cell = {
nw: NetworkMode.LTEm, // FIXME: remove harcoded LTE-m network mode
cell: parseInt(c, 10),
area: parseInt(area, 10),
mccmnc: parseInt(mccmnc, 10),
Expand Down
12 changes: 10 additions & 2 deletions storeDeviceCellGeolocation/storeDeviceCellGeolocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import {
TwinChangeEvent,
} from '../lib/iotMessages'
import { batchToDoc } from '../lib/batchToDoc'
import { cellId } from '@nordicsemiconductor/cell-geolocation-helpers'
import {
cellId,
NetworkMode,
} from '@nordicsemiconductor/cell-geolocation-helpers'
import { exponential } from 'backoff'

const { connectionString } = fromEnv({
Expand Down Expand Up @@ -98,7 +101,12 @@ const queryCellGeolocation: AzureFunction = async (
}
const { cell, mccmnc, area } = res[0]
resolve({
cellId: cellId({ cell, mccmnc, area }),
cellId: cellId({
nw: NetworkMode.LTEm, // FIXME: remove harcoded LTE-m network mode,
cell,
mccmnc,
area,
}),
cell,
mccmnc,
area,
Expand Down

0 comments on commit 851f6ac

Please sign in to comment.