Merge pull request #6 from markqvist/revert-4-patch-1
Revert "Fix RSSI offset for pre-msg RSSI notification"
This commit is contained in:
commit
cd4587cca2
6
LoRa.cpp
6
LoRa.cpp
@ -219,12 +219,6 @@ uint8_t LoRaClass::packetRssiRaw() {
|
|||||||
|
|
||||||
int LoRaClass::packetRssi() {
|
int LoRaClass::packetRssi() {
|
||||||
int pkt_rssi = (int)readRegister(REG_PKT_RSSI_VALUE);
|
int pkt_rssi = (int)readRegister(REG_PKT_RSSI_VALUE);
|
||||||
int8_t pkt_snr = ((int8_t)readRegister(REG_PKT_SNR_VALUE));
|
|
||||||
if pkt_snr < 0 {
|
|
||||||
pkt_rssi = pkt_rssi * 16 / 15;
|
|
||||||
} else {
|
|
||||||
pkt_rssi += pkt_snr / 4;
|
|
||||||
}
|
|
||||||
// TODO: change this to look at the actual model code
|
// TODO: change this to look at the actual model code
|
||||||
if (_frequency < 820E6) pkt_rssi -= 7;
|
if (_frequency < 820E6) pkt_rssi -= 7;
|
||||||
pkt_rssi -= 157;
|
pkt_rssi -= 157;
|
||||||
|
@ -144,7 +144,7 @@ void receiveCallback(int packet_size) {
|
|||||||
// recieved packet to the host.
|
// recieved packet to the host.
|
||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
Serial.write(CMD_STAT_RSSI);
|
Serial.write(CMD_STAT_RSSI);
|
||||||
Serial.write((uint8_t)(last_rssi+rssi_offset));
|
Serial.write((uint8_t)(last_rssi-rssi_offset));
|
||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
|
|
||||||
// And then write the entire packet
|
// And then write the entire packet
|
||||||
@ -170,7 +170,7 @@ void receiveCallback(int packet_size) {
|
|||||||
// recieved packet to the host.
|
// recieved packet to the host.
|
||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
Serial.write(CMD_STAT_RSSI);
|
Serial.write(CMD_STAT_RSSI);
|
||||||
Serial.write((uint8_t)(last_rssi+rssi_offset));
|
Serial.write((uint8_t)(last_rssi-rssi_offset));
|
||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
|
|
||||||
// And then write the entire packet
|
// And then write the entire packet
|
||||||
|
Loading…
Reference in New Issue
Block a user