postBLEBigDataChannelWithProgress

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

const { postBLEBigDataChannelWithProgress } = device;

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

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

Description

Big-data channel operations with progress feedback. Different feedback is returned to the frontend via these events: 1. Device-to-app big-data transfer success: 【onBLEBigDataChannelDeviceToAppSuccess】; 2. Cloud upload progress: 【onBLEBigDataChannelUploadCloudProgress】; 3. BLE data channel transfer progress: 【onBLEBigDataChannelProgressEvent】

Parameters

PropertyTypeRequiredDescriptionMinimum SDK versions
deviceIdstringYesdeviceId Device ID—
requestParamsRecord<string, Record<string, any>>YesParameters required to establish data transfer command: Specific channel operation command; start/stop: open/close the big-data channel; type: data type to upload requestParams Channel command set { "command": "start", "type": "1" }—
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 SinceMinimum SDK versions
deviceIdstringdeviceId Device IDv3.3.0—
resultParamsRecord<string, Record<string, any>>Parameters upon completion of data transfer (type dps fileUrl) resultParams Parameters upon completion of data transferv3.3.0—
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

device.postBLEBigDataChannelWithProgress({
  deviceId: "xx",
  requestParams: {
    command: "start",
    type: "1"
  },
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});