Skip to main content

CustomDeviceSpec

Plain, JSON-shaped declaration of a Bluetooth device the SDK has no class for.

Kind: Interface
Package: @ovok/native

Import​

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

TypeScript shape​

interface CustomDeviceSpec {
id?: string;
nameMatch?: string | RegExp;
matchByService?: boolean;
oneReadingPerConnection?: boolean;
sessionPolicy?: CustomSessionPolicy;
clockSync?: ClockSyncCapability;
stuckDataTimeoutMs: number;
services: CustomServiceSpec[];
preferredMtu?: number;
lepu?: CustomLepuSpec;
tmb?: CustomTmbSpec;
}

This is a type-level export; it has no call parameters.

Public members​

MemberTypeDetails
idstringOptional. Reported back as deviceData.name. Built-in names are reserved.
nameMatchstring | RegExpOptional. Advertised BLE name. Omit for a service-matched declaration.
matchByServicebooleanOptional. Match by one of this declaration's service UUIDs when the peripheral has no name.
oneReadingPerConnectionbooleanOptional. Report one result, then stay quiet until the next connection.
sessionPolicyCustomSessionPolicyOptional. Aggregate valid live samples into one result when the session ends.
clockSyncClockSyncCapabilityOptional. Declares the clock capability when a custom protocol has been verified.
stuckDataTimeoutMsnumberMilliseconds without a usable frame before the read is abandoned. 1000-6000000.
servicesCustomServiceSpec[]—
preferredMtunumberOptional. MTU to ask for once connected. A larger one carries a frame in fewer notifications and a command in fewer writes. Omit it to keep whatever the platform negotiates.
lepuCustomLepuSpecOptional. Declares the Lepu/Viatom framed protocol, which brings its own frame reader and its own command sequence. A declaration with this needs no services[].write: commands are built rather than written down, and are addressed through lepu.write.
tmbCustomTmbSpecOptional. Declares the TMB blood-pressure history protocol used by Viatom BP families.

Learn the workflow​

Continue with Bluetooth for the workflow context and examples.

Source​

View the declaration in the SDK source.