ESPCDFServiceParam
ESPCDFServiceParam is one parameter on an ESPCDFService. Use it the same way as device params when your UI binds to service-level state (feature flags, service metadata, etc.).
Properties
| Property | Type | Description |
|---|---|---|
name | string | Param name |
value | any | Current value |
type | string | Param type |
serviceName | optional | Parent service name |
operations | ESPCDFServiceParamOperation | SDK delegates |
_raw | any | Original SDK param |
events | ESPCDFOperationEventEmitter | Operation bus |
Common Workflows
Read and write a service param
import { initCDF } from "@espressif/rainmaker-base-cdf";
const espCDF = await initCDF({ sdkAdaptorRegistry });
const node = espCDF.nodeStore.getNodeById("node-id")!;
const service = node.services?.find((s) => s.name === "esp.service.time");
const param = service?.params.find((p) => p.name === "esp.param.tz");
await param?.setValue("Asia/Kolkata");
Error Handling
try {
await param!.setValue(newValue);
} catch (e) {
showErrorBanner("Service param update failed");
}
Related Resource
- ESPCDFService
- ESPCDFNode
- ESPCDFServiceParam source
- API Reference: