@capgo/capacitor-bluetooth-low-energy
@Capacitor/__CAPGO_KEEP_1__-低功耗蓝牙
概述
概述部分Capacitor 蓝牙低能耗插件用于 BLE 通信。
核心功能
核心功能部分initialize- 初始化BLE插件。必须在调用任何其他方法之前调用。shimWebBluetooth- 安装Capacitor Web Bluetooth shim onnavigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.isAvailable- 检查设备上的蓝牙是否已启用。isEnabled- 公共__CAPGO_KEEP_0__
- 公共API
Section titled “Public API”| - 描述 | - 初始化BLE插件。必须在调用任何其他方法之前调用。 |
|---|---|
initialize | - 安装__CAPGO_KEEP_0__ Web Bluetooth shim on |
shimWebBluetooth | Install 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 | 请求MTU大小更改(仅Android)。 |
requestConnectionPriority | 请求连接优先级(仅Android)。 |
startAdvertising | 作为BLE服务器开始广播(BLE服务器)。 |
stopAdvertising | 停止广播。 |
startForegroundService | 启动前台服务以在后台维护BLE连接(仅Android)。 |
stopForegroundService | 停止前台服务(仅Android)。 |
getPluginVersion | 获取本地Capacitor插件版本。 |
addListener | 添加设备扫描事件的监听器。 |
addListener | 添加设备连接事件的监听器。 |
addListener | 添加设备断开连接事件的监听器。 |
addListener | 添加特征值改变事件的监听器。 |
removeAllListeners | 移除此插件的所有监听器。 |
数据源
名为“数据源”的部分此参考资料是从 src/definitions.ts 在 capacitor-低功耗蓝牙.
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 企业版插件替代方案 __CAPGO_KEEP_0__ 企业版 Capgo 企业版替代方案 Capgo 咨询服务 Capgo 咨询服务 for the product workflow in Capgo Consulting.