SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
WSN Programming Course
TinyOS Lab:
Basic Programming
Manuel Fernández
UAH, 18th September 2013
• Introduction to nesC
• Components
• FileTypes
• Basic program: NullC
• How to compile
• NesC variables
• Eclipse IDE
• Exercises
2
Contents
• A nesC application consists of one or more components assembled, or
wired, to form an application executable.
• Components define two scopes:
• one for their specification which contains the names of their
interfaces, and
• a second scope for their implementation.
COMPONENT A
SPECIFICATION
IMPLEMENTATION
3
NesC (I)
•A component provides and uses interfaces.
•The provided interfaces are intended to represent the
functionality that the component provides to its user in its
specification.
•The used interfaces represent the functionality the component
needs to perform its job in its implementation.
4
NesC (II)
• Interfaces are bidirectional: they specify a set of commands, which
are functions to be implemented by the interface's provider, and a set
of events, which are functions to be implemented by the interface's
user. For a component to call the commands in an interface, it must
implement the events of that interface.
•The set of interfaces which a component provides together with the
set of interfaces that a component uses is considered that
component's signature.
5
NesC (III)
•There are 2 types of components in nesC:
- Modules: provide the implementations of one or more
interfaces.
- Configurations: used to assemble other components together,
connecting interfaces used by components to interfaces provided
by others.
6
Components
• Naming conventions are as follows:
CONFIGURATIO
N
MODULE
COMPONENTS
INTERFACE
Makefile Only in main app
7
File Types
CONFIGURATION
MODULE
TinyOS Lab: Lesson 01 – Basic Programming
© 2012 Manuel Fernández
Makefile
NullAppC.nc
NullC.nc
Configuration
Module
Makefile:
COMPONENT=NullAppC
include $(MAKERULES)
Name of configuration file
8
Basic program: NullC
NullApp.nc :
SPECIFICATION
IMPLEMENTATION
9
Basic program: NullC
SPECIFICATION
IMPLEMENTATION
NullC.nc :
• Open terminal in the folder
•Type:
make telosb
• Insert mote in USB port and type:
make telosb reinstall.1 bsl,/dev/ttyUSB0
Platform
MoteID USB port (type motelist
to find which one it is
10
How to compile
• Open terminal in the folder
• Type:
make telosb docs
• Check the created folders
Platform
11
Fun Stuff
• Commonly used units:
• int is NOT used
• bool is also used
12
NesC variables
• An alternative to console programming is using a TinyOS plug-in
for the Eclipse IDE.
• In this IDE it is possible to compile and install programs in motes
•We will use this IDE to speed up the lessons.
13
Eclipse IDE
1. Interface Leds has commands to control the 3 leds on the mote.
(led0, led1, led2).Try each of them and install them on the mote
2. Add a Timer to blink the Leds periodically, showing a binary timer
using the 3 leds.
3. Configure the User Button to do a complete routine with the Leds
4. Pack the previous subroutine in a new component with your own
interface.
14
Exercises
Contact Info:
Manuel Fernández
manuel.fernandez@advanticsys.com
15

Weitere ähnliche Inhalte

Was ist angesagt?

Adding Extended Attribute Support to NFS
Adding Extended Attribute Support to NFSAdding Extended Attribute Support to NFS
Adding Extended Attribute Support to NFSJames Morris
 
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...James Morris
 
Network automation via py ez
Network automation via py ezNetwork automation via py ez
Network automation via py ezMohammed Abdallah
 
Directions in SELinux Networking
Directions in SELinux NetworkingDirections in SELinux Networking
Directions in SELinux NetworkingJames Morris
 
Επαγγέλματα Αεροδρομιου
Επαγγέλματα ΑεροδρομιουΕπαγγέλματα Αεροδρομιου
Επαγγέλματα Αεροδρομιου2epal stavroupolis
 
Osi model secugenius_harksh
Osi model secugenius_harkshOsi model secugenius_harksh
Osi model secugenius_harkshMike McLain
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Pradeep Kumar TS
 
Simplifying openstack instances networking
Simplifying openstack instances networkingSimplifying openstack instances networking
Simplifying openstack instances networkingMohamed ELMesseiry
 
Programs for office management
Programs for office managementPrograms for office management
Programs for office managementsuhailaadeeb
 

Was ist angesagt? (10)

Adding Extended Attribute Support to NFS
Adding Extended Attribute Support to NFSAdding Extended Attribute Support to NFS
Adding Extended Attribute Support to NFS
 
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...Have You Driven an SELinux Lately? - An Update on the SELinux Project -  OLS ...
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
 
Network automation via py ez
Network automation via py ezNetwork automation via py ez
Network automation via py ez
 
Buffer Overflows
Buffer OverflowsBuffer Overflows
Buffer Overflows
 
Directions in SELinux Networking
Directions in SELinux NetworkingDirections in SELinux Networking
Directions in SELinux Networking
 
Επαγγέλματα Αεροδρομιου
Επαγγέλματα ΑεροδρομιουΕπαγγέλματα Αεροδρομιου
Επαγγέλματα Αεροδρομιου
 
Osi model secugenius_harksh
Osi model secugenius_harkshOsi model secugenius_harksh
Osi model secugenius_harksh
 
Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)Simulators for Wireless Sensor Networks (OMNeT++)
Simulators for Wireless Sensor Networks (OMNeT++)
 
Simplifying openstack instances networking
Simplifying openstack instances networkingSimplifying openstack instances networking
Simplifying openstack instances networking
 
Programs for office management
Programs for office managementPrograms for office management
Programs for office management
 

Andere mochten auch

Intoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMIntoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMPrakhar Bansal
 
Makalah ide implementasi wsn dan cloud computing pada traffic light
Makalah ide implementasi wsn dan cloud computing pada traffic lightMakalah ide implementasi wsn dan cloud computing pada traffic light
Makalah ide implementasi wsn dan cloud computing pada traffic lightAngga Diputra
 
Ant Colony Optimization for Wireless Sensor Network: A Review
Ant Colony Optimization for Wireless Sensor Network: A ReviewAnt Colony Optimization for Wireless Sensor Network: A Review
Ant Colony Optimization for Wireless Sensor Network: A Reviewiosrjce
 
Security protocols & platform for wsn based medical applications
Security protocols & platform for wsn based medical applicationsSecurity protocols & platform for wsn based medical applications
Security protocols & platform for wsn based medical applicationsaviiandevil
 
Network Mnagement for WSN
Network Mnagement for WSNNetwork Mnagement for WSN
Network Mnagement for WSN@zenafaris91
 
Lifetime Power® Wireless Sensor System
Lifetime Power® Wireless Sensor SystemLifetime Power® Wireless Sensor System
Lifetime Power® Wireless Sensor SystemPowercast Sensors
 
Wireless sensor network security issues
Wireless sensor network security issuesWireless sensor network security issues
Wireless sensor network security issuesMaha Saad
 
Security in wireless sensor networks
Security in wireless sensor networksSecurity in wireless sensor networks
Security in wireless sensor networksPiyush Mittal
 
Wireless power theft monitoring
Wireless power theft monitoringWireless power theft monitoring
Wireless power theft monitoringBiswajit Pratihari
 
Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor Networksrajatmal4
 

Andere mochten auch (18)

TinyOS Course 00: Introduction to WSN
TinyOS Course 00: Introduction to WSNTinyOS Course 00: Introduction to WSN
TinyOS Course 00: Introduction to WSN
 
Intoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMIntoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIM
 
TinyOS Course 05: Advanced Protocols
TinyOS Course 05: Advanced ProtocolsTinyOS Course 05: Advanced Protocols
TinyOS Course 05: Advanced Protocols
 
TinyOS Course 03: Radio Communication
TinyOS Course 03: Radio CommunicationTinyOS Course 03: Radio Communication
TinyOS Course 03: Radio Communication
 
TinyOS
TinyOSTinyOS
TinyOS
 
TinyOS Course 04: Sensing
TinyOS Course 04: SensingTinyOS Course 04: Sensing
TinyOS Course 04: Sensing
 
TinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIMTinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIM
 
Makalah ide implementasi wsn dan cloud computing pada traffic light
Makalah ide implementasi wsn dan cloud computing pada traffic lightMakalah ide implementasi wsn dan cloud computing pada traffic light
Makalah ide implementasi wsn dan cloud computing pada traffic light
 
Ant Colony Optimization for Wireless Sensor Network: A Review
Ant Colony Optimization for Wireless Sensor Network: A ReviewAnt Colony Optimization for Wireless Sensor Network: A Review
Ant Colony Optimization for Wireless Sensor Network: A Review
 
Security protocols & platform for wsn based medical applications
Security protocols & platform for wsn based medical applicationsSecurity protocols & platform for wsn based medical applications
Security protocols & platform for wsn based medical applications
 
Network Mnagement for WSN
Network Mnagement for WSNNetwork Mnagement for WSN
Network Mnagement for WSN
 
Security in WSN
Security in WSNSecurity in WSN
Security in WSN
 
Lifetime Power® Wireless Sensor System
Lifetime Power® Wireless Sensor SystemLifetime Power® Wireless Sensor System
Lifetime Power® Wireless Sensor System
 
Wsn
WsnWsn
Wsn
 
Wireless sensor network security issues
Wireless sensor network security issuesWireless sensor network security issues
Wireless sensor network security issues
 
Security in wireless sensor networks
Security in wireless sensor networksSecurity in wireless sensor networks
Security in wireless sensor networks
 
Wireless power theft monitoring
Wireless power theft monitoringWireless power theft monitoring
Wireless power theft monitoring
 
Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor Networks
 

Ähnlich wie TinyOS Course 01: Basic Programming

.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologiesprakashk453625
 
Native development kit (ndk) introduction
Native development kit (ndk)  introductionNative development kit (ndk)  introduction
Native development kit (ndk) introductionRakesh Jha
 
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - IntroductionRakesh Jha
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET PlatformAlex Thissen
 
.Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015).Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015)citizenmatt
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Simon Storm
 
Stephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edgeStephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edgeNordicSitecoreConference
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1aminmesbahi
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxfatahozil
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaopenseesdays
 
1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)Shoaib Ghachi
 

Ähnlich wie TinyOS Course 01: Basic Programming (20)

Android ndk
Android ndkAndroid ndk
Android ndk
 
Android NDK
Android NDKAndroid NDK
Android NDK
 
Jenkins
JenkinsJenkins
Jenkins
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
Native development kit (ndk) introduction
Native development kit (ndk)  introductionNative development kit (ndk)  introduction
Native development kit (ndk) introduction
 
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - Introduction
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET Platform
 
.Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015).Net Core Blimey! (16/07/2015)
.Net Core Blimey! (16/07/2015)
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
Stephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edgeStephen Pope - Sitecore on the bleeding edge
Stephen Pope - Sitecore on the bleeding edge
 
Using the NDK and Renderscript
Using the NDK and RenderscriptUsing the NDK and Renderscript
Using the NDK and Renderscript
 
Dot net introduction
Dot net introductionDot net introduction
Dot net introduction
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Assemblies
AssembliesAssemblies
Assemblies
 
Net framework
Net frameworkNet framework
Net framework
 
.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptx
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKenna
 
.Net Core
.Net Core.Net Core
.Net Core
 
1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)
 

Kürzlich hochgeladen

Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEMISSRITIMABIOLOGYEXP
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...Nguyen Thanh Tu Collection
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineCeline George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...Nguyen Thanh Tu Collection
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxryandux83rd
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...Nguyen Thanh Tu Collection
 
4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptxmary850239
 
DBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfDBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfChristalin Nelson
 
The Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressThe Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressMaria Paula Aroca
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command Line
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
 
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
 
Chi-Square Test Non Parametric Test Categorical Variable
Chi-Square Test Non Parametric Test Categorical VariableChi-Square Test Non Parametric Test Categorical Variable
Chi-Square Test Non Parametric Test Categorical Variable
 
4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx
 
DBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfDBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdf
 
The Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressThe Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian Congress
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 

TinyOS Course 01: Basic Programming

  • 1. WSN Programming Course TinyOS Lab: Basic Programming Manuel Fernández UAH, 18th September 2013
  • 2. • Introduction to nesC • Components • FileTypes • Basic program: NullC • How to compile • NesC variables • Eclipse IDE • Exercises 2 Contents
  • 3. • A nesC application consists of one or more components assembled, or wired, to form an application executable. • Components define two scopes: • one for their specification which contains the names of their interfaces, and • a second scope for their implementation. COMPONENT A SPECIFICATION IMPLEMENTATION 3 NesC (I)
  • 4. •A component provides and uses interfaces. •The provided interfaces are intended to represent the functionality that the component provides to its user in its specification. •The used interfaces represent the functionality the component needs to perform its job in its implementation. 4 NesC (II)
  • 5. • Interfaces are bidirectional: they specify a set of commands, which are functions to be implemented by the interface's provider, and a set of events, which are functions to be implemented by the interface's user. For a component to call the commands in an interface, it must implement the events of that interface. •The set of interfaces which a component provides together with the set of interfaces that a component uses is considered that component's signature. 5 NesC (III)
  • 6. •There are 2 types of components in nesC: - Modules: provide the implementations of one or more interfaces. - Configurations: used to assemble other components together, connecting interfaces used by components to interfaces provided by others. 6 Components
  • 7. • Naming conventions are as follows: CONFIGURATIO N MODULE COMPONENTS INTERFACE Makefile Only in main app 7 File Types CONFIGURATION MODULE
  • 8. TinyOS Lab: Lesson 01 – Basic Programming © 2012 Manuel Fernández Makefile NullAppC.nc NullC.nc Configuration Module Makefile: COMPONENT=NullAppC include $(MAKERULES) Name of configuration file 8 Basic program: NullC
  • 9. NullApp.nc : SPECIFICATION IMPLEMENTATION 9 Basic program: NullC SPECIFICATION IMPLEMENTATION NullC.nc :
  • 10. • Open terminal in the folder •Type: make telosb • Insert mote in USB port and type: make telosb reinstall.1 bsl,/dev/ttyUSB0 Platform MoteID USB port (type motelist to find which one it is 10 How to compile
  • 11. • Open terminal in the folder • Type: make telosb docs • Check the created folders Platform 11 Fun Stuff
  • 12. • Commonly used units: • int is NOT used • bool is also used 12 NesC variables
  • 13. • An alternative to console programming is using a TinyOS plug-in for the Eclipse IDE. • In this IDE it is possible to compile and install programs in motes •We will use this IDE to speed up the lessons. 13 Eclipse IDE
  • 14. 1. Interface Leds has commands to control the 3 leds on the mote. (led0, led1, led2).Try each of them and install them on the mote 2. Add a Timer to blink the Leds periodically, showing a binary timer using the 3 leds. 3. Configure the User Button to do a complete routine with the Leds 4. Pack the previous subroutine in a new component with your own interface. 14 Exercises