Fixed Wifi RTT errors

This commit is contained in:
2019-09-24 11:53:39 +02:00
parent f27ac2035b
commit 7fe99d4b23
2 changed files with 4 additions and 4 deletions

View File

@@ -254,12 +254,12 @@ public class MainActivity extends Activity {
// update UI for WIFI/BEACON/GPS
if (id == SensorType.WIFI || id == SensorType.IBEACON || id == SensorType.GPS) {
if (id == SensorType.WIFIRTT || id == SensorType.IBEACON || id == SensorType.GPS) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (id == SensorType.WIFI) {
if (id == SensorType.WIFIRTT) {
final TextView txt = (TextView) findViewById(R.id.txtWifi);
txt.setText(((++loadCounterWifi % 2) == 0) ? "wi" : "WI");
} else if (id == SensorType.IBEACON) {
@@ -465,7 +465,7 @@ public class MainActivity extends Activity {
sensors.add(wifirtt);
wifirtt.setListener(new mySensor.SensorListener() {
@Override public void onData(final long timestamp, final String csv) { add(SensorType.WIFIRTT, csv, timestamp); }
@Override public void onData(final SensorType id, final long timestamp, final String csv) {return; }
@Override public void onData(final SensorType id, final long timestamp, final String csv) { add(SensorType.WIFIRTT, csv, timestamp); }
});
}

View File

@@ -129,7 +129,7 @@ public class WiFiRTT extends mySensor {
if (res.getStatus() == RangingResult.STATUS_SUCCESS) {
success = 1;
timeStampInNS = res.getRangingTimestampMillis() * 1000;
timeStampInNS = res.getRangingTimestampMillis() * 1000000;
dist = res.getDistanceMm();
stdDevDist = res.getDistanceStdDevMm();
rssi = res.getRssi();