The AIO message queue library works around opening a message queue with a specific name whose incoming traffic is then handled by the handler function specified. Sending to the message queue is simple through the use of the queue's name.
More...
The AIO message queue library works around opening a message queue with a specific name whose incoming traffic is then handled by the handler function specified. Sending to the message queue is simple through the use of the queue's name.
Opening a queue
{
while (1)
{
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
aIO_handle_t aIOOpenMessageQueue(const char *name, long max_msg_num, long max_msg_size, void(*callback)(size_t, char *, void *), void *args)
Definition: AsyncIO.c:361
void MQHandlerOne(size_t read_size, char *buffer, void *args)
Definition: async_message_queues.c:44
#define MSG_QUEUE_BUFFER_SIZE
Definition: async_message_queues.c:33
void vMQDemoTask(void *pvParameters)
Definition: async_message_queues.c:54
void MQHanderTwo(size_t read_size, char *buffer, void *args)
Definition: async_message_queues.c:49
#define MSG_QUEUE_MAX_MSG_COUNT
Definition: async_message_queues.c:34
aIO_handle_t mq_one
Definition: async_message_queues.c:39
const char * mq_one_name
Definition: async_message_queues.c:36
const char * mq_two_name
Definition: async_message_queues.c:37
aIO_handle_t mq_two
Definition: async_message_queues.c:40
Message handler
void MQHandlerOne(
size_t read_size,
char *buffer,
void *args)
{
prints(
"MQ Recv in first handler: %s\n", buffer);
}
void MQHanderTwo(
size_t read_size,
char *buffer,
void *args)
{
prints(
"MQ Recv in second handler: %s\n", buffer);
}
void prints(const char *__format,...)
Prints a formatted string to stdout
Definition: gfx_print.c:104
Putting to message queue
}
}
int aIOMessageQueuePut(const char *mq_name, char *buffer)
Sends the data stored in buffer to the message queue with the provided name.
Definition: AsyncIO.c:258
◆ vDeleteMessageQueueTasks()
void vDeleteMessageQueueTasks |
( |
void |
| ) |
|
◆ xCreateMessageQueueTasks()
int xCreateMessageQueueTasks |
( |
void |
| ) |
|
◆ mq_one
◆ mq_one_name
◆ mq_two
◆ mq_two_name
◆ MQDemoTask