So I’m planning on writing an app for ESP32 that uses RTOS as a means of “handling cases” in terms of switching to a specific state based on the condition.
Came up with this flow of the program where I have 3 tasks:
Connection_task: takes care of wifi init and once connected, writes to a
Connection_Donequeue which the
SendPktTaskis waiting on.
SendPktTask: Once connection is done, it waits on the packet to send which is provided by
DataTask. Once the queue is populated, it goes onto send the packet and then waits on the respective queues for the next packet to be sent.
I’m not sure if it’s the best approach but that’s just an abstrac that I came up with, and any suggestions would be appreciated. (not all the states are shown though)
My concern is whether
Connection_Done queue should exist, or rather a task notification should be used since that’s basically what it’s acting as.
The basic idea is to use this library with any other application particularly where have to send data elsewhere.
So for instance, if the connection goes down, the
RECOVERY_STATE should do the handling accordingly whereas
SendPkt task waits on the queue