@edgeflowjs/device
v0.2.2
Published
Hardware abstraction layer: GPIO, Serial, Network, System, Identity ports.
Readme
@edgeflowjs/device
Hardware abstraction layer: GPIO, Serial, Network, System, Identity ports.
Install
pnpm add @edgeflowjs/deviceExports
Types only (interfaces). Implementations come from adapters:
DeviceApi,DeviceAdapterGpioPort,SerialPort,NetworkPort,SystemPort,IdentityPortDeviceEvent
Usage
Consume the API; provide an adapter (e.g. @edgeflowjs/device-sim):
import type { DeviceAdapter } from "@edgeflowjs/device";
import { createSimDevice } from "@edgeflowjs/device-sim";
const device: DeviceAdapter = createSimDevice();
await device.gpio.read(17);
device.setNetworkOnline(true); // SimDevice extension