CustomDeviceDefinition
A validated, ready-to-run custom device. Only defineCustomDevice produces one.
Kind: Interface
Package: @ovok/native
Import
import { CustomDeviceDefinition } from '@ovok/native/bt-management';
TypeScript shape
interface CustomDeviceDefinition {
readonly [CUSTOM_DEVICE_BRAND]: true;
readonly id: CustomDeviceId;
readonly spec: CustomDeviceSpec;
readonly nameMatch: RegExp;
readonly matchByService: boolean;
readonly oneReadingPerConnection: boolean;
readonly sessionPolicy?: CustomSessionPolicy;
readonly clockSync: ClockSyncCapability;
readonly reportsBondedEvent?: boolean;
readonly mainServices: IService[];
readonly stuckDataTimeout: number;
readonly fields: ReadonlyMap<string, CompiledCustomField>;
readonly frames: ReadonlyMap<string, CustomFrameSpec>;
readonly frameReader?: FrameReader;
readonly preferredMtu?: number;
readonly lepu?: CustomLepuSpec;
readonly tmb?: CustomTmbSpec;
readonly decorateReading?: CustomReadingDecorator;
readonly createFrameHandler?: CustomFrameHandlerFactory;
}
This is a type-level export; it has no call parameters.
Public members
| Member | Type | Details |
|---|---|---|
id | CustomDeviceId | — |
spec | CustomDeviceSpec | — |
nameMatch | RegExp | — |
matchByService | boolean | — |
oneReadingPerConnection | boolean | — |
sessionPolicy | CustomSessionPolicy | Optional. — |
clockSync | ClockSyncCapability | — |
reportsBondedEvent | boolean | Optional. Emit the bonded connection event after a successful connection. |
mainServices | IService[] | — |
stuckDataTimeout | number | — |
fields | ReadonlyMap<string, CompiledCustomField> | Keyed by ${measurementTypeKey}:${fieldName}, used to bounds-check every reading. |
frames | ReadonlyMap<string, CustomFrameSpec> | Frame declaration of every monitor characteristic, keyed by its 128-bit UUID. |
frameReader | FrameReader | Optional. Optional protocol frame reader for declarations whose notifications may be batched. |
preferredMtu | number | Optional. MTU to request once connected, when the declaration asked for one. |
lepu | CustomLepuSpec | Optional. Validated Lepu protocol declaration, with its UUIDs normalised. |
tmb | CustomTmbSpec | Optional. Validated TMB protocol declaration, with its UUIDs normalised. |
decorateReading | CustomReadingDecorator | Optional. Adds protocol metadata that is not a numeric measurement field. |
createFrameHandler | CustomFrameHandlerFactory | Optional. Creates per-device state for frames that need a protocol-specific decoder. |
__@CUSTOM_DEVICE_BRAND@2054 | true | — |
Learn the workflow
Continue with Bluetooth for the workflow context and examples.