Skip to content

Commit d496b84

Browse files
committed
not getting any data until cache cleared #65
1 parent 09a269a commit d496b84

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

src/MiScaleExporter.MAUI/Services/DataInterpreter.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ private void ValidateBluetoothAddress(string btAddress)
2020
}
2121
}
2222

23-
private MiScaleBodyComposition.S400Scale _s400Scale;
2423
public BodyComposition ComputeData(byte[] data, User _user, string btAddress)
2524
{
2625

@@ -96,20 +95,14 @@ public BodyComposition ComputeData(byte[] data, User _user, string btAddress)
9695
}
9796
case ScaleType.S400:
9897

99-
if (_s400Scale == null)
100-
{
101-
_s400Scale = new MiScaleBodyComposition.S400Scale();
102-
}
103-
10498
if(data.Length == 26)
10599
{
106100
this.ValidateAesKey(_user.BindKey);
107101
this.ValidateBluetoothAddress(btAddress);
108102

109-
var s400Result = _s400Scale.GetBodyComposition(user, new S400InputData
103+
var s400Scale = new MiScaleBodyComposition.S400Scale();
104+
var s400Result = s400Scale.GetBodyComposition(user, new S400InputData
110105
{
111-
//AesKeyBytes = aesKey,
112-
//MacBytes = mac,
113106
Data = data,
114107
AesKey = _user.BindKey,
115108
MacOriginal = btAddress,

src/MiScaleExporter.MAUI/Services/Scale.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Scale : IScale
1818
private byte[] _scannedData;
1919
private string _scaleBlutetoothAddress;
2020
private DateTime? _lastSuccessfulMeasure;
21-
private static bool _impedanceWaitFinished = false;
21+
private bool _impedanceWaitFinished = false;
2222
private bool _impedanceWaitStarted = false;
2323
private int _minWeight = 10; // in kilograms
2424
private const double KgToLbsConversion = 2.20462;

0 commit comments

Comments
 (0)