Skip to main content

parseLepuDeviceInfo

Reads the reply to GET_INFO, or nothing if the frame is not one.

The command byte is checked rather than assumed, because this is the answer a driver decides its identity on: parsing some other frame as device info would produce a model number out of whatever bytes happened to sit at offset 20, and the gate would then pass on a coincidence.

A frame too short to hold the layout is refused for the same reason, as is one whose response type is anything but success: an error reply carries a reason where the device information would be, and reading it as a model number would identify the hardware from an error code. The vendor's own struct is at least 56 bytes; anything shorter than the serial length field cannot be read without inventing the parts that are missing.

Kind: Function
Package: @ovok/native

Import​

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

TypeScript signatures​

(frame: readonly string[]): LepuDeviceInfo | undefined
ParameterTypeDetails
framereadonly string[]—

Returns: LepuDeviceInfo | undefined.

Learn the workflow​

Continue with Bluetooth for the workflow context and examples.

Source​

View the declaration in the SDK source.