Skip to content

SendDataToWirelessDevice

Source: src/AWS/IoTWireless/SendDataToWirelessDevice.ts

Runtime binding for iotwireless:SendDataToWirelessDevice — queue a downlink message to the bound wireless device from a deployed Lambda or Task. The message is delivered the next time the device opens a receive window.

Provide the SendDataToWirelessDeviceHttp implementation layer on the Function effect, bind the device in the init phase, then call the returned client at runtime.

// init
const sendData = yield* AWS.IoTWireless.SendDataToWirelessDevice(device);
// runtime — PayloadData is base64-encoded
const { MessageId } = yield* sendData({
PayloadData: Buffer.from("hello").toString("base64"),
TransmitMode: 1,
WirelessMetadata: { LoRaWAN: { FPort: 1 } },
});
// on the Function effect:
// .pipe(Effect.provide(AWS.IoTWireless.SendDataToWirelessDeviceHttp))