RTAI API-----Message handling functions
来源:互联网 发布:卓大王yeile知乎 编辑:程序博客网 时间:2024/06/07 07:27
rt_receive
rt_send_if
rt_receive_if
rt_send_until
rt_receive_until
rt_send_timed
rt_receive_timed
please refer to: https://www.rtai.org/userfiles/documentation/magma/html/api
***************************************************************************************************************************************************************************
NAME
rt_send - send a message
SYNOPSIS
#include "rtai_sched.h"
RT_TASK* rt_send (RT_TASK* task, unsigned int msg);
DESCRIPTION
rt_send sends the message msg to the task task. If the receiver task is ready to get the message rt_send returns immediately. Otherwise the caller task is blocked and queued up. (Queueing may happen in priority order or on FIFO base. This is determined by compile time option MSG_PRIORD.)
RETURN VALUE
On success, task (the pointer to the task that received the message) is returned. If the caller is unblocked but message has not been sent (e.g. the task task was killed before receiving the message) 0 is returned. On other failure, a special value is returned as described below.
ERRORS
0
The receiver task was killed before receiving the message.
0xffff
task does not refer to a valid task.
BUGS
There is no guarantee, that the value of pointer task cannot be 0xffff. In this theoretical case the caller cannot figure out if the operation was succesful or not.
****************************************************************************************************************************************************************
NAME
rt_send_if - send a message if possible
SYNOPSIS
#include "rtai_sched.h"
RT_TASK* rt_send_if (RT_TASK* task, unsigned int msg);
DESCRIPTION
rt_send_if tries to send the message msg to the task task. The caller task is never blocked.
RETURN VALUE
On success, task (the pointer to the task that received the message) is returned. If message has not been sent, 0 is returned. On other failure, a special value is returned as described below.
ERRORS
0
The task task was not ready to receive the message.
0xffff
task does not refer to a valid task.
BUGS
There is no guarantee, that the value of pointer task cannot be 0xffff. In this theoretical case the caller cannot figure out if the operation was succesful or not.
*****************************************************************************************************************************************************************************
NAME
rt_send_until, rt_send_timed - send a message with timeout
SYNOPSIS
#include "rtai_sched.h"
RT_TASK* rt_send_until (RT_TASK* task, unsigned int msg, RTIME time);
RT_TASK* rt_send_timed (RT_TASK* task, unsigned int msg, RTIME delay);
DESCRIPTION
rt_send_until and rt_send_timed send the message msg to the task task. If the receiver task is ready to get the message these functions return immediately. Otherwise the caller task is blocked and queued up. (Queueing may happen in priority order or on FIFO base. This is determined by compile time option MSG_PRIORD.) In this case these functions return if
The caller task is in the first place of the waiting queue and the receiver gets the message;
Timeout occurs;
An error occurs (e.g. the receiver task is killed);
time is an absolute value. delay is relative to the current time.
RETURN VALUE
On success, task (the pointer to the task that received the message) is returned. If message has not been sent, 0 is returned. On other failure, a special value is returned as described below.
ERRORS
0
Operation timed out, message was not delivered.
0xffff
task does not refer to a valid task.
BUGS
There is no guarantee, that the value of pointer task cannot be 0xffff. In this theoretical case the caller cannot figure out if the operation was succesful or not.
*********************************************************************************************************************************************************************************
NAME
rt_receive - receive a message
SYNOPSIS
#include "rtai_sched.h"
RT_TASK* rt_receive (RT_TASK* task, unsigned int *msg);
DESCRIPTION
rt_receive gets a message from the task specified by task. If task is equal to 0, the caller accepts message from any task. If there is a pending message, rt_receive returns immediately. Otherwise the caller task is blocked and queued up. (Queueing may happen in priority order or on FIFO base. This is determined by compile time option MSG_PRIORD.)
msg points to a buffer provided by the caller.
RETURN VALUE
On success, a pointer to the sender task is returned. If the caller is unblocked but no message has been received (e.g. the task task was killed before sending the message) 0 is returned. On other failure, a special value is returned as described below.
ERRORS
0
The sender task was killed before sending the message.
0xffff
task does not refer to a valid task.
BUGS
There is no guarantee, that the value of returned task pointer cannot be 0xffff. In this theoretical case the caller cannot figure out if the operation was succesful or not.
**************************************************************************************************************************************************************************
NAME
rt_receive_if - receive a message if possible
SYNOPSIS
#include "rtai_sched.h"
RT_TASK* rt_receive_if (RT_TASK* task, unsigned int *msg);
DESCRIPTION
rt_receive_if tries to get a message from the task specified by task. If task is equal to 0, the caller accepts message from any task. The caller task is never blocked.
msg points to a buffer provided by the caller.
RETURN VALUE
On success, a pointer to the sender task is returned. If no message has been received, 0 is returned. On other failure, a special value is returned as described below.
ERRORS
0
There was no message to receive.
0xffff
task does not refer to a valid task.
BUGS
There is no guarantee, that the value of returned task pointer cannot be 0xffff. In this theoretical case the caller cannot figure out if the operation was succesful or not.
********************************************************************************************************************************************************************
NAME
rt_receive_until, rt_receive_timed - receive a message with timeout
SYNOPSIS
#include "rtai_sched.h"
RT_TASK* rt_receive_until (RT_TASK* task, unsigned int *msg, RTIME time);
RT_TASK* rt_receive_timed (RT_TASK* task, unsigned int *msg, RTIME delay);
DESCRIPTION
rt_receive_until and rt_receive_timed receive a message from the task specified by task. If task is equal to 0, the caller accepts message from any task. If there is a pending message, these functions return immediately. Otherwise the caller task is blocked and queued up. (Queueing may happen in priority order or on FIFO base. This is determined by compile time option MSG_PRIORD.) In this case these functions return if
The caller task is in the first place of the waiting queue and the sender sends a message;
Timeout occurs;
An error occurs (e.g. the sender task is killed);
msg points to a buffer provided by the caller.
time is an absolute value. delay is relative to the current time.
RETURN VALUE
On success, a pointer to the sender task is returned. If no message has been received, 0 is returned. On other failure, a special value is returned as described below.
ERRORS
0
Operation timed out, no message was received.
0xffff
task does not refer to a valid task.
BUGS
There is no guarantee, that the value of returned task pointer cannot be 0xffff. In this theoretical case the caller cannot figure out if the operation was succesful or not.
- RTAI API-----Message handling functions
- RTAI API ---RTAI service functions
- RTAI API---Timer functions
- RTAI API---Mailbox functions
- RTAI API --- RPC functions
- Message Handling
- RTAI API---task function
- RTAI api ---Semaphore function
- Basic String Handling Functions
- PHP Function handling functions
- 消息处理(Message Handling)
- Windows Shell Registry Handling Functions
- Exception Handling Functions for Debugging
- SAP message log file handling
- ctype中的各种函数 Character handling functions
- mobile 学习之 Windows Message Handling
- Android Message handling (based on KK4.4)
- !MESSAGE Error occurred during status handling
- localhost不能访问127.0.0.1可以访问的原因及解决方法
- 安卓Banner实现轮播图
- Word快捷键大全
- oracle之spfile与pfile
- 饿了么webapp之header的背景
- RTAI API-----Message handling functions
- 第七周项目3-负数把正数赶出队列
- 程序设计C 实验二 题目三 计算生日是星期几(0078)
- ios __block与__weak
- WPF Template模版之DataTemplate与ControlTemplate的关系
- 用户登录,记住密码
- 在centos7下安装docker
- 微信小程序开发开启https方法:【适用于腾讯云】
- Mvp+RxJava2+Retrofit2 搭建一个属于自己的开发框架