Skip to content

Commit 599e3a1

Browse files
committed
start rx again immediately after receive
1 parent c6d4b75 commit 599e3a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/helpers/radiolib/RadioLibWrappers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ bool RadioLibWrapper::isInRecvMode() const {
9696
}
9797

9898
int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
99+
int len = 0;
99100
if (state & STATE_INT_READY) {
100-
int len = _radio->getPacketLength();
101+
len = _radio->getPacketLength();
101102
if (len > 0) {
102103
if (len > sz) { len = sz; }
103104
int err = _radio->readData(bytes, len);
@@ -110,7 +111,6 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
110111
}
111112
}
112113
state = STATE_IDLE; // need another startReceive()
113-
return len;
114114
}
115115

116116
if (state != STATE_RX) {
@@ -121,7 +121,7 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
121121
MESH_DEBUG_PRINTLN("RadioLibWrapper: error: startReceive(%d)", err);
122122
}
123123
}
124-
return 0;
124+
return len;
125125
}
126126

127127
uint32_t RadioLibWrapper::getEstAirtimeFor(int len_bytes) {

0 commit comments

Comments
 (0)