pull/108/merge
alligitor 2025-04-30 00:26:10 +01:00 committed by GitHub
commit 904284193a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 37 additions and 37 deletions

View File

@ -357,7 +357,8 @@ void ISR_VECT receive_callback(int packet_size) {
BaseType_t int_mask;
#endif
if (!promisc) {
bool ready = false;
if (!promisc) { // Not in promiscuous mode
// The standard operating mode allows large
// packets with a payload up to 500 bytes,
// by combining two raw LoRa packets.
@ -365,7 +366,6 @@ void ISR_VECT receive_callback(int packet_size) {
// packet sequence number and split flags
uint8_t header = LoRa->read(); packet_size--;
uint8_t sequence = packetSequence(header);
bool ready = false;
if (isSplitPacket(header) && seq == SEQ_UNSET) {
// This is the first part of a split
@ -442,6 +442,29 @@ void ISR_VECT receive_callback(int packet_size) {
getPacketData(packet_size);
ready = true;
}
} else { // In promiscuous mode
// In promiscuous mode, raw packets are
// output directly to the host
read_len = 0;
#if MCU_VARIANT != MCU_ESP32 && MCU_VARIANT != MCU_NRF52
last_rssi = LoRa->packetRssi();
last_snr_raw = LoRa->packetSnrRaw();
getPacketData(packet_size);
// We first signal the RSSI of the
// recieved packet to the host.
kiss_indicate_stat_rssi();
kiss_indicate_stat_snr();
// And then write the entire packet
kiss_write_packet();
#else
getPacketData(packet_size);
ready = true;
#endif
}
if (ready) {
#if MCU_VARIANT != MCU_ESP32 && MCU_VARIANT != MCU_NRF52
@ -475,29 +498,6 @@ void ISR_VECT receive_callback(int packet_size) {
}
#endif
}
} else {
// In promiscuous mode, raw packets are
// output directly to the host
read_len = 0;
#if MCU_VARIANT != MCU_ESP32 && MCU_VARIANT != MCU_NRF52
last_rssi = LoRa->packetRssi();
last_snr_raw = LoRa->packetSnrRaw();
getPacketData(packet_size);
// We first signal the RSSI of the
// recieved packet to the host.
kiss_indicate_stat_rssi();
kiss_indicate_stat_snr();
// And then write the entire packet
kiss_write_packet();
#else
getPacketData(packet_size);
packet_ready = true;
#endif
}
}
bool startRadio() {