3 \frametitle{What is Internet of Things (IoT)
}
5 \begin{itemize
} \item 1999:
\pause{} RFID
6 \item Device to device communication
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 Relaying (SMS, Whatsapp)
20 \item Combinations: e.g. Thermostat
21 \item Smart clothing, smart watches
27 \frametitle{Problems with IoT
}
29 \item Device $
\rightarrow$ Server $
\rightarrow$ Application
31 \item Myriads of devices: Arduino, ESP8266, Raspberry pi
\ldots
33 \item Tons of languages: C++, Lua, C, python
\ldots
35 \item Heaps of communication methods: LoRa (Sigfox, KPN, TTN), BTLE, WiFi, ZigBee
\ldots
40 \item Integration problems
41 \item Reprogramming, write cycles
46 \frametitle{And there is TOP/iTasks
}
50 \item Generated web interface
58 \item Filling in forms
59 \item Looking at data (Monitoring, Maps)
60 \item Act on data changes
66 \frametitle{IoT and TOP
}
67 \begin{block
}{Overlap
}
69 \item Tasks often involve humans
70 \item Tasks can be performed by IoT
74 \begin{block
}{But how to integrate
}
76 \item Distributed iTasks
78 \item Swat two flies at once
86 \item Add IoT to iTasks
87 \item Solve the integration problem
88 \item Extend the reach of iTasks
90 \item IoT device client
91 \item EDSL to make IoT tasks
92 \item Interpreted on the client
93 \item No reprogramming
100 \frametitle{Problems overcome
}
101 \begin{itemize
}[<+->
]
102 \item Way to express IoT Tasks
103 \item Write client software
104 \item Write server software
105 \item Connect them up
110 \begin{frame
}[fragile
]
111 \frametitle{Task Oriented Programming
}
112 \framesubtitle{\ldots and iTasks
}
113 \begin{block
}{iTasks
}
114 \begin{itemize
}[<+->
]
116 \item Generated web interface
122 \column{.49\linewidth}
124 \begin{itemize
}[<+->
]
126 \item Given the state, a
\CI{TaskValue
} is observed.
127 \item Continuous execution
132 \column{.49\linewidth}
135 \includegraphics[width=
\linewidth]{fig-taskvalue
}
136 \caption{The states of a
\CI{TaskValue
}}
141 \begin{frame
}[fragile
]
142 \frametitle{Task Oriented Programming
}
143 \framesubtitle{Example
}
145 :: Name =
{ firstname :: String, lastname :: String
}
146 derive class iTask Name
148 enterInformation :: String
[EnterOption m
] -> Task m | iTask m
149 enterName :: Task Name
150 enterName = enterInformation "Enter your name"
[]
155 \begin{subfigure
}{.30\textwidth}
157 \includegraphics[width=
.9\linewidth]{taskex1
}
158 \caption{Initial interface\\~
}\label{fig:taskex1
}
160 \begin{subfigure
}{.30\textwidth}
162 \includegraphics[width=
.9\linewidth]{taskex2
}
163 \caption{Incomplete entrance
}\label{fig:taskex2
}
165 \begin{subfigure
}{.30\textwidth}
167 \includegraphics[width=
.9\linewidth]{taskex3
}
168 \caption{Complete entry\\~
}\label{fig:taskex3
}
170 \caption{Example of a generated user interface
}
174 \begin{frame
}[fragile
]
175 \frametitle{Task Oriented Programming (
3)
}
176 \framesubtitle{Combinators
}
177 \begin{block
}{Sequence
}
179 (>>=) infixl
1 :: (Task a) (a -> Task b) -> Task b | iTask a & iTask b
180 (>>*) infixl
1 :: (Task a)
[TaskCont a (Task b)
] -> Task b | iTask a & iTask b
182 = OnValue ((TaskValue a) -> Maybe b)
183 | OnAction Action ((TaskValue a) -> Maybe b)
184 | E.e: OnException (e -> b) & iTask e
185 | OnAllExceptions (String -> b)
186 :: Action = Action String
190 \begin{block
}{Parallel
}
192 (-||-) infixr
3 :: (Task a) (Task a) -> Task a | iTask a
193 ( ||-) infixr
3 :: (Task a) (Task b) -> Task b | iTask a & iTask b
194 (-|| ) infixl
3 :: (Task a) (Task b) -> Task a | iTask a & iTask b
195 (-&&-) infixr
4 :: (Task a) (Task b) -> Task (a,b) | iTask a & iTask b
200 \begin{frame
}[fragile
]
201 \frametitle{Shared Data Sources (SDS)
}
202 \begin{block
}{What is an SDS
}
203 \begin{itemize
}[<+->
]
210 :: RWShared p r w = ...
211 :: ReadWriteShared r w :== RWShared () r w
212 :: Shared r :== ReadWriteShared r r
214 get :: (ReadWriteShared r w) -> Task r | iTask r
215 set :: w (ReadWriteShared r w) -> Task w | iTask w
216 upd :: (r -> w) (ReadWriteShared r w) -> Task w | iTask r & iTask w
218 sharedStore :: String a -> Shared a | JSONEncode
{|*|
}, JSONDecode
{|*|
}
220 wait :: String (r -> Bool) (ReadWriteShared r w) -> Task r
224 \begin{frame
}[fragile
]
226 \framesubtitle{Parametric Lenses
}
227 \begin{block
}{What is the
\CI{p
} for in
\CI{RWShared p r w
}}
230 \item Parameter fixed when writing
231 \item Used for notifications
236 sdsFocus :: p1 (RWShared p1 r w) -> RWShared p2 r w | iTask p
238 :: SDSNotifyPred p :== p -> Bool
239 :: SDSLensRead p r rs = SDSRead (p -> rs -> MaybeError TaskException r)
240 | SDSReadConst (p -> r)
241 :: SDSLensWrite p w rs ws = SDSWrite (p -> rs -> w -> MaybeError TaskException (Maybe ws))
242 | SDSWriteConst (p -> w -> MaybeError TaskException (Maybe ws))
243 :: SDSLensNotify p w rs = SDSNotify (p -> rs -> w -> SDSNotifyPred p)
244 | SDSNotifyConst (p -> w -> SDSNotifyPred p)
246 sdsLens :: String (p -> ps) (SDSLensRead p r rs) (SDSLensWrite p w rs ws)
247 (SDSLensNotify p w rs) (RWShared ps rs ws) -> RWShared p r w | iTask ps
252 \frametitle{Why add IoT devices to iTasks
}
263 \begin{block
}{Current possibilities
}
265 \item Implement a device as an SDS
267 \item Tailor made SDS for every task
268 \item Difficult to get logic in
270 \item Arjan's Distributed iTasks
272 \item Requires fast hardware
279 \frametitle{Solution
}
281 \begin{block
}{EDSL to the rescue
}