1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-23 00:33:09 +02:00

update array compare method

This commit is contained in:
OliE
2017-10-04 17:50:18 +02:00
parent 7641dcb032
commit cbf7f604cd
2 changed files with 3 additions and 3 deletions

View File

@@ -408,10 +408,9 @@ public abstract class BluetoothCommunication {
if (device.getName().toLowerCase().equals(btDeviceName.toLowerCase())) {
Log.d("BluetoothCommunication", btDeviceName + " found trying to connect...");
bluetoothGatt = device.connectGatt(context, false, gattCallback);
searchHandler.removeCallbacksAndMessages(null);
btAdapter.stopLeScan(scanCallback);
bluetoothGatt = device.connectGatt(context, false, gattCallback);
}
} catch (Exception e) {
setBtStatus(BT_STATUS_CODE.BT_UNEXPECTED_ERROR, e.getMessage());

View File

@@ -24,6 +24,7 @@ import com.health.openscale.core.OpenScale;
import com.health.openscale.core.datatypes.ScaleData;
import com.health.openscale.core.datatypes.ScaleUser;
import java.util.Arrays;
import java.util.Date;
import java.util.UUID;
@@ -108,7 +109,7 @@ public class BluetoothExcelvanCF369BLE extends BluetoothCommunication {
// if data is body scale type
if (data.length == 16 && data[0] == (byte)0xcf) {
if (!data.equals(receivedData)) { // accepts only one data of the same content
if (!Arrays.equals(data, receivedData)) { // accepts only one data of the same content
receivedData = data;
parseBytes(data);
}