I have an ESP32 that receives watchdog messages from up to approximately 30 remote devices via UDP. I had it in mind to use TaskScheduler for tracking the timeouts as it is already in use and I like it, and I am looking for some advice as how best to implement this.
The number of devices vary as they come on and offline, which means the number of scheduler tasks varies, and maybe the number of callback routines?
- I think I would would ideally like to use the same callback for all task, but I have never delved into this, but it seems straightforward enough using TaskId and LTS, but any advice would be appreciated.
- Is there a way to dynamically create tasks? I would like to create and destroy tasks, as devices come on and offline, but I have never done this before. Each device has its own struct, and ideally the task (or pointer to) would reside in the struct. I tried creating a pointer to a Task in the structure but I got a load of errors.
- Ive already discovered that enabling the Tsk Scheduler functionality with the #define lines in the LTS examples stops my serial read JSON from working properly - whats that about then?
Thanks, Jim