使用范围:UI2
Contents
component BleCentral ($UI/comp/bleCentral/components/bleCentral/bleCentral) extends BindComponent
Constructor Top
BleCentral () | |||
BleCentral ( options) |
Operations Top
connect (string device_id) | ||
disconnect () | ||
enable () | ||
isConnected (string device_id) | ||
isEnabled () | ||
list () | ||
notify
( 结构如下:) |
||
read
( 结构如下:) |
||
readRSSI (string device_id) | ||
scan (integet seconds) | ||
showBluetoothSettings () | ||
startNotification
( 结构如下:) |
||
startScan () | ||
startStateNotifications () | ||
stopNotification
( 结构如下:) |
||
stopScan () | ||
stopStateNotifications () | ||
write
( 结构如下:) |
||
writeCommand
( 结构如下:) |
||
writeWithoutResponse
( 结构如下:) |
Events Top
void | onError (ErrorEvent event) | |
void | onSuccess (SuccessEvent event) |
Constructor details
Top
public
BleCentral
()
低功耗蓝牙设备组件,cordova-plugin-ble-central插件的组件封装
public
BleCentral
( options)
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
public
BleCentral
()
public
BleCentral
( options)
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
Operations Detail Top
public
connect
(string device_id)
连接指定设备
public
disconnect
()
断开连接低功耗设备
public
enable
()
打开蓝牙
public
isConnected
(string device_id)
判断设备是否连接
public
isEnabled
()
蓝牙是否打开
public
list
()
获取设备列表
public
notify
(
结构如下:)
结构如下:)
注册提示信息
public
read
(
结构如下:)
结构如下:)
读数据
public
readRSSI
(string device_id)
读信号强度
public
scan
(integet seconds)
限时搜索蓝牙设备
public
showBluetoothSettings
()
打开蓝牙设置
public
startNotification
(
结构如下:)
结构如下:)
启动自动上报信息
public
startScan
()
搜索蓝牙设备
public
startStateNotifications
()
打开蓝牙状态提醒
public
stopNotification
(
结构如下:)
结构如下:)
停止自动上报信息
public
stopScan
()
停止搜索低功耗蓝牙设备
public
stopStateNotifications
()
关闭蓝牙状态提醒
public
write
(
结构如下:)
结构如下:)
带回复的写数据
public
writeCommand
(
结构如下:)
结构如下:)
写命令
public
writeWithoutResponse
(
结构如下:)
结构如下:)
无回复的写数据
Events Detail Top
请求失败
请求成功
See OnSuccess