getEncryptLocalKeyWithData

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

const { getEncryptLocalKeyWithData } = device;

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

Method signature
getEncryptLocalKeyWithData(params: )
Minimum SDK versions
iOSThingSmartDeviceKitBizBundle
≥ 5.2.0
Androidcom.thingclips.smart:thingsmart-bizbundle-devicekit
≥ 5.2.0

Description

Get the encrypted device localKey, used for special encryption during BLE(thing) big-data channel transfers

Parameters

PropertyTypeRequiredDescriptionMinimum SDK versions
deviceIdstringYesBig-data channel encryption calculation structure deviceId Device ID—
keyDeviceIdstringYeskeyDeviceId Device ID of the device whose encryption key needs to be transferred—
complete() => voidNoCompletion callback (executed on both success and failure)—
success(params: string) => voidNoCallback on successful API call—
fail(params: Object) => voidNoFailure callback—
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

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