Fixed Wifi RTT errors
This commit is contained in:
@@ -254,12 +254,12 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
|
|
||||||
// update UI for WIFI/BEACON/GPS
|
// 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() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
if (id == SensorType.WIFI) {
|
if (id == SensorType.WIFIRTT) {
|
||||||
final TextView txt = (TextView) findViewById(R.id.txtWifi);
|
final TextView txt = (TextView) findViewById(R.id.txtWifi);
|
||||||
txt.setText(((++loadCounterWifi % 2) == 0) ? "wi" : "WI");
|
txt.setText(((++loadCounterWifi % 2) == 0) ? "wi" : "WI");
|
||||||
} else if (id == SensorType.IBEACON) {
|
} else if (id == SensorType.IBEACON) {
|
||||||
@@ -465,7 +465,7 @@ public class MainActivity extends Activity {
|
|||||||
sensors.add(wifirtt);
|
sensors.add(wifirtt);
|
||||||
wifirtt.setListener(new mySensor.SensorListener() {
|
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 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); }
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class WiFiRTT extends mySensor {
|
|||||||
|
|
||||||
if (res.getStatus() == RangingResult.STATUS_SUCCESS) {
|
if (res.getStatus() == RangingResult.STATUS_SUCCESS) {
|
||||||
success = 1;
|
success = 1;
|
||||||
timeStampInNS = res.getRangingTimestampMillis() * 1000;
|
timeStampInNS = res.getRangingTimestampMillis() * 1000000;
|
||||||
dist = res.getDistanceMm();
|
dist = res.getDistanceMm();
|
||||||
stdDevDist = res.getDistanceStdDevMm();
|
stdDevDist = res.getDistanceStdDevMm();
|
||||||
rssi = res.getRssi();
|
rssi = res.getRssi();
|
||||||
|
|||||||
Reference in New Issue
Block a user