Class Task¶
Defined in File Task.h
Inheritance Relationships¶
Derived Type¶
public esc::Interrupt(Class Interrupt)
Class Documentation¶
-
class
Task¶ Encapsulate a runnable task.
This class is designed to be subclassed with the method:
void run(void *data) { ... }
For example:
class CurlTestTask : public Task { void run(void *data) { // Do something } };
implemented.
Subclassed by esc::Interrupt
Public Functions
-
Task(std::string task_name = "Task", uint16_t stack_size = 10000, uint8_t priority = 5)¶ Construct a new Task.
- Parameters
task_name: The task namestack_size: The task stack size in bytespriority: The task priority
-
void
setStackSize(uint16_t stack_size)¶ Set the task stack size.
- Parameters
stack_size: stack size in bytes
-
void
setPriority(uint8_t priority)¶ Set the task priority.
- Parameters
priority:
-
void
setName(std::string name)¶ Set the task Name.
- Parameters
[in] name: the task name
-
void
setCore(BaseType_t core_id)¶ Set the CoreID.
- Parameters
[in] core_id: Core ID
-
void
start(void *task_data = nullptr)¶ Start task.
- Parameters
[in] task_data: data that’s going to be passed to task handler
-
void
stop()¶ Stop this task.
-
void
run(void *data) = 0¶ Body of the task to execute.
This function must be implemented in the subclass that represents the actual task to run. When a task is started by calling start(), this is the code that is executed in the newly created task.
- Parameters
[in] data: The data passed in to the newly started task.
Public Static Functions
-
void
delay(int ms)¶ Suspend the stask for milliseconds.
- Parameters
[in] ms: millisecionds
-