close

Вход

Забыли?

вход по аккаунту

?

NesC Programming Language

код для вставкиСкачать
Himali Saxena
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
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
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
An Example
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
Example
Contd…
An Example (= operator)
Auto Wiring Initialization
C and P Implementation
п‚— C implementation : Externally usable abstraction
п‚— P implementation : an internal implementation
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
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.
Multiple Wiring,
Fan-in, and Fan-out
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
An Example
Parameterized Wiring
Contd…
Another way of defining parameter
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.
References
п‚— 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, David Culler, Eric Brewer,
“nesC 1.1 Language Reference Manual” May 2003
Документ
Категория
Презентации
Просмотров
1
Размер файла
1 024 Кб
Теги
1/--страниц
Пожаловаться на содержимое документа