[LR11x0] LR-FHSS reception is not supported

pull/1236/head
jgromes 2024-09-22 18:31:58 +01:00
rodzic 0f6e7653c7
commit 07bcf386f5
2 zmienionych plików z 6 dodań i 30 usunięć

Wyświetl plik

@ -2,6 +2,7 @@
RadioLib LR11x0 LR-FHSS Modem Example
This example shows how to use LR-FHSS modem in LR11x0 chips.
This modem can only transmit data, and is not able to receive.
NOTE: The sketch below is just a guide on how to use
LR-FHSS modem, so this code should not be run directly!
@ -68,9 +69,7 @@ void setup() {
}
void loop() {
// LR-FHSS modem can use the same transmit/receive methods
// as the LoRa modem, even their interrupt-driven versions
// LR-FHSS modem can only transmit!
// transmit LR-FHSS packet
int state = radio.transmit("Hello World!");
/*
@ -89,22 +88,4 @@ void loop() {
Serial.println(state);
}
// receive LR-FHSS packet
String str;
state = radio.receive(str);
/*
byte byteArr[8];
int state = radio.receive(byteArr, 8);
*/
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("[LR1110] Received packet!"));
Serial.print(F("[LR1110] Data:\t"));
Serial.println(str);
} else if (state == RADIOLIB_ERR_RX_TIMEOUT) {
Serial.println(F("[LR1110] Timed out while waiting for packet!"));
} else {
Serial.print(F("[LR1110] Failed to receive packet, code "));
Serial.println(state);
}
}

Wyświetl plik

@ -216,11 +216,8 @@ int16_t LR11x0::receive(uint8_t* data, size_t len) {
timeout = (RadioLibTime_t)(((maxLen * 8.0) / brBps) * 1000.0 * 5.0);
} else if(modem == RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
size_t maxLen = len;
if(len == 0) {
maxLen = 0xFF;
}
timeout = (RadioLibTime_t)(((maxLen * 8.0) / (RADIOLIB_LR11X0_LR_FHSS_BIT_RATE)) * 1000.0 * 5.0);
// this modem cannot receive
return(RADIOLIB_ERR_WRONG_MODEM);
} else {
return(RADIOLIB_ERR_UNKNOWN);
@ -472,8 +469,7 @@ int16_t LR11x0::startReceive(uint32_t timeout, uint32_t irqFlags, uint32_t irqMa
state = getPacketType(&modem);
RADIOLIB_ASSERT(state);
if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK) &&
(modem != RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS)) {
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK)) {
return(RADIOLIB_ERR_WRONG_MODEM);
}
@ -521,8 +517,7 @@ int16_t LR11x0::readData(uint8_t* data, size_t len) {
state = getPacketType(&modem);
RADIOLIB_ASSERT(state);
if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK) &&
(modem != RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS)) {
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK)) {
return(RADIOLIB_ERR_WRONG_MODEM);
}