Read TinyOS programming book (http://csl.stanford.edu/~pal/pubs/tinyos-programming.pdf). It has most of the answers of your questions.
best regards, -- Faisal Aslam University of Freiburg http://cone.informatik.uni-freiburg.de/people/aslam/ paul.m wrote: > Hello > > Could you please help me? > > I do not understand the TaskBasic interface in TinyOS and the post and > task keywords. > interface TaskBasic { > async command error_t postTask(); > > void event runTask(); > } > > I red TEP106 and other materials but do not understand it. > There is: > When a component declares a task with the task keyword in nesC, it is > implicitly declaring that it uses an instance of the TaskBasic > interface: the task body is the runTask event. When a component uses > the post keyword, it calls the postTask command. > What is this:the task body is the runTask event ? Does it mean that > the implementation of event contains the body of task? > > How is the process to execute a task? The component declare a task > with keyword task so it means it implements the event runTask which > body is the task itself. Then when the componet wants to poset the > task it uses the post keyword so it measn it calls command postTask, > which the shceduler component implements. After that the scheduler > according to its policy (so after some time) calls the runTask() event > in the component which call the postTask command before. And the > calling that event means that it goes to execute the body of that > event immediately (it preempt other tasks). Is that right? > And where is the queue? What and when goes into the queue? Does go > there the called event? > > And what about this?: > > "When TinyOS tells the scheduler to run a task, it pulls the next > identifier off the queue and uses it to dispatch on the parameterized > TaskBasic interface." > I do not understand it. > Where from the process of posting the task are the identifiers put in > the queue? How the scheduler take the identifier from the queue? > And what means that: TinyOS tells the scheduler? How TinyOs "tells" > the scheduler? > > > Thank you > paul m. > ------------------------------------------------------------------------ > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
