Skip to main content
Version: v3

mstConnect

Start from API_LEVEL 3.0 . Please refer to API_LEVEL.

Connecting Devices.

Type

function mstConnect(deviceAddress: DeviceAddress, callback: Callback): Result

Parameters

DeviceAddress

TypeDescription
ArrayBufferDevice MAC address, 6 bytes long, Uint8Array view recommended

Callback

TypeDescription
(result: ConnectResult) => voidConnection result callback function

ConnectResult

PropertyTypeDescriptionAPI_LEVEL
connectednumberConnection status, 0 - successful connection, 1 - failed connection, 2 - disconnected3.0
connect_idnumberThe ID of the connection is returned when the connection is successful3.0
dev_addrArrayBufferDevice MAC address, 6 bytes long, Uint8Array view recommended3.0

Result

TypeDescription
booleanThe result of the function call, true means success, false means failure

Example

import { mstConnect } from '@zos/ble'

// ...