cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer a data array via LoRa with PingPong singlecore example?

FPicc.1
Senior

Hello, I'm using the SubGhz_Phy_PingPong example to transfer data via Lora from a NUCLEO stm32WL to another, but I can't figure out how I can send a data array in the main.c file to the other board.

Following the example, it has the main calling the MX_SubGHz_Phy_Process() function, that's in the app_subghz_phy.c file. However, the code that occurs the transaction between boards is in the subghz_phy_app.c, in the PingPong_Process() function.

How do I take the array that I want from main, and send it all the way to that last function to send it?

2 REPLIES 2
Jay_Bolboli
Associate III

In main.c, create a function to accept your array as a parameter. Next, in subghz_phy_app.c, invoke the function and pass your array to it. Finally, copy the contents of the array to the buffer that will be transmitted. Depending on whether it's a "ping" or "pong" message.

You're going to have to breakdown and sequence the data so it fits withing the maximum packet size of your implementation. Then reconstruct it at the receiving end, perhaps detecting blocks of data that are missing, ie you Ping a Block# request, or range of blocks, the Pong sends those block(s) back.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..