Skip to main content

CustomLepuSpec

Declares that a device speaks the Lepu/Viatom framed protocol.

The whole family shares one frame - start | cmd | ~cmd | type | seq | len | payload | crc8 - one checksum, and one generic opcode space. What it does not share is the meaning of the low opcodes: 0x08 polls realtime data on a BP2, starts a blood-pressure measurement on an AirBp and starts an ECG on a Lepod. A frame built for the wrong one is still well formed, so nothing in the protocol catches a driver bound to the wrong hardware.

That is why pollCommand may not be declared without expectedDeviceTypes. Registration refuses it, because a poll with nobody to check it against is exactly the mis-binding the gate exists to prevent.

Kind: Interface
Package: @ovok/native

Import​

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

TypeScript shape​

interface CustomLepuSpec {
protocol?: "v2" | "viatom-oxygen";
clockSyncProtocol?: "bp2" | "bp3";
fileTransfer?: "ecg" | "bp2" | "bp3";
ecgFileDecoder?: "raw-int16";
startBytes: string[];
requestStartByte?: string;
manufacturerDataProtocol?: "viatom-oxygen";
rejectEncryptionAtBytes?: number[];
write: {
serviceUuid: string;
characteristicUuid: string;
};
expectedDeviceTypes: number[];
pollCommand?: number;
pollIntervalMs?: number;
writeWithoutResponse?: boolean;
setClockBeforeInfo?: boolean;
}

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

Public members​

MemberTypeDetails
protocol"v2" | "viatom-oxygen"Optional. —
clockSyncProtocol"bp2" | "bp3"Optional. Clock payload format used before INFO, when clock synchronization is enabled.
fileTransfer"ecg" | "bp2" | "bp3"Optional. Download and report each stored file using the verified decoder for that device family.
ecgFileDecoder"raw-int16"Optional. Decoder used for stored ECG files. Omit this when the format is not verified.
startBytesstring[]The frame's leading byte. Most of the family uses a5, a smaller group 55, and a few accept either and settle on one at runtime - so it is a list.
requestStartBytestringOptional. The leading byte used when building a request. Defaults to the first start byte.
manufacturerDataProtocol"viatom-oxygen"Optional. Selects the OxyII service and framing when the advertisement says protocol V2.
rejectEncryptionAtBytesnumber[]Optional. Manufacturer-data byte indexes whose high nibble of 2 means encryption is required.
write{ serviceUuid: string; characteristicUuid: string; }Where commands are written. The service must be one this declaration also monitors.
expectedDeviceTypesnumber[]The models this declaration was written for, as the device reports them in its information reply. A device reporting anything else is never polled. These values are only ever observed on hardware. The vendor's own SDK binds a driver from the advertised name and never reads the model back, so there is no table of them to copy - which is what pollCommand being optional is for.
pollCommandnumberOptional. The opcode to poll with, once the device has proved it is one of those models. Leaving it out is a working mode, not an omission: the device is asked what it is, the answer is reported, and nothing else is sent. That is how a model number is learned in the first place, and it is safe on hardware nobody has identified yet.
pollIntervalMsnumberOptional. Delay before each realtime poll, for devices with a fixed polling cadence.
writeWithoutResponsebooleanOptional. Sends the command through the write-without-response characteristic.
setClockBeforeInfobooleanOptional. Sends the Viatom oximeter clock command before the information request.

Learn the workflow​

Continue with Bluetooth for the workflow context and examples.

Source​

View the declaration in the SDK source.