getEarPhoneBTConntectedStatus(params: Object)

Requires:
WearKit≥1.8.0@ray-js/ray≥1.7.82
Platforms:
iOSAndroid
import { wear } from '@ray-js/ray';

const { getEarPhoneBTConntectedStatus } = wear;

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

Description

Get earphone Bluetooth connection status.

Parameters

PropertyTypeRequiredDescription
devIdstringYesDevice name
complete() => voidNoCompletion callback (executed on both success and failure)
NoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Error Code

Error CodeError Message
10001Internal error
10082Bluetooth connection error
10083Device offline

Examples

Basic usage

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

wear.getEarPhoneBTConntectedStatus({
  devId: '',
  success: (result) => {
    console.log('getEarPhoneBTConntectedStatus success', result);
  },
  fail: error => {
    console.error(error);
  },
});