ESP32 - AirTag Documentation
Loading...
Searching...
No Matches
distance.h
Go to the documentation of this file.
1
8
9#pragma once
10#include <stdint.h>
11
15extern bool hasAvg;
16
20extern float rssiAvg;
21
28extern float txPower;
29
38extern float nFactor;
39
48void updateRssiAvg(int rssi);
49
66float estimateDistanceMeters(float rssi, float txPower, float n);
float txPower
Transmitter power at 1 meter (in dBm).
Definition distance.cpp:45
float nFactor
Path-loss exponent (environmental factor).
Definition distance.cpp:56
bool hasAvg
Flag to indicate whether the RSSI average has been initialized.
Definition distance.cpp:33
float rssiAvg
Stores the current smoothed RSSI average.
Definition distance.cpp:38
float estimateDistanceMeters(float rssi, float txPower, float n)
Estimate distance from RSSI using the log-distance path loss model.
Definition distance.cpp:91
void updateRssiAvg(int rssi)
Update the exponential moving average of the RSSI.
Definition distance.cpp:70