This topic describes more features that Fun provides for developing serverless applications in Link IoT Edge.
Develop and debug a continuous function
Function Compute supports continuous functions in Link IoT Edge. You can use Fun to develop and debug continuous functions in the same way as developing and debugging functions that run on demand. Specifically, you can use Fun to create a continuous function based on specific event content and run the invoke command to call and debug the function.
Develop a driver
{
"thingInfos": [
{
"productKey": "string",
"deviceName": "string",
"custom": {}
}
]
}
The productKey and deviceName parameters in the configuration specify the product key and identifier of the device associated with the driver.
const config parameter specifies the driver configuration:
const config = {
thingInfos: [
{
productKey: "string",
deviceName: "string",
custom: {}
}
]
};
const thingInfos = config.thingInfos;
thingInfos.forEach((thingInfo) => {
const light = new Light();
// The thingInfo format is just right for connector config, pass it directly.
const connector = new Connector(thingInfo, light);
connector.connect();
});
const config parameter in the driver code with the obtained driver configuration. Then you can pack the driver and upload the generated package to the IoT Platform console. For more information about the Config.get() operation, see Device connection SDK.Deploy a driver
zip -r <Your Project Name>.zip *
To upload the driver package, log on to the IoT Platform console and choose in the left-side navigation pane. On the Drivers page that appears, click the Custom Drivers tab and create a driver. Upload the driver package when creating the driver. Then you can use the driver in Link IoT Edge.