changed number of fingerprint scans
minor parameter changes more log lines added VAP log to UI (debug) fixed missing wifi timestamp for android live data
This commit is contained in:
@@ -28,9 +28,12 @@ public:
|
||||
|
||||
void start() override {
|
||||
|
||||
// do NOT start twice!
|
||||
if (started) {return;}
|
||||
|
||||
// start scanning
|
||||
int res = QAndroidJniObject::callStaticMethod<int>("indoor/java/WiFi", "start", "()I");
|
||||
if (res != 0) {throw Exception("error while starting WiFi");}
|
||||
if (res != 1337) {throw Exception("error while starting WiFi");}
|
||||
started = true;
|
||||
|
||||
}
|
||||
@@ -49,6 +52,9 @@ public:
|
||||
// to-be-constructed sensor data
|
||||
WiFiMeasurements sensorData;
|
||||
|
||||
// tag all scan-entries with the current app runtime
|
||||
const Timestamp curTS = Timestamp::fromRunningTime();
|
||||
|
||||
// parse each mac->rssi entry
|
||||
for (int i = 0; i < (int)data.length(); i += 17+1+2) {
|
||||
const std::string bssid = data.substr(i, 17);
|
||||
@@ -56,7 +62,7 @@ public:
|
||||
const int8_t pad1 = data[i+18];
|
||||
const int8_t pad2 = data[i+19];
|
||||
if (pad1 != 0 || pad2 != 0) {Debug::error("padding error within WiFi scan result");}
|
||||
sensorData.entries.push_back(WiFiMeasurement(AccessPoint(bssid), rssi));
|
||||
sensorData.entries.push_back(WiFiMeasurement(AccessPoint(bssid), rssi, curTS));
|
||||
}
|
||||
|
||||
// call listeners
|
||||
|
||||
Reference in New Issue
Block a user