I am attempting to write a UDP application to control the low voltage lights on my back patio. I have it working well enough but I don't think how the incoming udp packets are handled correctly. I took the code from the udp server example and in setup:
I am assuming then that this creates an ISR which responds to incoming udp requests from the client and processes them entirely within the ISR. I also assume that the AsyncUDPPacket is something like a volatile.
Is there a technique that will allow the process to occur in the normal loop(). The issue for me is the response, which will be sent back to the sender when the process is complete, requires the AsyncUDPPacket to send. I imagine I can create a queue of the requests that come in from the listen and process them in turn, but the packet needs to still be available.
I say No. An ISR should be short and fast.
Referring to a space communication project once made I suggest the ISR will set a flag, or two, that will be checked in loop.
Suppose each turn in loop check which task, function, has the highest priority and executes that one. Any time consuming task must execute its task in chunks, not any long time evaluations.