0

私はBluetooth Low Energy Device(重量スケール)で作業しています。android.bluetooth.device.action.ACL_CONNECTEDはデバイスが切断された後に受信しました

私はいくつかのことを観察しました。 BLEデバイスとの接続を切断しようとすると、接続が切断されます。私はまた、次の行を呼び出して債券を削除します。

method = mBluetoothGatt.getDevice().getClass().getMethod("removeBond", (Class[]) null); 
method.invoke(mBluetoothGatt.getDevice(), (Object[]) null); 

しかし、数秒後に突然私のモバイルデバイスに接続されているように表示されます。モバイルデバイスのBluetoothをオフにすると、接続されたシンボルが表示されます(縮尺は変わりません)。携帯端末を飛行機モードに変更すると接続が切断されます。

Androidモニターで次のログを見ました。

11-14 10:55:23.438 15152-15207/? W/bt_btif: bta_dm_bl_change_cback : reason=0 
11-14 10:55:23.438 15152-15207/? W/bt_btm: btm_acl_update_busy_level :: evt.busy_level_flags : 0x0 
11-14 10:55:23.438 15152-15207/? W/bt_btif: bta_dm_bl_change_cback : reason=0 
11-14 10:55:23.439 15152-15207/? W/bt_smp: smp_br_connect_callback is called on unexpected transport 2 
11-14 10:55:23.439 15152-15207/? W/bt_btif: bta_dm_acl_change info: 0x0 
11-14 10:55:23.439 15152-15178/? W/bt_btif: btif_dm_upstreams_cback ev: BTA_DM_LINK_UP_EVT 
11-14 10:55:23.439 15152-15178/? W/bt_btif: BTA_DM_LINK_UP_EVT. Sending BT_ACL_STATE_CONNECTED 
11-14 10:55:23.443 18042-18042/com.beurer.connect.healthmanager 11-14 10:55:23.449 15152-15178/? D/BluetoothUtils: getBtEnabledContainers(): btContainers = [] 
11-14 10:55:23.472 15152-15178/? E/BluetoothRemoteDevices: aclStateChangeCallback: State:Connected to Device:18:7A:93:4C:69:XX, linktype is 2 
11-14 10:55:23.479 15152-15178/? D/BluetoothUtils: getBtEnabledContainers(): btContainers = [] 
11-14 10:55:23.481 15152-15178/? W/bt_btif: btif_dm_upstreams_cback ev: BTA_DM_BUSY_LEVEL_EVT 
11-14 10:55:23.482 15152-15178/? W/bt_btif: BTA_DM_BUSY_LEVEL_EVT :: p_data->busy_level.level_flags : 0x0 
11-14 10:55:23.484 18107-18107/? D/oneconnect[1.6.05-45_2]: BluetoothHelper.mBtStateReceiver - [action]android.bluetooth.device.action.ACL_CONNECTED [connState]0[address] - ($) 
11-14 10:55:23.488 3763-3848/? D/CompatibilityInfo: mCompatibilityFlags - 0 
11-14 10:55:23.488 3763-3848/? D/CompatibilityInfo: applicationDensity - 480 
11-14 10:55:23.488 3763-3848/? D/CompatibilityInfo: applicationScale - 1.0 
11-14 10:55:23.493 18107-18133/? D/BluetoothA2dp: getState(18:7A:93:4C:69:XX) 
11-14 10:55:23.493 3763-3763/? D/KnoxKeyguardUpdateMonitor: BroadcastReceiver onReceive 
11-14 10:55:23.493 3763-3763/? D/KnoxKeyguardUpdateMonitor: BroadcastReceiver onReceive action: android.bluetooth.device.action.ACL_CONNECTED 
11-14 10:55:23.493 3763-3763/? D/KnoxKeyguardUpdateMonitor: BroadcastReceiver ACTION_ACL_CONNECTED 
11-14 10:55:23.503 3763-4488/? D/CompatibilityInfo: mCompatibilityFlags - 0 
11-14 10:55:23.503 3763-4488/? D/CompatibilityInfo: applicationDensity - 480 
11-14 10:55:23.503 3763-4488/? D/CompatibilityInfo: applicationScale - 1.0 
11-14 10:55:23.513 15152-15342/? D/A2dpStateMachine: getConnectionState: 0 
11-14 10:55:23.514 3763-4436/? D/CompatibilityInfo: mCompatibilityFlags - 0 
11-14 10:55:23.514 3763-4436/? D/CompatibilityInfo: applicationDensity - 480 
11-14 10:55:23.515 3763-4436/? D/CompatibilityInfo: applicationScale - 1.0 
11-14 10:55:23.519 18107-18133/? D/BluetoothHeadset: getConnectionState() in if statement 
11-14 10:55:23.519 15152-15956/? W/HeadsetService: getConnectionState 
11-14 10:55:23.523 15152-15956/? W/HeadsetService: get Service 
11-14 10:55:23.523 15152-15956/? W/HeadsetService: service is not null 
11-14 10:55:23.524 4983-4983/? W/SearchService: Abort, client detached. 
11-14 10:55:23.524 15152-15956/? D/HeadsetService: enter getConnectionState 
11-14 10:55:23.525 15152-15956/? D/HeadsetService: getConnectionState is 0 
11-14 10:55:23.525 15152-15956/? W/HeadsetService: ret = 0 
11-14 10:55:23.527 4983-4983/? I/BistoWorker: handleCommonBroadcastIntent: android.bluetooth.device.action.ACL_CONNECTED 
11-14 10:55:23.532 15152-15354/? E/BluetoothRemoteDevices: getGearIsConnected false 
11-14 10:55:23.532 18107-18133/? D/oneconnect[1.6.05-45_2]: BluetoothActionHelper.isConnected - ($)69:D4 NO profile connected 
11-14 10:55:23.533 18107-18133/? D/oneconnect[1.6.05-45_2]: BluetoothActionHelper.isA2dpSinkConnected - ($)69:D4 mA2dpSlink not connected 
11-14 10:55:23.542 4983-4983/? I/BistoWorker: Not a bisto device: 18:7A:93:4C:69:D4 

私が接続を要求するときは、デバイスと接続するのが理想的です。私はなぜアンドロイドのBluetoothが接続を要求せずにデバイスと接続しているのかわかりません。

誰もがこれについて考えていますか?私が見つけた

========= UPDATE ==========

もう一つは、私は、デバイス(スケール)に接続しようとしたときに、それは私に

を与えています
11-15 14:46:38.473 3770-3770/? D/KnoxKeyguardUpdateMonitor: BroadcastReceiver onReceive action: android.bluetooth.device.action.ACL_CONNECTED 

しかし、私のサービスでは、次の値を返しました。

11-15 14:46:38.493 23031-23101/? D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=8 device=18:7A:93:4B:E1:XX 

133 GATT_FAILUREの場合は、4回の再接続を試みて処理しました。しかし、それはまだ133エラーを与えた。

答えて

0

おそらく、あなたの接続要求では、自動的にtrueに設定されています。 mBluetoothGatt = device.connectGatt(this, false, mGattCallback);は、第2パラメータとしてautoconnectフラグをとることに注意してください。

[connectGatt](https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#connectGatt(android.content.Context、boolean、android.bluetooth.BluetoothGattCallback)を確認してください)。

+0

私はfalseを設定しました。 mBluetoothGatt = device.connectGatt(getApplicationContext()、false、mBluetoothGattCallback); –

関連する問題