1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-02-06 17:13:36 +01: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:
OliE 2017-08-04 16:19:32 +02:00
parent 6e4e8a6e48
commit f81af62438
2 changed files with 5 additions and 7 deletions

View File

@ -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();

View File

@ -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);