mirror of
https://github.com/sandeepmistry/arduino-LoRa.git
synced 2025-04-19 13:02:14 +03:00
Correct formula for packet RSSI, should be based on frequency
This commit is contained in:
parent
144786b3b7
commit
7f75498dfc
@ -36,12 +36,15 @@
|
||||
LoRaClass::LoRaClass() :
|
||||
_spiSettings(10E6, MSBFIRST, SPI_MODE0),
|
||||
_ss(10), _reset(9),
|
||||
_frequency(0),
|
||||
_packetIndex(0)
|
||||
{
|
||||
}
|
||||
|
||||
int LoRaClass::begin(long frequency)
|
||||
{
|
||||
_frequency = frequency;
|
||||
|
||||
// setup pins
|
||||
pinMode(_ss, OUTPUT);
|
||||
pinMode(_reset, OUTPUT);
|
||||
@ -156,7 +159,7 @@ int LoRaClass::parsePacket()
|
||||
|
||||
int LoRaClass::packetRssi()
|
||||
{
|
||||
return (readRegister(REG_PKT_RSSI_VALUE) - 164);
|
||||
return (readRegister(REG_PKT_RSSI_VALUE) - (_frequency < 868E6 ? 164 : 157));
|
||||
}
|
||||
|
||||
size_t LoRaClass::write(uint8_t byte)
|
||||
|
@ -40,6 +40,7 @@ private:
|
||||
SPISettings _spiSettings;
|
||||
int _ss;
|
||||
int _reset;
|
||||
int _frequency;
|
||||
int _packetIndex;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user