mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 00:33:09 +02:00
switch cmd step 0 and 1 to fix small bug.
don't show no user notifications while receiving ignored Bluetooth data because if option ignore data out of range is activated this notification is called immediately.
This commit is contained in:
@@ -152,13 +152,13 @@ public class BluetoothMiScale extends BluetoothCommunication {
|
||||
boolean nextBluetoothCmd(int stateNr) {
|
||||
switch (stateNr) {
|
||||
case 0:
|
||||
// set notification on for weight measurement
|
||||
setNotificationOn(WEIGHT_MEASUREMENT_SERVICE, WEIGHT_MEASUREMENT_CHARACTERISTIC, WEIGHT_MEASUREMENT_CONFIG);
|
||||
break;
|
||||
case 1:
|
||||
// set notification on for weight measurement history
|
||||
setNotificationOn(WEIGHT_MEASUREMENT_SERVICE, WEIGHT_MEASUREMENT_HISTORY_CHARACTERISTIC, WEIGHT_MEASUREMENT_CONFIG);
|
||||
break;
|
||||
case 1:
|
||||
// set notification on for weight measurement
|
||||
setNotificationOn(WEIGHT_MEASUREMENT_SERVICE, WEIGHT_MEASUREMENT_CHARACTERISTIC, WEIGHT_MEASUREMENT_CONFIG);
|
||||
break;
|
||||
case 2:
|
||||
// configure scale to get only last measurements
|
||||
int uniqueNumber = getUniqueNumber();
|
||||
|
@@ -215,9 +215,7 @@ public class MainActivity extends ActionBarActivity implements
|
||||
|
||||
scaleBtData.setConvertedWeight(scaleBtData.getWeight(), OpenScale.getInstance(getApplicationContext()).getSelectedScaleUser().scale_unit);
|
||||
|
||||
if (OpenScale.getInstance(getApplicationContext()).addScaleData(scaleBtData) == -1) {
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_no_selected_user), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
OpenScale.getInstance(getApplicationContext()).addScaleData(scaleBtData);
|
||||
break;
|
||||
case BT_INIT_PROCESS:
|
||||
setBluetoothStatusIcon(R.drawable.bluetooth_connection_success);
|
||||
|
Reference in New Issue
Block a user