startBLEScanSync
iOS 单端插件方法。调用 connectBLEDevice 连接蓝牙设备前需要先调用该方法开启扫描。
开启扫描同步方法
引入
import { startBLEScanSync } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.1.6
版本才可使用startBLEScan 的同步版本
stopBLEScan
iOS 单端插件方法。不需要连接设备时调用该方法关闭扫描。
关闭扫描
引入
import { stopBLEScan } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.1.6
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
stopBLEScanSync
iOS 单端插件方法。不需要连接设备时调用该方法关闭扫描。
关闭扫描同步方法
引入
import { stopBLEScanSync } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.1.6
版本才可使用stopBLEScan 的同步版本
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
subscribeBLEConnectStatus
开始监听 BLE(thing)连接状态
引入
import { subscribeBLEConnectStatus } from '@ray-js/ray';
需引入
DeviceKit
,且在>=3.0.0
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 deviceId 设备 Id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
subscribeBLETransparentDataReport
开始监听 BLE(thing)设备数据透传通道上报
引入
import { subscribeBLETransparentDataReport } from '@ray-js/ray';
需引入
DeviceKit
,且在>=3.0.0
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 deviceId 设备 Id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
unsubscribeBLEConnectStatus
停止监听 BLE(thing)连接状态
引入
import { unsubscribeBLEConnectStatus } from '@ray-js/ray';
需引入
DeviceKit
,且在>=3.0.0
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 deviceId 设备 Id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
unsubscribeBLETransparentDataReport
停止监听 BLE(thing)设备数据透传通道上报
引入
import { unsubscribeBLETransparentDataReport } from '@ray-js/ray';
需引入
DeviceKit
,且在>=3.0.0
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 deviceId 设备 Id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
offFileTransferProgress
取消监听:传输文件的到蓝牙设备的进度事件
引入
import { offFileTransferProgress } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.4.0
版本才可使用
参数
function callback
取消监听:传输文件的到蓝牙设备的进度事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 设备 id | |
fileId | number | 是 | 文件 id | |
fileIdentifier | string | 是 | 文件标识符 | |
fileVersion | number | 是 | 文件版本 | |
filePath | string | 是 | 文件地址 | |
progress | number | 是 | 传输进度 |
onFileTransferProgress
传输文件的到蓝牙设备的进度事件
引入
import { onFileTransferProgress } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.4.0
版本才可使用
参数
function callback
传输文件的到蓝牙设备的进度事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 设备 id | |
fileId | number | 是 | 文件 id | |
fileIdentifier | string | 是 | 文件标识符 | |
fileVersion | number | 是 | 文件版本 | |
filePath | string | 是 | 文件地址 | |
progress | number | 是 | 传输进度 |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。