Download presentation
Presentation is loading. Please wait.
Published byJuliet Glenn Modified over 8 years ago
1
Himali Saxena
2
Topics Configurations and Wiring Configuration implementation Basic Rules for declaration/definition Auto Wiring initialization ‘C’ and ‘P’ implementation The ‘as’ keyword and other namespace tricks Pass Through Wiring Combine Functions Parameterized Wiring
3
Configurations and Wiring Configuration : A Component whose implementation is component wiring Compose module into larger abstractions Wiring : Connecting two components such that one module to be able to call another
4
Configuration Implementation implementation { component-list, connection-list} The component–list lists the components thar are used to build this configuration The connection-list specifies how these components are wired to each other and to the configuration’s specification
5
An Example
6
Basic Rules for Declaring Use component keyword to tell the names of the component it is wiring Any number of components names can follow components, order doesn’t matter Can have multiple component statements Three operators : -- >, < -- and = Direct wiring ( -- > or < --) always goes to a user to a provider. = operator exports interfaces
7
Example
8
Contd…
9
An Example (= operator)
10
Auto Wiring Initialization
11
C and P Implementation C implementation : Externally usable abstraction P implementation : an internal implementation
13
The ‘as’ Keyword and other namespace tricks The as keyword allows to rename an interface in a signature The as keyword can also be used within configurations
15
Pass Through Wiring Pass through wiring is when a configuration wires two interfaces in its signature together. It must wire a uses to a provides, and it does so with = operator.
16
Multiple Wiring, Fan-in, and Fan-out
17
Combine Function NesC provides mechanism of combine functions to specify return value A fan-ot always involves calling N functions with identical signatures, the caller’s return value is the result of applying the combine function to the return values of all of the callees When NesC compiles application, it autogenerates a fan-out function which applies the combine function
18
An Example
19
Parameterized Wiring
20
Contd…
21
Another way of defining parameter
22
Defaults A default handler is an implementation of a function that’s used if no implementation is wired in. If a component wires to the interface, then the implementation is used. Otherwise, the (or signal) goes to the default handler.
24
References http://www.tinyos.net/tinyos-2.x/doc/pdf/tinyos- programming.pdf http://www.tinyos.net/tinyos-2.x/doc/pdf/tinyos- programming.pdf David Gay, Philip Levis, Robert von Behren, Matt Welsh, Eric Brewer, David Culler, The nesC language: A holistic approach to networked embedded systems, Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation, June 09-11, 2003, San Diego, California, USA David Gay, Philip Levis, Robert von Behren, Matt Welsh, Eric Brewer, David Culler, The nesC language: A holistic approach to networked embedded systems, Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation, June 09-11, 2003, San Diego, California, USA David Gay, Philip Levis, David Culler, Eric Brewer, “nesC 1.1 Language Reference Manual” May 2003
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.