Task class is an implementation of mail driven thread, for it makes to use Thread and Mail classes in mbed-rtos library easier.
Dependents: mail_driven_task_example
Task Class Reference
Task class : A Thread which driven by mail event, and it have own logger. More...
#include <Task.h>
Data Structures | |
class | Logger |
Logger class. More... | |
Public Member Functions | |
MailPacket * | waitMail () |
Wait for mail addressed to itself. | |
void | deleteMail (MailPacket *mail) |
Delete a mail queue block. | |
void | log (LogLevel lv, const char *format,...) |
Output log to task's own stream pointer. | |
Static Public Member Functions | |
static void | init (TaskConfig *config, uint32_t num_of_task) |
Initialize task config table. | |
static void | sendMail (TaskID task_id, MessageID message_id, void *packet) |
Send mail to task specified by task_id with Any data. |
Detailed Description
Task class : A Thread which driven by mail event, and it have own logger.
Definition at line 60 of file Task.h.
Member Function Documentation
void deleteMail | ( | MailPacket * | mail ) |
Delete a mail queue block.
it's responsible for received task.
- Parameters:
-
mail received MailPacket
- Returns:
- void
void init | ( | TaskConfig * | config, |
uint32_t | num_of_task | ||
) | [static] |
Initialize task config table.
- Parameters:
-
cfg array of TaskConfig num_of_task length of cfg
- Returns:
- void
set the lowest priority to main thread.
start logger tick
void log | ( | LogLevel | lv, |
const char * | format, | ||
... | |||
) |
void sendMail | ( | TaskID | task_id, |
MessageID | message_id, | ||
void * | packet | ||
) | [static] |
MailPacket * waitMail | ( | ) |
Wait for mail addressed to itself.
- Returns:
- received MailPacket
Generated on Tue Jul 12 2022 20:43:28 by
