SlideShare a Scribd company logo
1 of 15
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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#)
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 

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