getBLEDeviceRSSI
获取 BLE 外设的信号
引入
import { getBLEDeviceRSSI } from '@ray-js/ray';
需引入
DeviceKit
,且在>=1.2.6
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 deviceId 设备 Id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
signal | number | 设备信号 signal 若为 0,则获取失败 |
object.fail 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
errorMsg | string | 插件错误信息 |
errorCode | string | 错误码 |
innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
getBLEOnlineState
查询 BLE(thing)本地在线状态
引入
import { getBLEOnlineState } from '@ray-js/ray';
需引入
DeviceKit
,且在>=3.0.0
版本才可使用
参数
Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 设备模型 deviceId 设备 Id | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
isOnline | boolean | 蓝牙在线状态的回调 boolean 值 isOnline 是否在线 |
object.fail 回调参数
参数
Object res
属性 | 类型 | 说明 |
---|---|---|
errorMsg | string | 插件错误信息 |
errorCode | string | 错误码 |
innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
offBLEBigDataChannelDeviceToAppSuccess
取消监听:大数据从设备传输到 App 成功的事件
引入
import { offBLEBigDataChannelDeviceToAppSuccess } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.3.1
版本才可使用
参数
function callback
取消监听:大数据从设备传输到 App 成功的事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
data | array | 是 | data |
offBLEBigDataChannelProgressEvent
取消监听:BLE(thing)大数据通道传输进度
引入
import { offBLEBigDataChannelProgressEvent } from '@ray-js/ray';
需引入
DeviceKit
,且在>=3.0.0
版本才可使用
参数
function callback
取消监听:BLE(thing)大数据通道传输进度的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 大数据通道传输进度 deviceId 设备 id | |
progress | number | 是 | progress 传输进度,范围: 0 - 100 |
offBLEBigDataChannelUploadCloudProgress
取消监听:大数据上传到云端进度的事件
引入
import { offBLEBigDataChannelUploadCloudProgress } from '@ray-js/ray';
需引入
DeviceKit
,且在>=2.3.1
版本才可使用
参数
function callback
取消监听:大数据上传到云端进度的事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | 大数据通道传输进度 deviceId 设备 id | |
progress | number | 是 | progress 传输进度,范围: 0 - 100 |
offBLEConnectStatusChange
取消监听:BLE(thing)连接状态变更通知事件
引入
import { offBLEConnectStatusChange } from '@ray-js/ray';
需引入
DeviceKit
,且在>=3.0.0
版本才可使用
参数
function callback
取消监听:BLE(thing)连接状态变更通知事件的回调函数
回调参数 Object res
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
deviceId | string | 是 | BLE(thing)连接状态 deviceId: 设备 id | |
status | string | 是 | status 状态值 CONNECTED:已连接 CONNECTING:连接中 CONNECT_BREAK:连接失败 |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。