Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Message Queue

Functions

 ZTEST (msgq_api, test_msgq_attrs_get)
 Test basic attributes of a message queue.
 
 ZTEST_USER (msgq_api, test_msgq_user_attrs_get)
 Test basic attributes of a message queue.
 
 ZTEST (msgq_api_1cpu, test_msgq_thread)
 Test thread to thread data passing via message queue.
 
 ZTEST (msgq_api, test_msgq_thread_overflow)
 Test thread to thread data passing via message queue.
 
 ZTEST_USER (msgq_api, test_msgq_user_thread)
 Test user thread to kernel thread data passing via message queue.
 
 ZTEST_USER (msgq_api, test_msgq_user_thread_overflow)
 Test thread to thread data passing via message queue.
 
 ZTEST (msgq_api, test_msgq_isr)
 Test thread to isr data passing via message queue.
 
 ZTEST (msgq_api_1cpu, test_msgq_pend_thread)
 Test pending writer in msgq.
 
 ZTEST (msgq_api, test_msgq_alloc)
 Test k_msgq_alloc_init()
 
 ZTEST (msgq_api_1cpu, test_msgq_empty)
 Get message from an empty queue.
 
 ZTEST (msgq_api_1cpu, test_msgq_full)
 Put message to a full queue.
 
 ZTEST (msgq_api_1cpu, test_msgq_put_fail)
 Test returned error code during writing in msgq.
 
 ZTEST_USER (msgq_api, test_msgq_user_put_fail)
 Test returned error code during writing in msgq.
 
 ZTEST (msgq_api_1cpu, test_msgq_get_fail)
 Test returned error code during reading from msgq.
 
 ZTEST_USER (msgq_api, test_msgq_user_get_fail)
 Test returned error code during reading from msgq.
 
 ZTEST (msgq_api_1cpu, test_msgq_purge_when_put)
 Test purge a message queue.
 
 ZTEST_USER (msgq_api, test_msgq_user_purge_when_put)
 Test purge a message queue.
 

Detailed Description

Function Documentation

◆ ZTEST() [1/11]

ZTEST ( msgq_api  ,
test_msgq_alloc   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Test k_msgq_alloc_init()

Initialization and buffer allocation for msgq from resource pool with various parameters

See also
k_msgq_alloc_init(), k_msgq_cleanup()

Requesting buffer allocation from the test pool.

◆ ZTEST() [2/11]

ZTEST ( msgq_api  ,
test_msgq_attrs_get   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_attrs.c>

Test basic attributes of a message queue.

See also
k_msgq_get_attrs()

◆ ZTEST() [3/11]

ZTEST ( msgq_api  ,
test_msgq_isr   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Test thread to isr data passing via message queue.

See also
k_msgq_init(), k_msgq_get(), k_msgq_put(), k_msgq_purge()

TESTPOINT: init via k_msgq_init

◆ ZTEST() [4/11]

ZTEST ( msgq_api  ,
test_msgq_thread_overflow   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Test thread to thread data passing via message queue.

See also
k_msgq_init(), k_msgq_get(), k_msgq_put(), k_msgq_purge()

TESTPOINT: init via k_msgq_init

◆ ZTEST() [5/11]

ZTEST ( msgq_api_1cpu  ,
test_msgq_empty   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Get message from an empty queue.

  • A thread get message from an empty message queue will get a -ENOMSG if timeout is set to K_NO_WAIT
  • A thread get message from an empty message queue will be blocked if timeout is set to a positive value or K_FOREVER
See also
k_msgq_get()

◆ ZTEST() [6/11]

ZTEST ( msgq_api_1cpu  ,
test_msgq_full   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Put message to a full queue.

  • A thread put message to a full message queue will get a -ENOMSG if timeout is set to K_NO_WAIT
  • A thread put message to a full message queue will be blocked if timeout is set to a positive value or K_FOREVER
See also
k_msgq_put()

◆ ZTEST() [7/11]

ZTEST ( msgq_api_1cpu  ,
test_msgq_get_fail   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_fail.c>

Test returned error code during reading from msgq.

See also
k_msgq_init(), k_msgq_put()

◆ ZTEST() [8/11]

ZTEST ( msgq_api_1cpu  ,
test_msgq_pend_thread   
)

◆ ZTEST() [9/11]

ZTEST ( msgq_api_1cpu  ,
test_msgq_purge_when_put   
)

◆ ZTEST() [10/11]

ZTEST ( msgq_api_1cpu  ,
test_msgq_put_fail   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_fail.c>

Test returned error code during writing in msgq.

See also
k_msgq_init()

◆ ZTEST() [11/11]

ZTEST ( msgq_api_1cpu  ,
test_msgq_thread   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Test thread to thread data passing via message queue.

See also
k_msgq_init(), k_msgq_get(), k_msgq_put(), k_msgq_purge()

TESTPOINT: init via k_msgq_init

◆ ZTEST_USER() [1/6]

ZTEST_USER ( msgq_api  ,
test_msgq_user_attrs_get   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_attrs.c>

Test basic attributes of a message queue.

See also
k_msgq_get_attrs()

◆ ZTEST_USER() [2/6]

ZTEST_USER ( msgq_api  ,
test_msgq_user_get_fail   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_fail.c>

Test returned error code during reading from msgq.

See also
k_msgq_alloc_init(), k_msgq_get()

◆ ZTEST_USER() [3/6]

ZTEST_USER ( msgq_api  ,
test_msgq_user_purge_when_put   
)

◆ ZTEST_USER() [4/6]

ZTEST_USER ( msgq_api  ,
test_msgq_user_put_fail   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_fail.c>

Test returned error code during writing in msgq.

See also
k_msgq_alloc_init()

◆ ZTEST_USER() [5/6]

ZTEST_USER ( msgq_api  ,
test_msgq_user_thread   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Test user thread to kernel thread data passing via message queue.

See also
k_msgq_alloc_init(), k_msgq_get(), k_msgq_put(), k_msgq_purge()

◆ ZTEST_USER() [6/6]

ZTEST_USER ( msgq_api  ,
test_msgq_user_thread_overflow   
)

#include <tests/kernel/msgq/msgq_api/src/test_msgq_contexts.c>

Test thread to thread data passing via message queue.

See also
k_msgq_alloc_init(), k_msgq_get(), k_msgq_put(), k_msgq_purge()