CapacitorのBluetooth Low Energy プラグインはBLE通信に使用されます。
主な機能
「主な機能」のセクションinitialize- BLE プラグインを初期化する必要があります。どのメソッドよりも前に呼び出す必要があります。shimWebBluetooth- Capacitor Web Bluetooth シムをインストールする。navigator.bluetooth. Call this manually before using the Web Bluetooth API from a Capacitor native app.isAvailable- __CAPGO_KEEP_0__ Web Bluetooth シムをインストールする。isEnabled- __CAPGO_KEEP_0__ が利用可能かどうかを確認する。
- API が有効かどうかを確認する。
Section titled “Public API”| - 公開 API | - メソッド |
|---|---|
initialize | - 説明 |
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 | Bluetoothが利用可能かどうかを確認します。 |
isEnabled | Bluetoothが有効かどうかを確認します。 |
isLocationEnabled | 位置情報サービスが有効かどうかを確認します (Androidのみ)。 |
openAppSettings | アプリの設定画面を開きます。 |
openBluetoothSettings | Bluetoothの設定画面を開きます (Androidのみ)。 |
openLocationSettings | 位置情報の設定画面を開きます (Androidのみ)。 |
checkPermissions | 現在の許可状態を確認します。 |
requestPermissions | Bluetoothの許可を求めます。 |
startScan | BLEデバイスをスキャンします。 |
stopScan | BLEデバイスのスキャンを停止します。 |
connect | BLEデバイスに接続します。 |
disconnect | BLEデバイスから切断します。 |
createBond | Android用のBLEデバイスとバインドする。 |
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 | Get the native Capacitor plugin version. |
addListener | デバイスがスキャンされたイベントのリスナーを追加します。 |
addListener | デバイスが接続されたイベントのリスナーを追加します。 |
addListener | デバイスが切断されたイベントのリスナーを追加します。 |
addListener | 特性が変更されたイベントのリスナーを追加します。 |
removeAllListeners | このプラグインのすべてのリスナーを削除します。 |
真実の源
「真実の源」というセクションこのリファレンスは src/definitions.ts で capacitor-低消費電力Bluetooth.
capgoから続けてください @capacitor/capgo-低消費電力Bluetooth
「capgoから続けてください @capacitor/capgo-低消費電力Bluetooth」というセクションCapgoを使用している場合 capgo/capacitor-低消費電力Bluetooth Capgoを使用して Using @capgo/capacitor-bluetooth-low-energy for the native capability in Using @capgo/capacitor-bluetooth-low-energy, Capgo Enterprise Capgo Enterprise イオニック エンタープライズ プラグインの代替 __CAPGO_KEEP_0__ Enterprise Capgo の代替 Capgo の代替 Capgo のコンサルティング Capgo のコンサルティング