postBLEBigDataChannelWithProgress(params: Object)

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);
}

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

PropertyTypeRequiredDescription
deviceIdstringYesdeviceId Device ID
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 Since
deviceIdstringdeviceId Device IDv3.3.0
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);
  },
});