Quantcast
Channel: Wireless 802.11ad Routers
Viewing all articles
Browse latest Browse all 1469

Wireless sensor networks embedded in the programming language nesC

$
0
0

Wireless sensor network is one of the hot at home and abroad, it is cheaper by a large number of sensor nodes, via a wired / wireless communication network system formed by self-organization, mutual cooperation to perceive the surrounding data. Since wireless sensor nodes is a typical resource-constrained embedded systems, requires a mini-operating system to organize and manage the hardware, application software implementation. TinyOS is the University of California, Berkeley, designed for wireless sensor networks, a micro-based event-driven operating system, originally in assembly and C language implementations. The C language can not be effectively and easily to meet the application development for sensor network, the object code is longer, after further research designed to support components of the new programming language – nesC. Its greatest feature is that the components of / modular thinking and event-driven execution model based on the combination. Is based on TinyOS TinyOS operating system and applications are written using nesC, greatly improving the ease of application development and application of the implementation of reliability. In this paper, the background of WSN by a flashing light on TinyOS instance – Blink, details of the structure and the nesC language how to use the language component of / modular applications for in-depth study to provide a TinyOS application development implementation.

1 nosC language structure

nesC is the C language extensions, proficient in C language programmers to master the language relatively quickly. And C-store format, with the nesC language of the document is “.

Nc” as the suffix. Nc file to implement a component for each function (components of / Modular). In nesC program, the main components of the definition of two different functions – the module (module) and accessories (configuration).

Module is mainly used to describe the components of the interface functions and the specific function of the realization process, the actual implementation of each LCD module by four related components: the command function, event function, data frame and a set of execution threads. Among them, the command function is a direct implementation, the display module can call the bottom of the order, but must have a return value to indicate whether the command completed. There are 3 possible return values: success (see BlinkM.nc code section), failure, step by step implementation. Event function is triggered by the implementation of hardware events, the underlying event function module directly associated with hardware interrupts, including external events, the clock event counter event. An event function, event information will be placed in its own data frame, the latter by producing thread, the trigger event function of the upper module and call the module’s command functions, etc. be processed, and therefore the event will trigger the hardware node the two possible execution Direction – up of events between modules and the modules function calls down the command function call.

Describe the component parts are mainly the relationship between different interfaces to complete the various components of the interface between the connection and calls. Contains the relevant implementing some of the major interfaces to other components and accessories to use interface, component interface list and how to interface with the various components of the implementation of the list of connections.
In the module, the keyword “implementation” must be included to implement the module interface declaration provision and use of all of the commands and events. In accessories, the keyword “implementation” part of the definition of implementation, and other symbols connected with “->”,”=”,”" component interface that is located on the left of the components in the right to call interface.

Whether the module or parts, each component contains the definition and implementation of two parts. By providers and users are to be achieved through the call interface and functions of each interface, the function of communication, different modules can also implement the same interface. Is the command and event interface can also be defined in a separate set of commands. There are several in the application configuration file, and there is a hierarchical relationship between components, top accessories for top-level files (each application must have a top-level components), Main component interface defines the interface with other components connection and the call relations between the various interfaces. Specific framework for the picture to see [6] on the general structure of nesC.

2 nesC application of

Every nesC application by one or more components linked together through the interface and, through ncc / gcc compiler to generate a complete executable program. Below to TinyOS Blink application software, for example, describes the specific structure of nesC applications.
Blink nesC program is a simple application. Its main function is the time interval of every 1 s light once, shut down the system when the red light. The program includes three sub-file Blink.nc, BlinkM.nc and SingleTimer.nc.

Find More Wireless Networks Articles


Viewing all articles
Browse latest Browse all 1469

Trending Articles