In: Computer Science
What are the usages of the following API's/ Macros in contiki ?
PROCESS: In contiki every process contains a process control block and a process thread.Information about each process, such as the state of the process, a pointer to the process_thread, and name of the process is present in process control block.
Declaration of a process control block is done by using the following macro:
PROCESS(name , strname);
PROCESS_THREAD:process thread contains the code of the process.each process in Contiki can only have one thread of execution. These threads are not real threads as we learn in Operating Systems.
Process_thread is declared using the following macro:
PROCESS_THREAD(name, ev, data);
PROCESS_WAIT_EVENT_UNTIL: waits for an event with a condition.
PROCESS_END: used to declare the end of a process.
AUTOSTART_PROCESSES: Contiki, provides a mechanism where any process can be automatically started either when the system is booted, or the processes is loaded when a module contains it.It is a common way where user start the processes automatically.
AUTOSTART_PROCESSES(&name1, &name2, ...)
simple_udp_sendto: This function is used to send a UDP packet to the IP address and with the UDP ports that were specified when the connection was registered.