CustomCaseSpec
One frame shape the device emits, selected by the monitor's caseSelectorBytes.
Kind: Interface
Package: @ovok/native
Import
import { CustomCaseSpec } from '@ovok/native/bt-management';
TypeScript shape
interface CustomCaseSpec {
selector: string;
kind: CustomCaseKind;
requiresStream?: boolean;
measurementTypeKey?: MeasurementTypeKey;
fields?: CustomFieldSpec[];
repeatedRecords?: {
recordBytes: number;
from?: number;
};
minLengthBytes?: number;
additionalMeasurements?: CustomMeasurementSpec[];
description?: string;
}
This is a type-level export; it has no call parameters.
Public members
| Member | Type | Details |
|---|---|---|
selector | string | Concatenated hex of the selector bytes that identifies this frame, e.g. "aa0f0801". Empty string when the characteristic declares no selector and has a single case. |
kind | CustomCaseKind | — |
requiresStream | boolean | Optional. Only accept this result after a stream case started the same measurement session. |
measurementTypeKey | MeasurementTypeKey | Optional. Required for a "result" case. Must be a type the declarative decoder supports. |
fields | CustomFieldSpec[] | Optional. Required and non-empty for a "result" case, forbidden otherwise. |
repeatedRecords | { recordBytes: number; from?: number; } | Optional. The frame is a run of fixed-width records, each decoded the same way. A device that hands over its stored history answers one request with every record it holds, back to back. Those are separate readings taken at separate times, so each is reported on its own rather than merged. Byte indexes are relative to a record, not to the frame, and are bounds-checked against recordBytes. A trailing part-record is ignored: a whole number of records is what the device sends, and half of one is not a reading. |
minLengthBytes | number | Optional. Shortest frame of this shape, when it is longer than the characteristic's minimum. A selector byte often decides how long the frame is: the Bluetooth blood-pressure profile puts a timestamp and a pulse rate behind flag bits, so one shape is seven bytes and another is sixteen. Without this, every case is bounded by the shortest of them and the later fields cannot be declared at all - which is how a pulse rate gets dropped from a device that reports one. Must be at least the characteristic's frame.minLengthBytes. A frame that arrives shorter than the case it selected decodes nothing and is reported, not guessed at. |
additionalMeasurements | CustomMeasurementSpec[] | Optional. Further readings the same frame carries. A multi-parameter monitor sends one frame holding a heart rate, an oxygen saturation and a temperature at once. Those are three measurements, not one with nine properties, so each is declared with its own type and its own fields and each is reported separately. Property names must still be unique across the whole frame, because the decoded object is flat. Only meaningful on a "result" case. |
description | string | Optional. — |
Learn the workflow
Continue with Bluetooth for the workflow context and examples.