When miband2 auth success, let application show miband status is connected
This commit is contained in:
parent
08f2b0eb7c
commit
19fbe5719c
|
@ -112,13 +112,7 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||||
byte[] response = intent.getExtras().getByteArray(DeviceService.EXTRA_MIBAND2_AUTH_BYTE);
|
byte[] response = intent.getExtras().getByteArray(DeviceService.EXTRA_MIBAND2_AUTH_BYTE);
|
||||||
BluetoothGattCharacteristic temp = getCharacteristic(MiBand2Service.UUID_UNKNOWN_CHARACTERISTIC9);
|
BluetoothGattCharacteristic temp = getCharacteristic(MiBand2Service.UUID_UNKNOWN_CHARACTERISTIC9);
|
||||||
temp.setValue(response);
|
temp.setValue(response);
|
||||||
if ((temp.getProperties() & (BluetoothGattCharacteristic.PROPERTY_WRITE | BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE)) != 0) {
|
mBluetoothGatt.writeCharacteristic(temp);
|
||||||
Log.d("HELLO", "its looks ok");
|
|
||||||
}
|
|
||||||
if (!mBluetoothGatt.writeCharacteristic(temp)) {
|
|
||||||
Log.d("ERROR", "ERROR");
|
|
||||||
}
|
|
||||||
Log.d("HELLO", "HELLO");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +167,8 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||||
// this is apparently not needed anymore, and actually causes problems when bonding is not used/does not work
|
// this is apparently not needed anymore, and actually causes problems when bonding is not used/does not work
|
||||||
// so we simply not use the UUID_PAIR characteristic.
|
// so we simply not use the UUID_PAIR characteristic.
|
||||||
// .pair(builder)
|
// .pair(builder)
|
||||||
.testInit(builder);
|
.testInit(builder)
|
||||||
|
.setInitialized(builder);
|
||||||
//.requestDeviceInfo(builder)
|
//.requestDeviceInfo(builder)
|
||||||
//.requestBatteryInfo(builder);
|
//.requestBatteryInfo(builder);
|
||||||
// .sendUserInfo(builder)
|
// .sendUserInfo(builder)
|
||||||
|
|
Loading…
Reference in New Issue