跳过内容

@capgo/capacitor-bluetooth-low-energy

@Capacitor/__CAPGO_KEEP_1__-低功耗蓝牙

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

核心功能

核心功能部分
  • initialize - 初始化BLE插件。必须在调用任何其他方法之前调用。
  • shimWebBluetooth - 安装Capacitor Web Bluetooth shim到__CAPGO_KEEP_1__。 navigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.
  • isAvailable - 检查设备蓝牙是否已启用。
  • isEnabled - 公共__CAPGO_KEEP_0__
- 描述- 初始化BLE插件。必须在调用任何其他方法之前调用。
initialize- 安装__CAPGO_KEEP_0__ Web Bluetooth shim到__CAPGO_KEEP_1__。
shimWebBluetoothInstall the Capacitor Web Bluetooth shim on 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仅在 Android 上请求 MTU 大小更改。
requestConnectionPriority仅在 Android 上请求连接优先级。
startAdvertising作为 BLE 服务器开始广播。
stopAdvertising停止广播。
startForegroundService仅在 Android 上启动前台服务以在后台维持 BLE 连接。
stopForegroundService仅在 Android 上停止前台服务。
getPluginVersion获取本地 Capacitor 插件版本。
addListener添加设备扫描事件的监听器。
addListener添加设备连接事件的监听器。
addListener添加设备断开连接事件的监听器。
addListener添加特征更改事件的监听器。
removeAllListeners移除此插件的所有监听器。

此参考资料是从 src/definitions.tscapacitor-低功耗蓝牙.

Keep going from @capgo/capacitor-bluetooth-low-energy

Section titled “Keep going from @capgo/capacitor-bluetooth-low-energy”

如果您正在使用 @capgo/capacitor-bluetooth-low-energy 来规划迁移和企业运营,连接它到 Using @capgo/capacitor-bluetooth-low-energy for the native capability in Using @capgo/capacitor-bluetooth-low-energy, Capgo 企业版 为Capgo 企业版的产品工作流程 Ionic 企业插件替代品 为Ionic 企业插件替代品的产品工作流程 Capgo 替代品 为Capgo 替代品的产品工作流程 Capgo 咨询 为Capgo 咨询的产品工作流程