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:
@@ -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());
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user