八、contiki进程
contiki编程的核心文档
contiki的一个进程由一个单一的原线程组成。
Files
file process.c
contiki进程内核的实现。
file process.h
contiki进程接口的头文件。
Return values
#define PROCESS_ERR_OK 0
返回值,指示操作成功。
#define PROCESS_ERR_FULL 1
返回值,指示事件队列已满。
//Process protothread functions
#define PROCESS_BEGIN()
Define the beginning of a process.
定义流程的开始。
#define PROCESS_END()
Define the end of a process.
定义流程的结束。
contiki的程序必须介于BEGIN和END之间
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
等待一个事件发布的过程。
#define PROCESS_WAIT_EVENT_UNTIL(c)
Wait for an event to be posted to the process, with an extra condition.
等待一个事件被发布到进程,并附加一个额外的条件。
#define PROCESS_YIELD()
Yield the currently running process.
生成当前正在运行的进程。
#define PROCESS_YIELD_UNTIL(c)
Yield the currently running process until a condition occurs.
在出现条件之前,生成当前正在运行的进程
#define PROCESS_WAIT_UNTIL(c)
Wait for a condition to occur.
等待条件发生
#define PROCESS_WAIT_WHILE(c) PT_WAIT_WHILE(process_pt, c)
重定义
#define PROCESS_EXIT()
Exit the currently running process.
#define PROCESS_PT_SPAWN(pt, thread)
Spawn(产生) a protothread(原始线程) from the process.
#define PROCESS_PAUSE()
Yield the process for a short while.
让这个过程持续一段时间。
Poll and exit handlers
#define PROCESS_POLLHANDLER(handler)
Specify an action when a process is polled.
指定进程轮询时的操作。
#define PROCESS_EXITHANDLER(handler)
Specify an action when a process exits.
在进程退出时指定操作。
Process declaration and definition
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_NAME(name)
Declare the name of a process