SlideShare a Scribd company logo
1Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
SMART SANTANDER
Programming Heterogeneous IoT Platforms
The Wiselib
Daniel Bimschas
E-mail: bimschas@itm.uni-luebeck.de
Palic, 2nd September 2013
2Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
Learning Goals – Understand This!
(Platform-independent Wiselib application to read sensor values and write them to UART)
3Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
Learning Goals
• After this tutorial you will…
– Understand the basics of C++ template
programming (necessary for Wiselib)
– Understand why Wiselib is *awesome*
– Understand basic concepts and architecture
– Know how to write a (very) basic platform-
independent Wiselib application
– Know where to find source code, documentation,
and applications
– … be hungry for more 
4Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
Learning Goals
• After this tutorial you will not…
– Know how to write
application X with Algorithm Y for OS Z
– Be an expert in Wiselib
5Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
Outline
1. Introduction – What is the Wiselib?
2. Basics: C++ Template Programming
3. Architecture
OS Facets, Data Structures, Algorithms &
Applications
4. Usage Scenarios
5. Message Serialization
6. Callback Mechanism
7. Programming Environments
8. Summary & Resources
6Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
1. INTRODUCTION – WHAT IS THE WISELIB?
Programming Heterogeneous IoT Platforms – The Wiselib
7Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
1. Introduction – What is the Wiselib?
• The Wiselib is...
– a library for networked embedded devices
– contains re-usable code (just like the C++ STL)
– platform-independent
– highly efficient
– implemented using C++ templates (comparable to Boost)
• The Wiselib contains...
– a collection of algorithms
– an abstraction of embedded operating systems
– utility functions and data structures (pSTL, pMP)
8Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
1. Introduction – Algorithm Categories
Algorithm Category Count
Routing 13
Clustering 9
Time Synchronization 4
Localization 6
Energy Saving Schemes 6
Security 9
Graph Algorithms 8
Target Tracking 2
Neighbourhood Discovery 1
Data Collection 1
10 Categories, Total: 59
From: Dissertation Tobias Baumgartner, 2012/07
9Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
1. Introduction – Supported Hardware
From: Dissertation Tobias Baumgartner, 2012/07
= Fully Supported
= Supported, still in testing stage
10Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
1. Introduction – GSoC Projects
• Wiselib has been/is mentoring organization at Google Summer of Code in
2012 & 2013 (!)
• Projects 2012:
– OpenWrt Port
– Android Port
– Arduino Port
– 6LoWPAN
• Projects 2013:
– NS-3 Port
– IPv6 on Distributed Protocol Stacks
– Remote-controlled IoT with JS
– Wisebender Online-IDE
– Completion of Arduino Port
– Constrained Application Protocol (CoAP)
11Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
1. Introduction
• The Wiselib is heavily based on C++ template
programming in order to…
– achieve platform independence (heterogeneity)
– produce highly efficient machine code
– enable programming in C++ for heavily resource
constrained (IoT) devices
• So, let’s look at the basics and properties of
template programming…
12Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. BASICS: C++ TEMPLATE PROGRAMMING
Programming Heterogeneous IoT Platforms – The Wiselib
13Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Parameterized Library Code (max.hpp)
Generated Code
Template
“instantiation”
Application (main.cpp)
Compilation
Executable Binary
“triggers”
14Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Function templates are…
– instantiated and compiled only for functions that
are actually called
– implicitly inline (allows compiler optimizations)
– instantiated for every type parameter used
– typically located in header files as implementation
source is needed for instantiation
+
-
+
15Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Template Specialization
– allows optimizations for concrete types
– sometimes necessary to work correctly with
certain types
+
-
Specialization for char*
16Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Advanced example (multiple type parameters)
17Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Partial Specialization (two identical parameters)
18Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Partial Specialization (one concrete parameter)
19Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Partial Specialization (two pointer types)
20Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Default type parameters
21Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Default value parameters
– dynamic memory management can be avoided
(highly efficient)
– only primitive types (not classes) allowed as value
parameters
+
22Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Bound dynamic polymorphism (OO-inheritance)
GeoObj
draw()
get_position_x()
get_position_y()
Line
draw()
Circle
draw()
extends extends
23Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Bound dynamic polymorphism (OO-inheritance)
24Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Bound dynamic polymorphism (OO-inheritance)
25Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Bound dynamic polymorphism (OO-inheritance)
– Shared code only compiled once
– Allows inhomogeneous sets
(data structures bound to instances of base class)
– Good compiler error messages
– Generates virtual function tables
(overhead for program memory and runtime)
– Virtual methods can not be inlined
(prevents compiler optimizations)
+
+
+
-
-
26Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Unbound static polymorphism (using templates)
GeoObj <<concept>>
draw()
get_position_x()
get_position_y()
Line
draw()
Circle
draw()
models models
exists only in documentation,
not known to compiler,
no IDE support
27Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Unbound static polymorphism (using templates)
No common base class, but same “interface” (a.k.a. concept)
28Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Unbound static polymorphism (using templates)
29Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Unbound static polymorphism (using templates)
• Concepts exist only in documentation
• Concepts describe “interface” of template
class
• Programming: interfaces and classes
• Metaprogramming: concepts and models
• Multiple inheritance equally possible
30Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
2. Basics: C++ Template Programming
Unbound static polymorphism (using templates)
– Faster & smaller machine code
(no pointer indirection, no vtables are generated)
– Enables heavy compiler optimizations (inlining)
– No inhomogeneous sets possible
(reason: no common base class, only concepts)
– Compiler error messages hard to read
+
+
-
-
31Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
3. ARCHITECTURE
Programming Heterogeneous IoT Platforms – The Wiselib
32Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
3. Architecture Constraints
Some target architectures are heavily resource-
constrained. Wiselib applications must therefore
adhere to some restrictions:
• No dynamic memory allocation
– no new, delete, malloc, free, only static allocation (!)
• No STL, use picoSTL
• No Runtime Type Information (RTTI)
– no dynamic_cast<> -> no type safety checks
• No virtual inheritance
33Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
3. Architecture
Image Source: Dissertation Tobias Baumgartner, 2012
34Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
3. Architecture – Basic OS Concepts
Image Source: Dissertation Tobias Baumgartner, 2012
Concept Description
OS Describes platform capabilities by providing only type definitions
(base for other concepts)
Radio Send & receive functions, type definitions for node and message IDs
(e.g., a node ID may be an 802.15.4 or an IPv6 address…)
Timer Allows to schedule callbacks
Clock Allows to read system time
Debug printf-like logging facility, can print to UART or e.g., forward to sink
Serial UART, I2C, …
… …
More concepts:
http://www.ibr.cs.tu-bs.de/users/tbaum/wiselib/doxygen/testing/html/group__concepts.html
35Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
Parameterized
Algorithm
3. Architecture – Algorithm Example
OS Abstraction Layer
Data Structure
static allocation
Use of typedefs to have
a fixed name to
reference
36Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
3. Architecture – Algorithm Example
Instantiated template class (when compiling for iSense)
(probably unprecise and/or partially incorrect, but you should get the idea)
Use of typedefs to have
a fixed name to reference
37Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
4. USAGE SCENARIOS
Programming Heterogeneous IoT Platforms – The Wiselib
38Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
4. Usage Scenarios
The Wiselib can be used in two ways:
1. As an algorithm library
– Use classes for special purposes, e.g., routing
– “Embed” Wiselib in your host application
2. As a “generic application”
– Can be compiled to each supported platform
(portable)
– Limited to Wiselib concepts
(no direct access to OS functionality)
39Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
4. Usage Scenarios – Algorithm Library
OS Abstraction Layer
Data Structure
Algorithm
Example from $WISELIB_HOME/apps/iapps/wiselib_example
Radio, Timer, Debug concepts all
modeled by iSenseOsModel
(using multiple inheritance)
40Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
FacetProvider
hides initialization
details
4. Usage Scenarios – Generic App
OS Abstraction Layer
Data Structure
Algorithm
Example from $WISELIB_HOME/apps/generic_apps/routing_test
static allocation
References to typedefs
declared in OS models
Reference to internal typedefs makes code more readable
41Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
4. Usage Scenarios – Compiling
Makefile from $WISELIB_HOME/apps/generic_apps/routing_test
42Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
5. CALLBACK MECHANISM
Programming Heterogeneous IoT Platforms – The Wiselib
43Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
5. Callback Mechanism
Some concepts require to register callbacks (e.g., radio, timer)…
Makefile from $WISELIB_HOME/apps/generic_apps/example_app
44Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
6. MESSAGE SERIALIZATION
Programming Heterogeneous IoT Platforms – The Wiselib
45Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
6. Message Serialization
1. Word Width
2. Byte Order
3. Alignment
45
Jennic
MSP430
A B C D
D C B A
Big Endian
Little Endian
Shawn on Desktop
MSP430
Write int
Write uint32_t
uint16_t at odd address
46Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
6. Message Serialization
Solution: Templated Serialization provided by Wiselib
– Can be specialized for each system and each data type
47Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
6. Message Serialization
48Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
7. PROGRAMMING ENVIRONMENTS
Programming Heterogeneous IoT Platforms – The Wiselib
49Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
8. Programming Environments
• Wisebender is an Online-IDE for Wiselib-
Development
– Fork of the popular (Arduino) Codebender IDE
http://codebender.cc/
– Currently being developed in GSoC 2013
– Edit and compile code without *any* toolchain
installation (!!!)
• Wisebender Beta Access:
http://wisebender.cti.gr/app_dev.php/
50Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
8. Programming Environments
• The WISEBED VM is a pre-configured Linux
Development Environment containing:
– Compilers for various IoT hardware platforms
– Various sensor node operating systems
– The Shawn network simulator
– The Wiselib 
• Get it from: wisebed.eu/site/application-
development/virtual-machine/
• Or from the USB sticks I brought!
51Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
8. SUMMARY & RESOURCES
Programming Heterogeneous IoT Platforms – The Wiselib
52Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
8. Summary
• Code library of algorithms
– Write once, compile everywhere
– Highly efficient, portable libraries and applications
– Variety of well-known algorithms implemented
– Open-Source
• Supports a variety of hardware platforms and simulators
– Easily extensible, e.g., to other (C/C++/nesC) platforms
– Helps to avoid vendor lock-in
• Growing community of contributors
– Benefit from others, contribute for others
53Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved.
8. Resources
Lots of Sources &
Examples in Repo
git clone git@github.com:ibr-
alg/wiselib.git
Read Documentation
https://github.com/ibr-
alg/wiselib/wiki
Join Mailing List
wiselib-subscribe@wiselib.org
Apply for GSoC 2014 :)

More Related Content

What's hot

LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLinaro
 
Build and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerBuild and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerQt
 
LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...
LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...
LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...Linaro
 
Qt World Summit 2017: Qt vs. Web - Total Cost of Ownership
Qt World Summit 2017: Qt vs. Web - Total Cost of OwnershipQt World Summit 2017: Qt vs. Web - Total Cost of Ownership
Qt World Summit 2017: Qt vs. Web - Total Cost of OwnershipBurkhard Stubert
 
Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers
Con3187 Creating Industrial Middleware with Java ME and Single-Board ComputersCon3187 Creating Industrial Middleware with Java ME and Single-Board Computers
Con3187 Creating Industrial Middleware with Java ME and Single-Board ComputersJulio Palma Vázquez
 
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver MeetupDaneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver MeetupShannon McFarland
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung Open Source Group
 
LAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLinaro
 
PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...
PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...
PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...AMD Developer Central
 
Perceptual Computing Workshop à Paris
Perceptual Computing Workshop à ParisPerceptual Computing Workshop à Paris
Perceptual Computing Workshop à ParisBeMyApp
 
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...RISC-V International
 
Intel® RDT Hands-on Lab
Intel® RDT Hands-on LabIntel® RDT Hands-on Lab
Intel® RDT Hands-on LabMichelle Holley
 
Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...
Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...
Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...RISC-V International
 
Perceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichPerceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichBeMyApp
 
Cloud Deep Learning Chips Training & Inference
Cloud Deep Learning Chips Training & InferenceCloud Deep Learning Chips Training & Inference
Cloud Deep Learning Chips Training & InferenceMr. Vengineer
 
Java applications containerized and deployed
Java applications containerized and deployedJava applications containerized and deployed
Java applications containerized and deployedAnthony Dahanne
 

What's hot (20)

LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android N
 
Build and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerBuild and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with docker
 
LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...
LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...
LAS16-301: OpenStack on Aarch64, running in production, upstream improvements...
 
Qt World Summit 2017: Qt vs. Web - Total Cost of Ownership
Qt World Summit 2017: Qt vs. Web - Total Cost of OwnershipQt World Summit 2017: Qt vs. Web - Total Cost of Ownership
Qt World Summit 2017: Qt vs. Web - Total Cost of Ownership
 
Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers
Con3187 Creating Industrial Middleware with Java ME and Single-Board ComputersCon3187 Creating Industrial Middleware with Java ME and Single-Board Computers
Con3187 Creating Industrial Middleware with Java ME and Single-Board Computers
 
TULIPP at the 10th Intelligent Imaging Event
TULIPP at the 10th Intelligent Imaging EventTULIPP at the 10th Intelligent Imaging Event
TULIPP at the 10th Intelligent Imaging Event
 
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver MeetupDaneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
Daneyon Hansen - Intro to OpenStack - Feb13 OpenStack Denver Meetup
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
LAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoS
 
PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...
PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...
PL-4051, An Introduction to SPIR for OpenCL Application Developers and Compil...
 
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
 
Perceptual Computing Workshop à Paris
Perceptual Computing Workshop à ParisPerceptual Computing Workshop à Paris
Perceptual Computing Workshop à Paris
 
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
 
LEGaTO Integration
LEGaTO IntegrationLEGaTO Integration
LEGaTO Integration
 
Intel® RDT Hands-on Lab
Intel® RDT Hands-on LabIntel® RDT Hands-on Lab
Intel® RDT Hands-on Lab
 
Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...
Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...
Klessydra-T: Designing Configurable Vector Co-Processors for Multi-Threaded E...
 
Perceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichPerceptual Computing Workshop in Munich
Perceptual Computing Workshop in Munich
 
Cloud Deep Learning Chips Training & Inference
Cloud Deep Learning Chips Training & InferenceCloud Deep Learning Chips Training & Inference
Cloud Deep Learning Chips Training & Inference
 
Java applications containerized and deployed
Java applications containerized and deployedJava applications containerized and deployed
Java applications containerized and deployed
 
Linux on RISC-V
Linux on RISC-VLinux on RISC-V
Linux on RISC-V
 

Similar to 2013 09-02 senzations-bimschas-part3-wiselib

End-to-End Deep Learning Deployment with ONNX
End-to-End Deep Learning Deployment with ONNXEnd-to-End Deep Learning Deployment with ONNX
End-to-End Deep Learning Deployment with ONNXNick Pentreath
 
An Update on the European Processor Initiative
An Update on the European Processor InitiativeAn Update on the European Processor Initiative
An Update on the European Processor Initiativeinside-BigData.com
 
Open Source AI - News and examples
Open Source AI - News and examplesOpen Source AI - News and examples
Open Source AI - News and examplesLuciano Resende
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialSamsung Open Source Group
 
Ai pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksAi pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksLuciano Resende
 
Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth Pilli
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCFacultad de Informática UCM
 
Deploying End-to-End Deep Learning Pipelines with ONNX
Deploying End-to-End Deep Learning Pipelines with ONNXDeploying End-to-End Deep Learning Pipelines with ONNX
Deploying End-to-End Deep Learning Pipelines with ONNXDatabricks
 
Leveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge DevicesLeveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge DevicesICS
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeLuciano Resende
 
HiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentation
HiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentationHiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentation
HiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentationVEDLIoT Project
 
License Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCVLicense Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCVVishal Polley
 
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfAdvanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfIsmailkhan77481
 
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...Srivatsan Ramanujam
 
Scaling up deep learning by scaling down
Scaling up deep learning by scaling downScaling up deep learning by scaling down
Scaling up deep learning by scaling downNick Pentreath
 
SysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS Approach
SysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS ApproachSysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS Approach
SysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS ApproachAlessandra Bagnato
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Embarcados
 

Similar to 2013 09-02 senzations-bimschas-part3-wiselib (20)

End-to-End Deep Learning Deployment with ONNX
End-to-End Deep Learning Deployment with ONNXEnd-to-End Deep Learning Deployment with ONNX
End-to-End Deep Learning Deployment with ONNX
 
An Update on the European Processor Initiative
An Update on the European Processor InitiativeAn Update on the European Processor Initiative
An Update on the European Processor Initiative
 
Open Source AI - News and examples
Open Source AI - News and examplesOpen Source AI - News and examples
Open Source AI - News and examples
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
Ai pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooksAi pipelines powered by jupyter notebooks
Ai pipelines powered by jupyter notebooks
 
Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latest
 
Ankit sarin
Ankit sarinAnkit sarin
Ankit sarin
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPC
 
Deploying End-to-End Deep Learning Pipelines with ONNX
Deploying End-to-End Deep Learning Pipelines with ONNXDeploying End-to-End Deep Learning Pipelines with ONNX
Deploying End-to-End Deep Learning Pipelines with ONNX
 
Leveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge DevicesLeveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge Devices
 
Inteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for CodeInteligencia artificial, open source e IBM Call for Code
Inteligencia artificial, open source e IBM Call for Code
 
HiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentation
HiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentationHiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentation
HiPEAC2023-DL4IoT Workshop_Jean Hagemeyer presentation
 
License Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCVLicense Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCV
 
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfAdvanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
 
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...
 
CURRICULUM VITAE
CURRICULUM VITAE CURRICULUM VITAE
CURRICULUM VITAE
 
An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0
 
Scaling up deep learning by scaling down
Scaling up deep learning by scaling downScaling up deep learning by scaling down
Scaling up deep learning by scaling down
 
SysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS Approach
SysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS ApproachSysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS Approach
SysML for Modeling Co-Simulation Orchestration over FMI, INTO-CPS Approach
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
 

Recently uploaded

Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 

Recently uploaded (20)

Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

2013 09-02 senzations-bimschas-part3-wiselib

  • 1. 1Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. SMART SANTANDER Programming Heterogeneous IoT Platforms The Wiselib Daniel Bimschas E-mail: bimschas@itm.uni-luebeck.de Palic, 2nd September 2013
  • 2. 2Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. Learning Goals – Understand This! (Platform-independent Wiselib application to read sensor values and write them to UART)
  • 3. 3Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. Learning Goals • After this tutorial you will… – Understand the basics of C++ template programming (necessary for Wiselib) – Understand why Wiselib is *awesome* – Understand basic concepts and architecture – Know how to write a (very) basic platform- independent Wiselib application – Know where to find source code, documentation, and applications – … be hungry for more 
  • 4. 4Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. Learning Goals • After this tutorial you will not… – Know how to write application X with Algorithm Y for OS Z – Be an expert in Wiselib
  • 5. 5Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. Outline 1. Introduction – What is the Wiselib? 2. Basics: C++ Template Programming 3. Architecture OS Facets, Data Structures, Algorithms & Applications 4. Usage Scenarios 5. Message Serialization 6. Callback Mechanism 7. Programming Environments 8. Summary & Resources
  • 6. 6Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 1. INTRODUCTION – WHAT IS THE WISELIB? Programming Heterogeneous IoT Platforms – The Wiselib
  • 7. 7Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 1. Introduction – What is the Wiselib? • The Wiselib is... – a library for networked embedded devices – contains re-usable code (just like the C++ STL) – platform-independent – highly efficient – implemented using C++ templates (comparable to Boost) • The Wiselib contains... – a collection of algorithms – an abstraction of embedded operating systems – utility functions and data structures (pSTL, pMP)
  • 8. 8Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 1. Introduction – Algorithm Categories Algorithm Category Count Routing 13 Clustering 9 Time Synchronization 4 Localization 6 Energy Saving Schemes 6 Security 9 Graph Algorithms 8 Target Tracking 2 Neighbourhood Discovery 1 Data Collection 1 10 Categories, Total: 59 From: Dissertation Tobias Baumgartner, 2012/07
  • 9. 9Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 1. Introduction – Supported Hardware From: Dissertation Tobias Baumgartner, 2012/07 = Fully Supported = Supported, still in testing stage
  • 10. 10Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 1. Introduction – GSoC Projects • Wiselib has been/is mentoring organization at Google Summer of Code in 2012 & 2013 (!) • Projects 2012: – OpenWrt Port – Android Port – Arduino Port – 6LoWPAN • Projects 2013: – NS-3 Port – IPv6 on Distributed Protocol Stacks – Remote-controlled IoT with JS – Wisebender Online-IDE – Completion of Arduino Port – Constrained Application Protocol (CoAP)
  • 11. 11Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 1. Introduction • The Wiselib is heavily based on C++ template programming in order to… – achieve platform independence (heterogeneity) – produce highly efficient machine code – enable programming in C++ for heavily resource constrained (IoT) devices • So, let’s look at the basics and properties of template programming…
  • 12. 12Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. BASICS: C++ TEMPLATE PROGRAMMING Programming Heterogeneous IoT Platforms – The Wiselib
  • 13. 13Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Parameterized Library Code (max.hpp) Generated Code Template “instantiation” Application (main.cpp) Compilation Executable Binary “triggers”
  • 14. 14Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Function templates are… – instantiated and compiled only for functions that are actually called – implicitly inline (allows compiler optimizations) – instantiated for every type parameter used – typically located in header files as implementation source is needed for instantiation + - +
  • 15. 15Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Template Specialization – allows optimizations for concrete types – sometimes necessary to work correctly with certain types + - Specialization for char*
  • 16. 16Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Advanced example (multiple type parameters)
  • 17. 17Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Partial Specialization (two identical parameters)
  • 18. 18Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Partial Specialization (one concrete parameter)
  • 19. 19Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Partial Specialization (two pointer types)
  • 20. 20Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Default type parameters
  • 21. 21Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Default value parameters – dynamic memory management can be avoided (highly efficient) – only primitive types (not classes) allowed as value parameters +
  • 22. 22Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Bound dynamic polymorphism (OO-inheritance) GeoObj draw() get_position_x() get_position_y() Line draw() Circle draw() extends extends
  • 23. 23Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Bound dynamic polymorphism (OO-inheritance)
  • 24. 24Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Bound dynamic polymorphism (OO-inheritance)
  • 25. 25Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Bound dynamic polymorphism (OO-inheritance) – Shared code only compiled once – Allows inhomogeneous sets (data structures bound to instances of base class) – Good compiler error messages – Generates virtual function tables (overhead for program memory and runtime) – Virtual methods can not be inlined (prevents compiler optimizations) + + + - -
  • 26. 26Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Unbound static polymorphism (using templates) GeoObj <<concept>> draw() get_position_x() get_position_y() Line draw() Circle draw() models models exists only in documentation, not known to compiler, no IDE support
  • 27. 27Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Unbound static polymorphism (using templates) No common base class, but same “interface” (a.k.a. concept)
  • 28. 28Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Unbound static polymorphism (using templates)
  • 29. 29Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Unbound static polymorphism (using templates) • Concepts exist only in documentation • Concepts describe “interface” of template class • Programming: interfaces and classes • Metaprogramming: concepts and models • Multiple inheritance equally possible
  • 30. 30Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 2. Basics: C++ Template Programming Unbound static polymorphism (using templates) – Faster & smaller machine code (no pointer indirection, no vtables are generated) – Enables heavy compiler optimizations (inlining) – No inhomogeneous sets possible (reason: no common base class, only concepts) – Compiler error messages hard to read + + - -
  • 31. 31Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 3. ARCHITECTURE Programming Heterogeneous IoT Platforms – The Wiselib
  • 32. 32Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 3. Architecture Constraints Some target architectures are heavily resource- constrained. Wiselib applications must therefore adhere to some restrictions: • No dynamic memory allocation – no new, delete, malloc, free, only static allocation (!) • No STL, use picoSTL • No Runtime Type Information (RTTI) – no dynamic_cast<> -> no type safety checks • No virtual inheritance
  • 33. 33Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 3. Architecture Image Source: Dissertation Tobias Baumgartner, 2012
  • 34. 34Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 3. Architecture – Basic OS Concepts Image Source: Dissertation Tobias Baumgartner, 2012 Concept Description OS Describes platform capabilities by providing only type definitions (base for other concepts) Radio Send & receive functions, type definitions for node and message IDs (e.g., a node ID may be an 802.15.4 or an IPv6 address…) Timer Allows to schedule callbacks Clock Allows to read system time Debug printf-like logging facility, can print to UART or e.g., forward to sink Serial UART, I2C, … … … More concepts: http://www.ibr.cs.tu-bs.de/users/tbaum/wiselib/doxygen/testing/html/group__concepts.html
  • 35. 35Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. Parameterized Algorithm 3. Architecture – Algorithm Example OS Abstraction Layer Data Structure static allocation Use of typedefs to have a fixed name to reference
  • 36. 36Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 3. Architecture – Algorithm Example Instantiated template class (when compiling for iSense) (probably unprecise and/or partially incorrect, but you should get the idea) Use of typedefs to have a fixed name to reference
  • 37. 37Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 4. USAGE SCENARIOS Programming Heterogeneous IoT Platforms – The Wiselib
  • 38. 38Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 4. Usage Scenarios The Wiselib can be used in two ways: 1. As an algorithm library – Use classes for special purposes, e.g., routing – “Embed” Wiselib in your host application 2. As a “generic application” – Can be compiled to each supported platform (portable) – Limited to Wiselib concepts (no direct access to OS functionality)
  • 39. 39Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 4. Usage Scenarios – Algorithm Library OS Abstraction Layer Data Structure Algorithm Example from $WISELIB_HOME/apps/iapps/wiselib_example Radio, Timer, Debug concepts all modeled by iSenseOsModel (using multiple inheritance)
  • 40. 40Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. FacetProvider hides initialization details 4. Usage Scenarios – Generic App OS Abstraction Layer Data Structure Algorithm Example from $WISELIB_HOME/apps/generic_apps/routing_test static allocation References to typedefs declared in OS models Reference to internal typedefs makes code more readable
  • 41. 41Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 4. Usage Scenarios – Compiling Makefile from $WISELIB_HOME/apps/generic_apps/routing_test
  • 42. 42Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 5. CALLBACK MECHANISM Programming Heterogeneous IoT Platforms – The Wiselib
  • 43. 43Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 5. Callback Mechanism Some concepts require to register callbacks (e.g., radio, timer)… Makefile from $WISELIB_HOME/apps/generic_apps/example_app
  • 44. 44Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 6. MESSAGE SERIALIZATION Programming Heterogeneous IoT Platforms – The Wiselib
  • 45. 45Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 6. Message Serialization 1. Word Width 2. Byte Order 3. Alignment 45 Jennic MSP430 A B C D D C B A Big Endian Little Endian Shawn on Desktop MSP430 Write int Write uint32_t uint16_t at odd address
  • 46. 46Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 6. Message Serialization Solution: Templated Serialization provided by Wiselib – Can be specialized for each system and each data type
  • 47. 47Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 6. Message Serialization
  • 48. 48Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 7. PROGRAMMING ENVIRONMENTS Programming Heterogeneous IoT Platforms – The Wiselib
  • 49. 49Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 8. Programming Environments • Wisebender is an Online-IDE for Wiselib- Development – Fork of the popular (Arduino) Codebender IDE http://codebender.cc/ – Currently being developed in GSoC 2013 – Edit and compile code without *any* toolchain installation (!!!) • Wisebender Beta Access: http://wisebender.cti.gr/app_dev.php/
  • 50. 50Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 8. Programming Environments • The WISEBED VM is a pre-configured Linux Development Environment containing: – Compilers for various IoT hardware platforms – Various sensor node operating systems – The Shawn network simulator – The Wiselib  • Get it from: wisebed.eu/site/application- development/virtual-machine/ • Or from the USB sticks I brought!
  • 51. 51Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 8. SUMMARY & RESOURCES Programming Heterogeneous IoT Platforms – The Wiselib
  • 52. 52Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 8. Summary • Code library of algorithms – Write once, compile everywhere – Highly efficient, portable libraries and applications – Variety of well-known algorithms implemented – Open-Source • Supports a variety of hardware platforms and simulators – Easily extensible, e.g., to other (C/C++/nesC) platforms – Helps to avoid vendor lock-in • Growing community of contributors – Benefit from others, contribute for others
  • 53. 53Copyright © SmartSantander Project FP7-ICT-2009-5 257992. All Rights reserved. 8. Resources Lots of Sources & Examples in Repo git clone git@github.com:ibr- alg/wiselib.git Read Documentation https://github.com/ibr- alg/wiselib/wiki Join Mailing List wiselib-subscribe@wiselib.org Apply for GSoC 2014 :)