GetResourcePosition
Source:
src/AWS/IoTWireless/GetResourcePosition.ts
Runtime binding for iotwireless:GetResourcePosition — read the bound
wireless device’s position (WGS84, returned as a GeoJSON payload stream)
from a deployed Lambda or Task.
Reading Device Position
Section titled “Reading Device Position”Provide the GetResourcePositionHttp implementation layer on the
Function effect, bind the device in the init phase, then call the
returned client at runtime. The GeoJsonPayload is a byte Stream —
decode it to a string with Stream.mkString(Stream.decodeText(...)).
// initconst getPosition = yield* AWS.IoTWireless.GetResourcePosition(device);
// runtimeconst { GeoJsonPayload } = yield* getPosition();const geoJson = GeoJsonPayload === undefined ? undefined : yield* Stream.mkString(Stream.decodeText(GeoJsonPayload));// on the Function effect:// .pipe(Effect.provide(AWS.IoTWireless.GetResourcePositionHttp))