Skip to main content

DeviceCommand

One write to a device.

The frame is the whole command, in hex bytes, and is addressed to a characteristic rather than left to be inferred from the service that happens to declare a write. A device with more than one writable characteristic - a control point and a data channel, say - cannot be driven at all when the target is implied.

Bytes rather than a hex string, because the transport splits a command that exceeds the negotiated MTU. Splitting a string is a byte boundary the caller has to remember to double; splitting an array cannot land inside a byte.

Kind: Interface
Package: @ovok/native

Import​

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

TypeScript shape​

interface DeviceCommand {
serviceUuid: string;
characteristicUuid: string;
frame: readonly string[];
withoutResponse?: boolean;
delayBeforeWriteMs?: number;
}

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

Public members​

MemberTypeDetails
serviceUuidstring—
characteristicUuidstring—
framereadonly string[]—
withoutResponsebooleanOptional. Write without waiting for the device to acknowledge it. Some devices expose a write-without-response characteristic and nothing else, and a with-response write to one of those fails rather than degrading - the property simply is not there. It is the characteristic that decides this, not a preference, so it is declared alongside the one being written to.
delayBeforeWriteMsnumberOptional. Optional pause before this command is written. Some peripherals need a short settling window after notifications are enabled or after acknowledging a page of records.

Learn the workflow​

Continue with Bluetooth for the workflow context and examples.

Source​

View the declaration in the SDK source.