This commit is contained in:
Gunnar Beutner 2023-12-09 17:29:22 +01:00
parent 05812bd11a
commit ac41b08671
2 changed files with 3 additions and 2 deletions

View File

@ -460,7 +460,7 @@ bool BleFingerprint::fill(JsonObject *doc) {
(*doc)[F("rssi")] = channels[ble_channel_to_index(lastChannel)].rssi;
(*doc)[F("raw")] = serialized(String(channels[ble_channel_to_index(lastChannel)].raw, 2));
switch (lastChannel) {
/*switch (lastChannel) {
case 37:
(*doc)[F("rssi37")] = channels[0].rssi;
(*doc)[F("raw37")] = serialized(String(channels[0].raw, 2));
@ -474,7 +474,7 @@ bool BleFingerprint::fill(JsonObject *doc) {
(*doc)[F("raw39")] = serialized(String(channels[2].raw, 2));
break;
}
(*doc)[F("channel")] = lastChannel;
(*doc)[F("channel")] = lastChannel;*/
(*doc)[F("distance")] = serialized(String(filter.distance(), 2));
(*doc)[F("mean")] = serialized(String(filter.mean(), 2));

View File

@ -29,6 +29,7 @@ struct PhysicsBasedFilter {
}
// shift all existing measurements to the left and insert the new measurement at the end
// FIXME: this is kind of wasteful, just remember the insertion index
std::copy(measurements_.begin() + 1, measurements_.end(), measurements_.begin());
measurements_.back() = measuredDistance;