- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在创建一个应用程序,它以编程方式与带有 android 应用程序的 BLE 设备连接。这是我的连接/断开代码
当用户点击连接按钮时
new Thread(new Runnable() {
@Override
public void run() {
mConnecting = true;
mConnectException = null;
mConnectWait.close(); // Reset the condition.
if (mConnectedGatt != null) {
// Reconnect to the BLE DEX adapter.
Logger.d(LOG_TAG, "going to connect");
mConnectedGatt.connect();
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(deviceAddress);
device.connectGatt(mContext, false, mGattCallback);
} else {
// Start scanning BLE devices.
Logger.d(LOG_TAG, "going to scan LE Devices");
scanLeDevice(true);
}
mConnectWait.block(); // Wait for connect to complete
try {
if (mConnected) {
connectCallback.onConnectSuccess();
} else { // Error occurred in the connecting process
if (null == mConnectException) {
mConnectException = new BleDexException(
"Failed to connect to the BLE DEX adapter",
BleDexException.ERROR_BLE_CONNECT_FAILED);
}
connectCallback.onConnectFailed(mConnectException);
}
} catch (Exception e) {
e.printStackTrace();
}
mConnecting = false;
}
}).start();
扫码:
if (!mBleScanning) {
// Stops scanning after a pre-defined scan period.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mBleScanning = false;
if ((null != mBleScanner) && (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON)) {
mBleScanner.stopScan(mScanCallback);
if (mConnecting) {
Logger.e(LOG_TAG, "Timed out in scanning BLE devices");
mConnectException = new BleDexException(
"Timed out in scanning BLE devices",
BleDexException.ERROR_BLE_CONNECT_FAILED);
mConnectWait.open();
}
}
}
}, mBleScanPeriod);
mBleScanning = true;
//ScanFilter scanFilter = new ScanFilter.Builder().setServiceUuid(new ParcelUuid(DEX_SERVICE_SPP)).build();
ScanFilter scanFilter = new ScanFilter.Builder().setDeviceName("DEXAdapter").build();
java.util.ArrayList<ScanFilter> scanFilterList = new java.util.ArrayList<ScanFilter>();
scanFilterList.add(scanFilter);
ScanSettings scanSettings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_BALANCED)
.build();
if((null != mBleScanner) && (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON))
mBleScanner.startScan(scanFilterList, scanSettings, mScanCallback);
}
} else {
Logger.d(LOG_TAG, "stop scanning. what 's the scan flag is: " + mBleScanning);
if (mBleScanning) {
mBleScanning = false;
if ((null != mBleScanner) && (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON))
mBleScanner.stopScan(mScanCallback);
}
}
这是配对 Intent 的广播接收器
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (BluetoothDevice.ACTION_PAIRING_REQUEST.equals(action)) {
if (mBtPin == null || mBtMacAddress == null) {
return;
}
// Programmatically set the Bluetooth PIN.
device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
pairingRequestType = intent.getIntExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT,
BluetoothDevice.ERROR);
Logger.d(LOG_TAG, "Received pairing request intent, Device mac address is: " + mBtMacAddress +
". Device pairingrequest type is: " + pairingRequestType);
if (device.getAddress().equals(mBtMacAddress)) {
try {
int btpin = Integer.parseInt(mBtPin);
Logger.d(LOG_TAG, "Set pin to BT = " + btpin);
byte[] pinbytes;
pinbytes = ("" + btpin).getBytes("UTF-8");
device.setPin(pinbytes);
abortBroadcast();
} catch (Exception e) {
e.printStackTrace();
}
}
} else if (BluetoothDevice.ACTION_BOND_STATE_CHANGED.equals(action)) {
int state = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, -1);
switch (state) {
case BluetoothDevice.BOND_NONE:
Logger.d(LOG_TAG, "Remote device is not bonded. Device: ");
case BluetoothDevice.BOND_BONDING:
Logger.d(LOG_TAG, "Remote device is in bonding process");
break;
case BluetoothDevice.BOND_BONDED:
Logger.d(LOG_TAG, "Remote device is paired");
BluetoothDevice bluetoothDevice = mBluetoothAdapter.getRemoteDevice(deviceAddress);
mConnectedGatt = bluetoothDevice.connectGatt(mContext, false, mGattCallback);
if (mConnectedGatt == null) {
Logger.e(LOG_TAG, "Failed to connect to GATT server");
if (mConnecting) {
mConnectException = new BleDexException(
"Failed to connect to GATT server",
BleDexException.ERROR_BLE_CONNECT_FAILED);
mConnectWait.open();
}
}
//scanLeDevice(false);
break;
}
}
}
};
会发生什么情况,只要我按下连接按钮,它就会检查设备是否已连接?如果不是,它将开始蓝牙 LE 扫描。我添加了用于扫描设备的 ScanFilter,以便它扫描受限设备。
一旦应用程序收到扫描回调,它就会使用 createbond() 方法对设备进行配对。一旦完成并完成配对,它将尝试连接蓝牙 gatt。
所有这一切在第一次尝试时就成功了。但一段时间后,应用程序会自动断开蓝牙设备。
这是自动断开的日志
07-05 15:15:26.101 6698 6698 D BleDexToolkitSample: Invoice send transaction initiated and is in progress.
07-05 15:15:26.103 6698 6765 D BleDexToolkitSample: SetConfigTransmissionControlNumber Success
07-05 15:15:26.103 6698 6765 D BleDexToolkitSample: SetConfigTestIndicator Success
07-05 15:15:26.103 6698 6765 D BleDexToolkitSample: SetRetailer Success
07-05 15:15:26.104 6698 6765 D BleDexToolkitSample: SetSupplier Success
07-05 15:15:26.112 6698 6765 D BleDexToolkitSample: BeginTransactionSet Success
07-05 15:15:26.115 6698 6765 D BleDexToolkitSample: WriteSTSegment Success
07-05 15:15:26.116 6698 6765 D BleDexToolkitSample: WriteG82Segment Success
07-05 15:15:26.116 6698 6765 D BleDexToolkitSample: WriteLoopStart Success
07-05 15:15:26.117 6698 6765 D BleDexToolkitSample: WriteG83Segment Success
07-05 15:15:26.117 6698 6765 D BleDexToolkitSample: WriteG83Segment Success
07-05 15:15:26.118 6698 6765 D BleDexToolkitSample: WriteG22Segment Success
07-05 15:15:26.118 6698 6765 D BleDexToolkitSample: WriteLoopEnd Success
07-05 15:15:26.118 6698 6765 D BleDexToolkitSample: WriteG84Segment Success
07-05 15:15:26.118 6698 6765 D BleDexToolkitSample: WriteG86Segment Success
07-05 15:15:26.118 6698 6765 D BleDexToolkitSample: WriteG85Segment Success
07-05 15:15:26.119 6698 6765 D BleDexToolkitSample: WriteSESegment Success
07-05 15:15:26.119 6698 6765 D BleDexToolkitSample: EndTransactionSet Success
07-05 15:15:26.136 6698 6723 D BleDexDevice: Initiated sending data: 05
07-05 15:15:27.168 6698 6723 D BleDexDevice: Initiated sending data: 05
07-05 15:15:28.174 1934 2382 W bt_btif : bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0008
07-05 15:15:28.175 1934 2382 W bt_btif : bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0008
07-05 15:15:28.175 1934 2382 W bt_btif : bta_gattc_conn_cback() - cif=6 connected=0 conn_id=6 reason=0x0008
07-05 15:15:28.176 1934 2049 D BtGatt.GattService: onConnected() connId=5, address=00:10:20:8E:26:97, connected=false
07-05 15:15:28.176 1934 2382 W bt_btif : bta_gattc_conn_cback() - cif=8 connected=0 conn_id=8 reason=0x0008
07-05 15:15:28.176 1934 2049 D BluetoothGattServer: onServerConnectionState() - status=0 serverIf=5 device=00:10:20:8E:26:97
07-05 15:15:28.180 1934 2049 D BtGatt.GattService: onDisconnected() - clientIf=8, connId=8, address=00:10:20:8E:26:97
07-05 15:15:28.181 6698 6711 D BluetoothGatt: onClientConnectionState() - status=8 clientIf=8 device=00:10:20:8E:26:97
07-05 15:15:28.181 6698 6711 E BleDexDevice: onConnectionStateChange failure status=8 newState=0
07-05 15:15:28.183 1934 2049 E BluetoothRemoteDevices: state12newState1
07-05 15:15:28.183 1934 2049 D BluetoothRemoteDevices: aclStateChangeCallback: State:DisConnected to Device:00:10:20:8E:26:97
07-05 15:15:28.189 6698 6698 D BleDexToolkitSample: BLE DEX Adapter disconnected.
07-05 15:15:28.193 1934 1934 D AvrcpBipRsp: onReceive: android.bluetooth.device.action.ACL_DISCONNECTED
07-05 15:15:28.193 1934 1934 D BluetoothMapService: onReceive
07-05 15:15:28.193 1934 1934 D BluetoothMapService: onReceive: android.bluetooth.device.action.ACL_DISCONNECTED
07-05 15:15:28.194 1934 1934 E BluetoothMapService: Unexpected error!
07-05 15:15:28.194 1934 1934 D BluetoothPbapReceiver: PbapReceiver onReceive action = android.bluetooth.device.action.ACL_DISCONNECTED
07-05 15:15:28.195 1934 1934 D BluetoothPbapReceiver: Calling start service with action = null
07-05 15:15:28.199 1934 1934 I BluetoothPbapReceiver: Exit - onReceive for intent:android.bluetooth.device.action.ACL_DISCONNECTED
07-05 15:15:28.199 1934 1934 D BluetoothPbapService: Enter - onStartCommand for service PBAP
07-05 15:15:28.200 1934 1934 D BluetoothPbapService: action: android.bluetooth.device.action.ACL_DISCONNECTED
07-05 15:15:28.200 1934 1934 D BluetoothPbapService: Exit - onStartCommand for service PBAP
07-05 15:15:28.203 1934 1952 E BtGatt.GattService: writeCharacteristic() - No connection for 00:10:20:8E:26:97...
07-05 15:15:28.203 6698 6723 D BleDexDevice: Initiated sending data: 05
07-05 15:15:28.219 1934 4912 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@b82a9b1
07-05 15:15:28.219 4939 4939 I BTLEASH : BTReceive action : android.bluetooth.device.action.ACL_DISCONNECTED :: Device : DEXAdapter
07-05 15:15:28.233 1934 1934 V BluetoothFtpService: PARSE INTENT action: android.bluetooth.device.action.ACL_DISCONNECTED
07-05 15:15:28.239 1934 1934 D BluetoothDunService: parseIntent: action: android.bluetooth.device.action.ACL_DISCONNECTED
现在我稍微改变了应用程序的行为,而不是配对和连接设备,我直接连接设备而不配对。通过此更改,我看到蓝牙连接在连接 30 秒后自动断开连接。以下是日志:
=Bluetooth Connected successfully logs =
07-10 13:27:00.554 5001 5001 D BleDexToolkitSample: Connecting to BLE DEX Adapter.
07-10 13:27:00.556 5001 5338 D BleDexDevice: device found, device address is: 00:10:20:8E:26:97
07-10 13:27:00.557 5001 5338 D BluetoothGatt: connect() - device: 00:10:20:8E:26:97, auto: false
07-10 13:27:00.558 5001 5338 D BluetoothGatt: registerApp()
07-10 13:27:00.558 5001 5338 D BluetoothGatt: registerApp() - UUID=9ed830a0-85b0-4192-9b4d-c9960f5bca84
07-10 13:27:00.560 1957 2829 D BtGatt.GattService: registerClient() - UUID=9ed830a0-85b0-4192-9b4d-c9960f5bca84
07-10 13:27:00.562 1957 2068 D BtGatt.GattService: onClientRegistered() - UUID=9ed830a0-85b0-4192-9b4d-c9960f5bca84, clientIf=9
07-10 13:27:00.562 5001 5015 D BluetoothGatt: onClientRegistered() - status=0 clientIf=9
07-10 13:27:00.563 1957 5052 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:00.564 1957 5052 I A2dpService: audio isMusicActive is false
07-10 13:27:00.565 1957 5052 D BtGatt.GattService: clientConnect() - address=00:10:20:8E:26:97, isDirect=true
07-10 13:27:00.565 1957 2068 D bt_btif_config: btif_get_address_type: Device [00:10:20:8e:26:97] address type 0
07-10 13:27:00.566 1957 2068 D bt_btif_config: btif_get_device_type: Device [00:10:20:8e:26:97] type 2
07-10 13:27:00.567 1957 2319 W bt_l2cap: l2cble_init_direct_conn
07-10 13:27:00.573 2198 2304 I WCNSS_FILTER: ibs_bt_device_wakeup: Writing IBS_WAKE_IND
07-10 13:27:01.577 2198 2325 I WCNSS_FILTER: ibs_wcnss_bt_device_sleep: TX Awake, Sending SLEEP_IND
07-10 13:27:01.926 1957 2319 W bt_btm : btm_acl_created hci_handle=4 link_role=0 transport=2
07-10 13:27:01.927 2198 2304 I WCNSS_FILTER: ibs_bt_device_wakeup: Writing IBS_WAKE_IND
07-10 13:27:01.946 1957 2068 D BtGatt.GattService: onConnected() connId=5, address=00:10:20:8E:26:97, connected=true
07-10 13:27:01.946 1957 2068 D BluetoothGattServer: onServerConnectionState() - status=0 serverIf=5 device=00:10:20:8E:26:97
07-10 13:27:01.946 1957 2319 W bt_smp : smp_br_connect_callback is called on unexpected transport 2
07-10 13:27:01.948 1957 2068 D bt_btif_config: btif_get_device_type: Device [00:10:20:8e:26:97] type 2
07-10 13:27:01.948 1957 2319 E bt_btif : bta_dm_acl_change new acl connetion:count = 1
07-10 13:27:01.949 1957 2319 W bt_btif : bta_dm_acl_change info: 0x0
07-10 13:27:01.949 1957 2319 W bt_l2cap: L2CA_SetDesireRole() new:x1, disallow_switch:0
07-10 13:27:01.949 1957 2068 D BluetoothRemoteDevices: Property type: 4
07-10 13:27:01.950 1957 2319 E bt_btif : bta_gattc_cache_load: can't open GATT cache file /data/misc/bluetooth/gatt_cache_0010208e2697 for reading, error: No such file or directory
07-10 13:27:01.952 1957 2068 D BluetoothRemoteDevices: Remote class is:7936
07-10 13:27:01.953 1957 2068 D BluetoothRemoteDevices: Property type: 5
07-10 13:27:01.953 1957 2068 D bt_btif_config: btif_get_device_type: Device [00:10:20:8e:26:97] type 2
07-10 13:27:01.953 1957 2068 I bt_btif_dm: get_cod remote_cod = 0x00001f00
07-10 13:27:01.953 1957 2068 I BluetoothBondStateMachine: bondStateChangeCallback: Status: 0 Address: 00:10:20:8E:26:97 newState: 1
07-10 13:27:01.954 1957 2068 I BluetoothBondStateMachine: sspRequestCallback: [B@f9753ea name: [B@ffc36db cod: 7936 pairingVariant 2 passkey: 0
07-10 13:27:01.955 1957 2068 D bt_btif_dm: remote version info [00:10:20:8e:26:97]: 0, 0, 0
07-10 13:27:01.957 1957 2068 E BluetoothRemoteDevices: state12newState0
07-10 13:27:01.957 1957 2068 D BluetoothRemoteDevices: aclStateChangeCallback: State:Connected to Device:00:10:20:8E:26:97
07-10 13:27:01.957 1957 2069 I BluetoothBondStateMachine: Bond State Change Intent:00:10:20:8E:26:97 OldState: 10 NewState: 11
07-10 13:27:01.957 1957 2069 I BluetoothBondStateMachine: Entering PendingCommandState State
07-10 13:27:01.958 2128 2128 W BluetoothEventManager: CachedBluetoothDevice for device 00:10:20:8E:26:97 not found, calling readPairedDevices().
07-10 13:27:01.961 2128 2128 E BluetoothEventManager: Got bonding state changed for 00:10:20:8E:26:97, but we have no record of that device.
07-10 13:27:01.974 1957 2068 D BtGatt.GattService: onConnected() - clientIf=9, connId=9, address=00:10:20:8E:26:97
07-10 13:27:01.975 5001 5015 D BluetoothGatt: onClientConnectionState() - status=0 clientIf=9 device=00:10:20:8E:26:97
07-10 13:27:01.975 5001 5015 D BluetoothGatt: discoverServices() - device: 00:10:20:8E:26:97
07-10 13:27:01.977 1957 2173 D BtGatt.GattService: discoverServices() - address=00:10:20:8E:26:97, connId=9
07-10 13:27:01.978 1957 1957 V BluetoothFtpService: Ftp Service onStartCommand
07-10 13:27:01.978 1957 1957 V BluetoothFtpService: PARSE INTENT action: android.bluetooth.device.action.BOND_STATE_CHANGED
07-10 13:27:01.984 5001 5001 D BleDexDevice: Received pairing request intent, Device mac address is: 00:10:20:8E:26:97. Device pairingrequest type is: 3
07-10 13:27:01.984 5001 5001 D BleDexDevice: Set pin to BT = 369371
07-10 13:27:01.986 1957 1957 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:01.987 1957 1957 D BluetoothFtpService: device: DEXAdapter
07-10 13:27:01.987 1957 2319 W bt_smp : SMP_PasskeyReply() - Wrong State: 1
07-10 13:27:01.990 1957 2319 E bt_btm : BTM_SetBlePhy failed, peer does not support request
07-10 13:27:01.993 1957 1957 D BluetoothDunService: parseIntent: action: android.bluetooth.device.action.BOND_STATE_CHANGED
07-10 13:27:02.000 1957 1957 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:02.002 1957 1957 D BluetoothDunService: device: DEXAdapter
07-10 13:27:02.456 1957 2319 W bt_btm : btm_read_remote_version_complete: BDA: 00-10-20-8e-26-97
07-10 13:27:02.456 1957 2319 W bt_btm : btm_read_remote_version_complete lmp_version 7 manufacturer 13 lmp_subversion 528
07-10 13:27:02.837 1957 2319 W bt_bta_gattc: bta_gattc_explore_srvc no more services found
07-10 13:27:02.840 1957 2068 D BtGatt.GattService: onSearchCompleted() - connId=9, status=0
07-10 13:27:02.843 1957 2068 D bt_bta_gattc: bta_gattc_get_gatt_db
07-10 13:27:02.845 1957 2068 D BtGatt.GattService: onGetGattDb() - address=00:10:20:8E:26:97
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got service with UUID=00001800-0000-1000-8000-00805f9b34fb
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got characteristic with UUID=00002a00-0000-1000-8000-00805f9b34fb
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got characteristic with UUID=00002a01-0000-1000-8000-00805f9b34fb
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got characteristic with UUID=00002a04-0000-1000-8000-00805f9b34fb
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got service with UUID=00001801-0000-1000-8000-00805f9b34fb
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got service with UUID=f000c0e0-0451-4000-b000-000000000000
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got characteristic with UUID=f000c0e1-0451-4000-b000-000000000000
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002902-0000-1000-8000-00805f9b34fb
07-10 13:27:02.846 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002901-0000-1000-8000-00805f9b34fb
07-10 13:27:02.847 1957 2068 D BtGatt.GattService: got characteristic with UUID=f000c0e2-0451-4000-b000-000000000000
07-10 13:27:02.847 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002901-0000-1000-8000-00805f9b34fb
07-10 13:27:02.847 1957 2068 D BtGatt.GattService: got service with UUID=f000ffd0-0451-4000-b000-000000000000
07-10 13:27:02.847 1957 2068 D BtGatt.GattService: got characteristic with UUID=f000ffd1-0451-4000-b000-000000000000
07-10 13:27:02.847 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002901-0000-1000-8000-00805f9b34fb
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got characteristic with UUID=f000ffd2-0451-4000-b000-000000000000
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002901-0000-1000-8000-00805f9b34fb
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got characteristic with UUID=f000ffd3-0451-4000-b000-000000000000
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002902-0000-1000-8000-00805f9b34fb
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002901-0000-1000-8000-00805f9b34fb
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got service with UUID=0000180f-0000-1000-8000-00805f9b34fb
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got characteristic with UUID=00002a19-0000-1000-8000-00805f9b34fb
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002902-0000-1000-8000-00805f9b34fb
07-10 13:27:02.848 1957 2068 D BtGatt.GattService: got descriptor with UUID=00002904-0000-1000-8000-00805f9b34fb
07-10 13:27:02.854 5001 5015 D BluetoothGatt: onSearchComplete() = Device=00:10:20:8E:26:97 Status=0
07-10 13:27:02.855 5001 5015 D BluetoothGatt: setCharacteristicNotification() - uuid: f000c0e1-0451-4000-b000-000000000000 enable: true
07-10 13:27:02.856 1957 1972 D BtGatt.GattService: registerForNotification() - address=00:10:20:8E:26:97 enable: true
07-10 13:27:02.857 1957 2068 D BtGatt.GattService: onRegisterForNotifications() - address=null, status=0, registered=1, handle=11
07-10 13:27:02.863 5001 5338 D BleDexToolkitSample: BLE DEX Adapter connection Success
07-10 13:27:02.870 5001 5001 D BleDexToolkitSample: BLE DEX Adapter connection Success.
07-10 13:27:03.863 2198 2325 I WCNSS_FILTER: ibs_wcnss_bt_device_sleep: TX Awake, Sending SLEEP_IND
07-10 13:27:07.947 2198 2304 I WCNSS_FILTER: ibs_bt_device_wakeup: Writing IBS_WAKE_IND
07-10 13:27:08.950 2198 2325 I WCNSS_FILTER: ibs_wcnss_bt_device_sleep: TX Awake, Sending SLEEP_IND
=android device disconneted the ble =
07-10 13:27:31.953 1957 2068 D bt_btif_config: btif_get_device_type: Device [00:10:20:8e:26:97] type 2
07-10 13:27:31.953 1957 2068 I bt_btif_dm: get_cod remote_cod = 0x00001f00
07-10 13:27:31.953 2172 5348 E bt_logger: Deleting old log file /data/media/0/bt_vnd_log20190710131438.txt
07-10 13:27:31.954 1957 2068 I BluetoothBondStateMachine: bondStateChangeCallback: Status: 1 Address: 00:10:20:8E:26:97 newState: 0
07-10 13:27:31.955 2172 5348 E bt_logger: Writing logs to file
07-10 13:27:31.955 1957 2069 D BluetoothAdapterProperties: Failed to remove device: 00:10:20:8E:26:97
07-10 13:27:31.962 2128 2128 W BluetoothEventManager: CachedBluetoothDevice for device 00:10:20:8E:26:97 not found, calling readPairedDevices().
07-10 13:27:31.964 1957 2069 I BluetoothBondStateMachine: Bond State Change Intent:00:10:20:8E:26:97 OldState: 11 NewState: 10
07-10 13:27:31.968 1957 2069 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:31.970 1957 2069 D A2dpService: Enter setPriority
07-10 13:27:31.972 1957 2069 D A2dpService: Saved priority 00:10:20:8E:26:97 = -1
07-10 13:27:31.972 1957 2069 D A2dpService: Exit setPriority
07-10 13:27:31.972 2128 2128 E BluetoothEventManager: Got bonding state changed for 00:10:20:8E:26:97, but we have no record of that device.
07-10 13:27:31.975 1957 2069 I BluetoothBondStateMachine: StableState(): Entering Off State
07-10 13:27:31.990 1957 1957 V BluetoothFtpService: Ftp Service onStartCommand
07-10 13:27:31.990 1957 1957 V BluetoothFtpService: PARSE INTENT action: android.bluetooth.device.action.BOND_STATE_CHANGED
07-10 13:27:31.994 1957 1957 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:31.994 1957 1957 D BluetoothFtpService: device: DEXAdapter
07-10 13:27:31.996 1957 1957 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:31.996 1957 1957 D BluetoothFtpService: BOND_STATE_CHANGED REFRESH trustDevices DEXAdapter
07-10 13:27:32.002 1957 1957 D BluetoothDunService: parseIntent: action: android.bluetooth.device.action.BOND_STATE_CHANGED
07-10 13:27:32.003 1957 1957 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:32.004 1957 1957 D BluetoothDunService: device: DEXAdapter
07-10 13:27:32.005 1957 1957 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:32.005 1957 1957 D BluetoothDunService: BOND_STATE_CHANGED REFRESH trustDevices DEXAdapter
07-10 13:27:32.020 1937 2199 W BluetoothEventManager: showUnbondMessage: Not displaying any message for reason: 9
07-10 13:27:32.021 2681 3699 I LicenseObserver: installLicenses - /storage/emulated/0/bt_vnd_log20190710132731.txt
07-10 13:27:34.953 1957 2066 D bt_osi_alarm: reschedule_root_alarm alarm expiration too close for posix timers, switching to guns
07-10 13:27:34.959 2198 2304 I WCNSS_FILTER: ibs_bt_device_wakeup: Writing IBS_WAKE_IND
07-10 13:27:34.994 1957 2319 W bt_btif : bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0016
07-10 13:27:34.994 1957 2319 W bt_btif : bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0016
07-10 13:27:34.995 1957 2319 W bt_btif : bta_gattc_conn_cback() - cif=6 connected=0 conn_id=6 reason=0x0016
07-10 13:27:34.995 1957 2319 W bt_btif : bta_gattc_conn_cback() - cif=7 connected=0 conn_id=7 reason=0x0016
07-10 13:27:34.995 1957 2319 W bt_btif : bta_gattc_conn_cback() - cif=8 connected=0 conn_id=8 reason=0x0016
07-10 13:27:34.995 1957 2068 D BtGatt.GattService: onConnected() connId=5, address=00:10:20:8E:26:97, connected=false
07-10 13:27:34.995 1957 2319 W bt_btif : bta_gattc_conn_cback() - cif=9 connected=0 conn_id=9 reason=0x0016
07-10 13:27:34.995 1957 2068 D BluetoothGattServer: onServerConnectionState() - status=0 serverIf=5 device=00:10:20:8E:26:97
07-10 13:27:34.996 1957 2319 I bt_btm_sec: btm_sec_disconnected clearing pending flag handle:4 reason:22
07-10 13:27:34.998 1957 2068 D BtGatt.GattService: onDisconnected() - clientIf=9, connId=9, address=00:10:20:8E:26:97
07-10 13:27:34.999 5001 5014 D BluetoothGatt: onClientConnectionState() - status=22 clientIf=9 device=00:10:20:8E:26:97
07-10 13:27:34.999 5001 5014 D BleDexDevice: onConnectionStateChange failure status=22 newState=0
07-10 13:27:34.999 2172 2172 E bt_logger: Logger Process: Invalid packet with no length field
07-10 13:27:34.999 2172 2172 E bt_logger: Error saving packet, buff = ound p_reg tcb_idx=0 gatt_if=9 conn_id=0x9�\
07-10 13:27:34.999 2172 2172 E bt_logger: Error saving packet, buff =
07-10 13:27:35.000 1957 2319 W bt_l2cap: L2CA_SetDesireRole() new:x1, disallow_switch:0
07-10 13:27:35.001 1957 2319 E bt_btif : bta_gattc_mark_bg_conn unable to find the bg connection mask for: 00:10:20:8e:26:97
07-10 13:27:35.002 1957 2068 E BluetoothRemoteDevices: state12newState1
07-10 13:27:35.002 1957 2068 D BluetoothRemoteDevices: aclStateChangeCallback: State:DisConnected to Device:00:10:20:8E:26:97
07-10 13:27:35.004 5001 5001 D BleDexToolkitSample: BLE DEX Adapter disconnected.
07-10 13:27:35.006 1957 1957 D AvrcpBipRsp: onReceive: android.bluetooth.device.action.ACL_DISCONNECTED
07-10 13:27:35.006 1957 1957 D BluetoothMapService: onReceive
07-10 13:27:35.006 1957 1957 D BluetoothMapService: onReceive: android.bluetooth.device.action.ACL_DISCONNECTED
07-10 13:27:35.006 1957 1957 E BluetoothMapService: Unexpected error!
07-10 13:27:35.008 1957 1957 D BluetoothPbapReceiver: PbapReceiver onReceive action = android.bluetooth.device.action.ACL_DISCONNECTED
07-10 13:27:35.009 1957 1957 D BluetoothPbapReceiver: Calling start service with action = null
07-10 13:27:35.012 1957 1957 I BluetoothPbapReceiver: Exit - onReceive for intent:android.bluetooth.device.action.ACL_DISCONNECTED
07-10 13:27:35.013 1957 1957 D BluetoothPbapService: Enter - onStartCommand for service PBAP
07-10 13:27:35.013 1957 1957 D BluetoothPbapService: action: android.bluetooth.device.action.ACL_DISCONNECTED
07-10 13:27:35.013 1957 1957 D BluetoothPbapService: Exit - onStartCommand for service PBAP
07-10 13:27:35.026 1957 2829 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:35.027 5034 5034 I BTLEASH : BTReceive action : android.bluetooth.device.action.ACL_DISCONNECTED :: Device : DEXAdapter
07-10 13:27:35.030 1957 1970 D A2dpService: getA2DPService(): returning com.android.bluetooth.a2dp.A2dpService@d4dde01
07-10 13:27:35.045 1957 1957 V BluetoothFtpService: Ftp Service onStartCommand
07-10 13:27:35.046 1957 1957 V BluetoothFtpService: PARSE INTENT action: android.bluetooth.device.action.ACL_DISCONNECTED
07-10 13:27:35.053 1957 1957 D BluetoothDunService: parseIntent: action: android.bluetooth.device.action.ACL_DISCONNECTED
07-10 13:27:36.005 2198 2325 I WCNSS_FILTER: ibs_wcnss_bt_device_sleep: TX Awake, Sending SLEEP_IND
^C
提前致谢。
最佳答案
Disconnect with reason 8 表示连接超时,这是硬件问题(不是软件问题)。连接超时失败的唯一原因(至少我现在能想到的)是当两个设备尝试使用两个不同的绑定(bind) key 时。然后两者都使用不同的 key 设置加密,然后因此失败。
您可以使用空气嗅探器找出断开连接的原因或时间。
关于android - 蓝牙连接与 Android 应用程序自动断开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57892013/
我是 C 语言新手,我编写了这个 C 程序,让用户输入一年中的某一天,作为返回,程序将输出月份以及该月的哪一天。该程序运行良好,但我现在想简化该程序。我知道我需要一个循环,但我不知道如何去做。这是程序
我一直在努力找出我的代码有什么问题。这个想法是创建一个小的画图程序,并有红色、绿色、蓝色和清除按钮。我有我能想到的一切让它工作,但无法弄清楚代码有什么问题。程序打开,然后立即关闭。 import ja
我想安装screen,但是接下来我应该做什么? $ brew search screen imgur-screenshot screen
我有一个在服务器端工作的 UDP 套接字应用程序。为了测试服务器端,我编写了一个简单的 python 客户端程序,它发送消息“hello world how are you”。服务器随后应接收消息,将
我有一个 shell 脚本,它运行一个 Python 程序来预处理一些数据,然后运行一个 R 程序来执行一些长时间运行的任务。我正在学习使用 Docker 并且我一直在运行 FROM r-base:l
在 Linux 中。我有一个 c 程序,它读取一个 2048 字节的文本文件作为输入。我想从 Python 脚本启动 c 程序。我希望 Python 脚本将文本字符串作为参数传递给 c 程序,而不是将
前言 最近开始整理笔记里的库存草稿,本文是 23 年 5 月创建的了(因为中途转移到 onedrive,可能还不止) 网页调起电脑程序是经常用到的场景,比如百度网盘下载,加入 QQ 群之类的 我
对于一个类,我被要求编写一个 VHDL 程序,该程序接受两个整数输入 A 和 B,并用 A+B 替换 A,用 A-B 替换 B。我编写了以下程序和测试平台。它完成了实现和行为语法检查,但它不会模拟。尽
module Algorithm where import System.Random import Data.Maybe import Data.List type Atom = String ty
我想找到两个以上数字的最小公倍数 求给定N个数的最小公倍数的C++程序 最佳答案 int lcm(int a, int b) { return (a/gcd(a,b))*b; } 对于gcd,请查看
这个程序有错误。谁能解决这个问题? Error is :TempRecord already defines a member called 'this' with the same paramete
当我运行下面的程序时,我在 str1 和 str2 中得到了垃圾值。所以 #include #include #include using namespace std; int main() {
这是我的作业: 一对刚出生的兔子(一公一母)被放在田里。兔子在一个月大时可以交配,因此在第二个月的月底,每对兔子都会生出两对新兔子,然后死去。 注:在第0个月,有0对兔子。第 1 个月,有 1 对兔子
我编写了一个程序,通过对字母使用 switch 命令将十进制字符串转换为十六进制,但是如果我使用 char,该程序无法正常工作!没有 switch 我无法处理 9 以上的数字。我希望你能理解我,因为我
我是 C++ 新手(虽然我有一些 C 语言经验)和 MySQL,我正在尝试制作一个从 MySQL 读取数据库的程序,我一直在关注这个 tutorial但当我尝试“构建”解决方案时出现错误。 (我正在使
仍然是一个初学者,只是尝试使用 swift 中的一些基本函数。 有人能告诉我这段代码有什么问题吗? import UIKit var guessInt: Int var randomNum = arc
我正在用 C++11 编写一个函数,它采用 constant1 + constant2 形式的表达式并将它们折叠起来。 constant1 和 constant2 存储在 std::string 中,
我用 C++ 编写了这段代码,使用运算符重载对 2 个矩阵进行加法和乘法运算。当我执行代码时,它会在第 57 行和第 59 行产生错误,非法结构操作(两行都出现相同的错误)。请解释我的错误。提前致谢:
我是 C++ 的初学者,我想编写一个简单的程序来交换字符串中的两个字符。 例如;我们输入这个字符串:“EXAMPLE”,我们给它交换这两个字符:“E”和“A”,输出应该类似于“AXEMPLA”。 我在
我需要以下代码的帮助: 声明 3 个 double 类型变量,每个代表三角形的三个边中的一个。 提示用户为第一面输入一个值,然后 将用户的输入设置为您创建的代表三角形第一条边的变量。 将最后 2 个步
我是一名优秀的程序员,十分优秀!