CustomFieldSpec
One measurement property read out of a frame at fixed byte offsets.
The property name and unit are checked at registration against the measurement
catalog for the case's measurementTypeKey. A name the SDK does not know, or a unit
that is not the canonical one, is rejected - it would otherwise produce a measurement
the backend silently drops, or a number in the wrong unit.
Kind: Interface
Package: @ovok/native
Import
import { CustomFieldSpec } from '@ovok/native/bt-management';
TypeScript shape
interface CustomFieldSpec {
name: string;
byteIndexes: number[];
byteOrder?: CustomByteOrder;
encoding?: CustomFieldEncoding;
scale?: number;
offset?: number;
decimals?: number;
unit: string;
min?: number;
max?: number;
}
This is a type-level export; it has no call parameters.
Public members
| Member | Type | Details |
|---|---|---|
name | string | Property on the emitted measurement, e.g. "systolic". Must exist for the case's type. |
byteIndexes | number[] | Byte offsets into the frame, in the order the device puts them on the wire. |
byteOrder | CustomByteOrder | Optional. Defaults to "big". Use "little" when the least significant byte comes first. |
encoding | CustomFieldEncoding | Optional. Defaults to "uint". |
scale | number | Optional. Multiplied onto the raw value. Defaults to 1. Use it for unit and resolution conversion. |
offset | number | Optional. Added after scale. Defaults to 0. |
decimals | number | Optional. Round the result to this many decimals. 0-6. |
unit | string | Canonical unit for name. Declaring any other unit fails registration. |
min | number | Optional. Narrower accepted range than the catalog default. Must sit inside it. |
max | number | Optional. Narrower accepted range than the catalog default. Must sit inside it. |
Learn the workflow
Continue with Bluetooth for the workflow context and examples.