[LR11x0] LR-FHSS reception is not supported
This commit is contained in:
parent
0f6e7653c7
commit
07bcf386f5
2 changed files with 6 additions and 30 deletions
|
@ -2,6 +2,7 @@
|
||||||
RadioLib LR11x0 LR-FHSS Modem Example
|
RadioLib LR11x0 LR-FHSS Modem Example
|
||||||
|
|
||||||
This example shows how to use LR-FHSS modem in LR11x0 chips.
|
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
|
NOTE: The sketch below is just a guide on how to use
|
||||||
LR-FHSS modem, so this code should not be run directly!
|
LR-FHSS modem, so this code should not be run directly!
|
||||||
|
@ -68,9 +69,7 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
// LR-FHSS modem can use the same transmit/receive methods
|
// LR-FHSS modem can only transmit!
|
||||||
// as the LoRa modem, even their interrupt-driven versions
|
|
||||||
|
|
||||||
// transmit LR-FHSS packet
|
// transmit LR-FHSS packet
|
||||||
int state = radio.transmit("Hello World!");
|
int state = radio.transmit("Hello World!");
|
||||||
/*
|
/*
|
||||||
|
@ -89,22 +88,4 @@ void loop() {
|
||||||
Serial.println(state);
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
timeout = (RadioLibTime_t)(((maxLen * 8.0) / brBps) * 1000.0 * 5.0);
|
||||||
|
|
||||||
} else if(modem == RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
|
} else if(modem == RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
|
||||||
size_t maxLen = len;
|
// this modem cannot receive
|
||||||
if(len == 0) {
|
return(RADIOLIB_ERR_WRONG_MODEM);
|
||||||
maxLen = 0xFF;
|
|
||||||
}
|
|
||||||
timeout = (RadioLibTime_t)(((maxLen * 8.0) / (RADIOLIB_LR11X0_LR_FHSS_BIT_RATE)) * 1000.0 * 5.0);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return(RADIOLIB_ERR_UNKNOWN);
|
return(RADIOLIB_ERR_UNKNOWN);
|
||||||
|
@ -472,8 +469,7 @@ int16_t LR11x0::startReceive(uint32_t timeout, uint32_t irqFlags, uint32_t irqMa
|
||||||
state = getPacketType(&modem);
|
state = getPacketType(&modem);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
|
if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
|
||||||
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK) &&
|
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK)) {
|
||||||
(modem != RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS)) {
|
|
||||||
return(RADIOLIB_ERR_WRONG_MODEM);
|
return(RADIOLIB_ERR_WRONG_MODEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,8 +517,7 @@ int16_t LR11x0::readData(uint8_t* data, size_t len) {
|
||||||
state = getPacketType(&modem);
|
state = getPacketType(&modem);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
|
if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
|
||||||
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK) &&
|
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK)) {
|
||||||
(modem != RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS)) {
|
|
||||||
return(RADIOLIB_ERR_WRONG_MODEM);
|
return(RADIOLIB_ERR_WRONG_MODEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue