bluetoothCapabilityIsSupport(params: Object)

Requires:
DeviceKit≥2.2.1@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
import { device } from '@ray-js/ray';

const { bluetoothCapabilityIsSupport } = device;

// Promise usage
try {
  const res = await bluetoothCapabilityIsSupport({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Whether the Bluetooth device supports a given capability. The capability value maps to specific abilities: 0: whether DP is controllable during OTA; 1: whether the gateway and App use low-power online logic for this device; 2: whether it has Beacon capability; 3: whether Bluetooth LINK-layer encryption is enabled; 4: whether extension modules are supported; 5: whether scheduling is supported; 6: whether Bluetooth BT/BLE dual-mode is supported; 7: whether LINK-layer encryption is required

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesDevice ID
capabilitynumberYesCapability bit flags, consistent with the bluetoothCapabilityIsSupport method description 0: Whether DP is controllable during OTA 1: Whether the gateway and App use low-power online logic for this device 2: Whether Beacon capability is supported 3: Whether Bluetooth LINK-layer encryption is enabled 4: Whether extension modules are supported 5: Whether scheduling is supported 6: Whether Bluetooth BT/BLE dual-mode is supported 7: Whether LINK-layer encryption is mandatory
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionDeviceKit Since
isSupportbooleanResult callback for whether a Bluetooth-related capability is supported isSupport Whether supportedv3.3.0
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { device } from '@ray-js/ray'

device.bluetoothCapabilityIsSupport({
  deviceId: "xx",
  capability: 1,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});