# BLEManagerDelegate ## onBluetoothStateDidChange 現在のBluetoothステータスをコールバックします。 ⚠️ 本機能はASR-M60DBモデルのみに対応しています。 ### コールバックが発生するタイミング Bluetooth ステータスが変更されるたびに呼ばれます。 例えば、Bluetooth の ON/OFF 状態や使用可能状態の変化を検知できます。 ```swift func onBluetoothStateDidChange(_ state: CBManagerState) ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 引数名 - 型 - 説明 * - state - CBManagerState - 現在の Bluetooth ステータス (例:poweredOn, poweredOff など) ``` ### サンプルコード ```swift func onBluetoothStateDidChange(_ state: CBManagerState) { switch state { case .poweredOn: print("Bluetooth は ON です") case .poweredOff: print("Bluetooth は OFF です") default: print("Bluetooth ステータス: \(state)") } } ``` --- ## onDiscover 現在のBluetoothオブジェクトをコールバックします。 ⚠️ 本機能はASR-M60DBモデルのみに対応しています。 ```swift func onDiscover(_ bluetoothModule: BluetoothModule) ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 引数名 - 型 - 説明 * - bluetoothModule - BluetoothModule - 詳細は[BluetoothModule](BluetoothModule.md)を参照 ``` ### コールバックが発生するタイミング [startScan](BLEManager_method.md#startscan)を呼び出す際に、このデリゲートメソッドをコールバックします。 ### サンプルコード ```swift func onDiscover(_ bluetoothModule: BluetoothModule) { }