mirror of
https://github.com/Genaker/LoraSA.git
synced 2026-03-28 17:42:59 +01:00
@@ -55,6 +55,7 @@ struct ScanTaskResult
|
||||
size_t sz;
|
||||
uint32_t *freqs_khz;
|
||||
int16_t *rssis;
|
||||
int16_t prssi;
|
||||
};
|
||||
|
||||
struct ConfigTask
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "comms.h"
|
||||
|
||||
int packetRssi = 0;
|
||||
|
||||
int16_t RadioComms::configureRadio()
|
||||
{
|
||||
int16_t status =
|
||||
@@ -243,6 +245,7 @@ Message *_deserialize_scan_result(size_t len, size_t &p, uint8_t *packet)
|
||||
size_t rem = len - p;
|
||||
|
||||
message->payload.dump.sz = dump_sz;
|
||||
message->payload.dump.prssi = packetRssi;
|
||||
if (dump_sz > 0)
|
||||
{
|
||||
message->payload.dump.rssis = new int16_t[dump_sz];
|
||||
@@ -381,6 +384,8 @@ Message *RadioComms::receive(uint16_t timeout_ms)
|
||||
}
|
||||
radio.clearDio1Action();
|
||||
|
||||
packetRssi = radio.getRSSI(true);
|
||||
Serial.println("Lora Last Packet RSSI:" + String(packetRssi));
|
||||
size_t len = radio.getPacketLength(true);
|
||||
uint8_t *packet = msg;
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ LoRaConfig *configureLora(String cfg)
|
||||
LoRaConfig *lora = new LoRaConfig({
|
||||
freq : 0,
|
||||
bw : 500,
|
||||
sf : 7,
|
||||
sf : DEFAULT_LORA_SF,
|
||||
cr : 5,
|
||||
tx_power : DEFAULT_LORA_TX_POWER,
|
||||
preamble_len : 8,
|
||||
|
||||
@@ -78,6 +78,10 @@ LoRaConfig *configureLora(String cfg);
|
||||
#define DEFAULT_LORA_TX_POWER 1
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_LORA_SF
|
||||
#define DEFAULT_LORA_SF 7
|
||||
#endif
|
||||
|
||||
#define CREATE_MISSING_CONFIG true
|
||||
struct Config
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ build_flags =
|
||||
-DDEFAULT_TX=915
|
||||
-DDEFAULT_LORA_ENABLED=true
|
||||
-DDEFAULT_LORA_TX_POWER=22
|
||||
-DDEFAULT_LORA_SF=12
|
||||
|
||||
[env:heltec_wifi_lora_32_V3-OSD]
|
||||
platform = espressif32
|
||||
@@ -74,6 +75,8 @@ build_flags =
|
||||
-DHELTEC
|
||||
-DOSD_ENABLED
|
||||
-DOSD_SIDE_BAR
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
-DARDUINO_USB_MODE=1
|
||||
|
||||
[env:heltec_wifi_lora_32_V3_433]
|
||||
platform = espressif32
|
||||
@@ -150,6 +153,7 @@ build_flags =
|
||||
-DDEFAULT_LORA_ENABLED=true
|
||||
-DDEFAULT_IS_LORA_HOST=true
|
||||
-DDISPLAY_RAW_SCAN=1
|
||||
-DDEFAULT_LORA_SF=12
|
||||
|
||||
[env:lilygo-T3S3-v1-2-lr1121]
|
||||
platform = espressif32
|
||||
|
||||
@@ -1555,9 +1555,10 @@ void display_raw_scan(ScanTaskResult &dump)
|
||||
String frSign = ":";
|
||||
for (const auto &pair : maxMhzRssi)
|
||||
{
|
||||
if (i == 0 && maxMhzRssi.size() > 0)
|
||||
if (i == 0)
|
||||
{
|
||||
display.clear();
|
||||
display.drawString(100, 0, "R:" + String(dump.prssi));
|
||||
}
|
||||
|
||||
int16_t rssi = pair.second;
|
||||
@@ -1610,10 +1611,8 @@ void display_raw_scan(ScanTaskResult &dump)
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (maxMhzRssi.size() > 0)
|
||||
{
|
||||
display.display();
|
||||
}
|
||||
|
||||
display.display();
|
||||
}
|
||||
/*
|
||||
* If m.to is LOOP, the message is directed at this module; enact the message.
|
||||
|
||||
Reference in New Issue
Block a user