跳过内容

@capgo/capacitor-低功耗蓝牙

Capacitor 低功耗蓝牙插件用于BLE通信。

Capacitor Bluetooth Low Energy Plugin for BLE communication.

  • initialize - 安装 __CAPGO_KEEP_0__ Web Bluetooth shim
  • shimWebBluetooth - 安装 Capacitor Web Bluetooth shim navigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.
  • isAvailable - 检查设备上是否有蓝牙功能。
  • isEnabled - 检查设备蓝牙是否已启用。
MethodDescription
initialize初始化 BLE 插件。必须在调用其他方法之前调用。
shimWebBluetooth安装 Capacitor Web Bluetooth shim。 navigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.
isAvailable- 检查设备上是否有蓝牙功能。
isEnabled- 检查设备蓝牙是否已启用。
isLocationEnabled检查是否启用位置服务 (仅限 Android).
openAppSettings打开应用设置页面.
openBluetoothSettings打开蓝牙设置页面 (仅限 Android).
openLocationSettings打开位置设置页面 (仅限 Android).
checkPermissions检查当前权限状态.
requestPermissions请求蓝牙权限.
startScan开始扫描BLE设备.
stopScan停止扫描BLE设备.
connect连接到BLE设备.
disconnect断开与BLE设备的连接.
createBond与BLE设备建立绑定 (仅限 Android).
isBonded检查设备是否已绑定 (仅限 Android).
discoverServices在连接设备上发现服务。
getServices获取一个设备的已发现服务。
getConnectedDevices获取已连接的设备列表。
readCharacteristic读取特征值。
writeCharacteristic将值写入特征。
startCharacteristicNotifications为特征启动通知。
stopCharacteristicNotifications停止特征的通知。
readDescriptor读取描述符值。
writeDescriptor将值写入描述符。
readRssi读取连接设备的RSSI(信号强度)。
requestMtu请求MTU大小更改(仅Android)。
requestConnectionPriority请求连接优先级(仅Android)。
startAdvertising开始作为外设进行广播 (BLE 服务器)。
stopAdvertising停止广播。
startForegroundService启动前台服务以在后台维持 BLE 连接 (仅 Android)。
stopForegroundService停止前台服务 (仅 Android)。
getPluginVersion获取本地 Capacitor 插件版本。
addListener添加设备扫描事件的监听器。
addListener添加设备连接事件的监听器。
addListener添加设备断开连接事件的监听器。
addListener添加特征值改变事件的监听器。
removeAllListeners移除此插件的所有监听器。

真实数据来源

标题:真实数据来源

本参考文档是从 src/definitions.tscapacitor-低功耗蓝牙.

从 @capgo/capacitor-低功耗蓝牙

标题:“从 @capgo/capacitor-低功耗蓝牙”

如果您正在使用 @capgo/capacitor-低功耗蓝牙 来规划迁移和企业运营,连接它与 使用 @capgo/capacitor-低功耗蓝牙 来使用 @capgo/capacitor-低功耗蓝牙 Capgo Enterprise Capgo企业版中使用Capgo企业版中的产品工作流程 Ionic Enterprise 插件替代品 为 Ionic Enterprise 插件替代品中的产品工作流程 Capgo替代品 为Capgo替代品中的产品工作流程 Capgo咨询 为Capgo咨询中的产品工作流程