What are the usages of the following API's/ Macros in contiki ?
What are the usage of the following API's/Macros in
contiki?
a) PROCESS :-
A process in Contiki consists of a single protothread(Protothreads
are a type of lightweight stackless threads designed for severly
memory constrained systems such as deeply embedded systems or
sensor network nodes).
Declare a process.
This macro declares a process. The process has two
names: the variable of the process structure, which is used by the
C program, and a human readable string name, which is used when
debugging. A configuration option allows removal of the readable
name to save RAM.
e.i., #define PROCESS ( name, strname)
name: The variable name of the process
structure.
strname: The string representation of the process'
name.
b) AUTOSTART_PROCESSES :-
Contiki provides a mechanism where processes can be
automatically started either when the system is booted, or when a
module that contains the processes is loaded. Autostarted processes
are kept on a list, that is used by the autostart module to start
the processes. The processes are started in the order they appear
on the list.
i.e., AUTOSTART_PROCESSES(&name1, &name2, ...)
name1, name2, ... - The name of processes to be
autostarted.
c) PROCESS_THREAD :-
This macro is used to define the body (protothread) of
a process. The process is called whenever an event occurs in the
system, A process always start with the PROCESS_BEGIN() macro and
end with the PROCESS_END() macro.
i.e.,#define PROCESS_THREAD( name, ev, data)
d) PROCESS_WAIT_EVENT_UNTIL :-
Wait for an event to be posted to the process, with an
extra condition. It blocks the currently running process until the
process receives an event.
i.e., #define PROCESS_WAIT_EVENT_UNTIL(c)
c: The condition that must be true for the process to
continue.
Get Answers For Free
Most questions answered within 1 hours.