3 \frametitle{What is the Internet of Things (IoT)
}
5 \begin{itemize
} \item 1999:
\pause{} RFID
6 \item Device to device communication
8 \item Now:
\pause{} IoT is everywhere
9 \item Estimated
30 billion in
2020
13 \begin{block
}{Tasks performed by IoT
}
15 \item Monitoring (Temperature, Electricity, Humidity, Heartbeat)
16 \item Acting (Servo's, Motors)
17 \item Tracking (GPS, WiFi tracking)
18 \item Combinations: e.g. Thermostat, Smart Clothing, Smart Watches
24 \frametitle{Problems with IoT
}
26 \item Device $
\rightarrow$ Server $
\rightarrow$ Application
27 \item Myriads of devices: Arduino, ESP8266, Raspberry pi
\ldots
28 \item Tons of languages: C++, Lua, C, python
\ldots
29 \item Heaps of communication methods: LoRa (Sigfox, KPN, TTN), BTLE, WiFi, ZigBee
\ldots
33 \item Integration problems
38 \frametitle{And there is TOP/iTasks
}
41 \item Tasks are basic blocks
42 \item Generated web interface
49 \item Filling in forms
50 \item Looking at data (Monitoring, Maps)
51 \item Act on data changes
57 \frametitle{IoT and TOP
}
58 \begin{block
}{Overlap
}
60 \item Tasks often involve humans
61 \item Tasks can often be performed by IoT
67 \frametitle{Problem statement
}
68 \begin{block
}{What is the problem?
}
72 \item But
\ldots\pause{} integration does not
78 \begin{block
}{Why is this interesting?
}
80 \item Makes IoT integration easier
81 \item Safer IoT clients
82 \item Extend the reach of iTasks
83 \item Generate all three components of IoT from one source
89 \begin{frame
}[fragile
]
90 \frametitle{First some theory
}
91 \framesubtitle{\ldots iTasks
}
95 \item Given the state, a
\CI{TaskValue
} is observed.
96 \item Continuous execution
102 \includegraphics[width=
.6\linewidth]{fig-taskvalue
}
103 \caption{The states of a
\CI{TaskValue
}}
107 \begin{frame
}[fragile
]
108 \frametitle{Task Oriented Programming
}
109 \framesubtitle{Example
}
110 \begin{lstlisting
}[language=Clean
]
111 :: Name =
{ firstname :: String, lastname :: String
}
112 derive class iTask Name
114 enterInformation :: String
[EnterOption m
] -> Task m | iTask m
115 enterName :: Task Name
116 enterName = enterInformation "Enter your name"
[]
121 \begin{subfigure
}{.30\textwidth}
123 \includegraphics[width=
.9\linewidth]{taskex1
}
124 \caption{Initial interface\\~
}\label{fig:taskex1
}
126 \begin{subfigure
}{.30\textwidth}
128 \includegraphics[width=
.9\linewidth]{taskex2
}
129 \caption{Incomplete entrance
}\label{fig:taskex2
}
131 \begin{subfigure
}{.30\textwidth}
133 \includegraphics[width=
.9\linewidth]{taskex3
}
134 \caption{Complete entry\\~
}\label{fig:taskex3
}
136 \caption{Example of a generated user interface
}
140 \begin{frame
}[fragile
]
141 \frametitle{Task Oriented Programming (
3)
}
142 \framesubtitle{Combinators
}
143 \begin{block
}{Sequence
}
144 \begin{lstlisting
}[language=Clean
]
145 (>>=) infixl
1 :: (Task a) (a -> Task b) -> Task b | iTask a & iTask b
146 (>>*) infixl
1 :: (Task a)
[TaskCont a (Task b)
] -> Task b | iTask a & iTask b
148 = OnValue ((TaskValue a) -> Maybe b)
149 | OnAction Action ((TaskValue a) -> Maybe b)
150 | E.e: OnException (e -> b) & iTask e
151 | OnAllExceptions (String -> b)
152 :: Action = Action String
156 \begin{block
}{Parallel
}
157 \begin{lstlisting
}[language=Clean
]
158 (-||-) infixr
3 :: (Task a) (Task a) -> Task a | iTask a
159 ( ||-) infixr
3 :: (Task a) (Task b) -> Task b | iTask a & iTask b
160 (-|| ) infixl
3 :: (Task a) (Task b) -> Task a | iTask a & iTask b
161 (-&&-) infixr
4 :: (Task a) (Task b) -> Task (a,b) | iTask a & iTask b
166 \begin{frame
}[fragile
]
167 \frametitle{Shared Data Sources (SDS)
}
168 \begin{block
}{What is an SDS
}
173 \item Both have access to the world
174 \item Default: JSON file storage
178 \begin{lstlisting
}[language=Clean
]
179 :: RWShared p r w = ...
180 :: ReadWriteShared r w :== RWShared () r w
181 :: Shared r :== ReadWriteShared r r
183 get :: (ReadWriteShared r w) -> Task r | iTask r
184 set :: w (ReadWriteShared r w) -> Task w | iTask w
185 upd :: (r -> w) (ReadWriteShared r w) -> Task w | iTask r & iTask w
187 sharedStore :: String a -> Shared a | JSONEncode
{|*|
}, JSONDecode
{|*|
}
189 wait :: String (r -> Bool) (ReadWriteShared r w) -> Task r
194 \frametitle{So how can we do the integration?
}
195 \begin{itemize
}[<+->
]
196 \item Program device as an SDS
197 \item Distributed iTasks
198 \item Devices have different paradigms
203 \frametitle{How to express Tasks suitable for microcontrollers
}
204 \pause\centering\Huge EDSLs to the rescue