概要
概要Capacitor Bluetooth Low Energy プラグイン
基本機能
概要initializeBLE プラグインを初期化する必要があります。どのメソッドも呼び出す前に呼び出してください。shimWebBluetooth- Capacitor Web Bluetooth shim をインストールするnavigator.bluetooth. API Web Bluetooth shim を手動で呼び出す前に、Capacitor ネイティブアプリから API Web Bluetooth shim を呼び出す。isAvailable- デバイス上の Bluetooth が利用可能かどうかを確認するisEnabled- デバイス上の Bluetooth が有効かどうかを確認する
Public API
Public API| Method | Description |
|---|---|
initialize | BLE プラグインを初期化する。どのメソッドも呼び出す前に必ず実行する。 |
shimWebBluetooth | Capacitor Web Bluetooth shimをインストールします。 navigator.bluetooth. API Web Bluetooth shim を手動で呼び出す前に、Capacitor ネイティブアプリから API Web Bluetooth shim を呼び出す。 |
isAvailable | デバイス上の Bluetooth が利用可能かどうかを確認する |
isEnabled | デバイス上のBluetoothを有効にしているかどうかを確認してください。 |
isLocationEnabled | 位置情報サービスが有効になっているかどうかを確認してください (Android 限定)。 |
openAppSettings | アプリの設定画面を開きます。 |
openBluetoothSettings | Bluetoothの設定画面を開きます (Android 限定)。 |
openLocationSettings | 位置情報の設定画面を開きます (Android 限定)。 |
checkPermissions | 現在の許可状態を確認してください。 |
requestPermissions | Bluetoothの許可を求めます。 |
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 | このプラグインのすべてのリスナーを削除します。 |
Capgo src/definitions.ts in capacitor-bluetooth-low-energy.
Capgoから続けて@capgo/capacitor-Bluetooth低エネルギー
@capgo/capacitor-Bluetooth Low EnergyCapgoを使用している場合、Bluetooth Low EnergyプラグインはCapacitorの標準機能です。 @capgo/capacitor-Bluetooth Low Energy migration計画とエンタープライズオペレーションを計画するには、 @capgo/capacitor-Bluetooth Low Energy for the native capability in Using @capgo/capacitor-bluetooth-low-energy Capgo 企業版 Capgoの製品ワークフローについてはCapgo Enterpriseを参照してください。 Ionic Enterprise Pluginの代替 Capgoの製品ワークフローについてはIonic Enterprise Pluginの代替を参照してください。 Capgoの代替 Capgoの製品ワークフローについてはCapgoの代替、 Capgoコンサルティング Capgoの製品ワークフローについてはCapgoコンサルティングを参照してください。