mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-05-20 23:40:32 -04:00
Fixed promiscuous mode.
This commit is contained in:
parent
23c580d0df
commit
3926e6706d
1 changed files with 37 additions and 37 deletions
|
@ -357,7 +357,8 @@ void ISR_VECT receive_callback(int packet_size) {
|
||||||
BaseType_t int_mask;
|
BaseType_t int_mask;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!promisc) {
|
bool ready = false;
|
||||||
|
if (!promisc) { // Not in promiscuous mode
|
||||||
// The standard operating mode allows large
|
// The standard operating mode allows large
|
||||||
// packets with a payload up to 500 bytes,
|
// packets with a payload up to 500 bytes,
|
||||||
// by combining two raw LoRa packets.
|
// by combining two raw LoRa packets.
|
||||||
|
@ -365,7 +366,6 @@ void ISR_VECT receive_callback(int packet_size) {
|
||||||
// packet sequence number and split flags
|
// packet sequence number and split flags
|
||||||
uint8_t header = LoRa->read(); packet_size--;
|
uint8_t header = LoRa->read(); packet_size--;
|
||||||
uint8_t sequence = packetSequence(header);
|
uint8_t sequence = packetSequence(header);
|
||||||
bool ready = false;
|
|
||||||
|
|
||||||
if (isSplitPacket(header) && seq == SEQ_UNSET) {
|
if (isSplitPacket(header) && seq == SEQ_UNSET) {
|
||||||
// This is the first part of a split
|
// This is the first part of a split
|
||||||
|
@ -442,6 +442,29 @@ void ISR_VECT receive_callback(int packet_size) {
|
||||||
getPacketData(packet_size);
|
getPacketData(packet_size);
|
||||||
ready = true;
|
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 (ready) {
|
||||||
#if MCU_VARIANT != MCU_ESP32 && MCU_VARIANT != MCU_NRF52
|
#if MCU_VARIANT != MCU_ESP32 && MCU_VARIANT != MCU_NRF52
|
||||||
|
@ -475,29 +498,6 @@ void ISR_VECT receive_callback(int packet_size) {
|
||||||
}
|
}
|
||||||
#endif
|
#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() {
|
bool startRadio() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue