Skip to content

How to make receive function return value #119

Answered by beegee-tokyo
agat114 asked this question in Q&A
Discussion options

You must be logged in to vote

Your code makes no sense. Why would you call RadioRX(30) in a loop? RadioRX is none blocking, it will return immediately.
There is no OnRxDone function, it is a callback when data has been received.

(1) setup the callbacks for RX and TX ==> // Initialize the Radio callbacks
(2) call RadioRX(30); // Sets radio in RX mode for 30 seconds, goes to sleep automatically after 30 seconds
(3) wait for RX callback called (if a packet was received) Function to be executed on Radio Rx Done event
(4) Handle received data in your loop(). To do this, you can set a flag in the callback and wait in the loop for that flag

Untested code snippet for RX only:

// Define LoRa parameters
#define RF_FREQUENCY 868…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@agat114
Comment options

@beegee-tokyo
Comment options

Answer selected by agat114
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants