Skip to main content

defineCustomDevice

Validates a declaration and compiles it into a runnable device.

Every rule the declarative decoder relies on is checked here, at registration, because the alternative is a plausible wrong number at read time. Registration fails loudly - it throws, naming the exact position in the declaration - and a device that fails to compile is never scanned for.

Kind: Function
Package: @ovok/native

Import​

import { defineCustomDevice } from '@ovok/native/bt-management';

TypeScript signatures​

(spec: CustomDeviceSpec, options?: { decorateReading?: CustomReadingDecorator; createFrameHandler?: CustomFrameHandlerFactory; frameReader?: FrameReader; }): CustomDeviceDefinition
ParameterTypeDetails
specCustomDeviceSpec—
options{ decorateReading?: CustomReadingDecorator; createFrameHandler?: CustomFrameHandlerFactory; frameReader?: FrameReader; }—

Returns: CustomDeviceDefinition.

Learn the workflow​

Continue with Bluetooth for the workflow context and examples.

Source​

View the declaration in the SDK source.