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 Possibly far away
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
98 \frametitle{Problems overcome
}
100 \item Way to express IoT Tasks
101 \item Write client software
102 \item Write server software
103 \item Connect them up
108 \begin{frame
}[fragile
]
109 \frametitle{Task Oriented Programming
}
110 \framesubtitle{\ldots and iTasks
}
111 \begin{block
}{iTasks
}
112 \begin{itemize
}[<+->
]
114 \item Generated web interface
120 \column{.49\linewidth}
122 \begin{itemize
}[<+->
]
124 \item Given the state, a
\CI{TaskValue
} is observed.
125 \item Continuous execution
130 \column{.49\linewidth}
133 \includegraphics[width=
\linewidth]{fig-taskvalue
}
134 \caption{The states of a
\CI{TaskValue
}}
139 \begin{frame
}[fragile
]
140 \frametitle{Task Oriented Programming
}
141 \framesubtitle{Example
}
143 :: Name =
{ firstname :: String, lastname :: String
}
144 derive class iTask Name
146 enterInformation :: String
[EnterOption m
] -> Task m | iTask m
147 enterName :: Task Name
148 enterName = enterInformation "Enter your name"
[]
153 \begin{subfigure
}{.30\textwidth}
155 \includegraphics[width=
.9\linewidth]{taskex1
}
156 \caption{Initial interface\\~
}\label{fig:taskex1
}
158 \begin{subfigure
}{.30\textwidth}
160 \includegraphics[width=
.9\linewidth]{taskex2
}
161 \caption{Incomplete entrance
}\label{fig:taskex2
}
163 \begin{subfigure
}{.30\textwidth}
165 \includegraphics[width=
.9\linewidth]{taskex3
}
166 \caption{Complete entry\\~
}\label{fig:taskex3
}
168 \caption{Example of a generated user interface
}
172 \begin{frame
}[fragile
]
173 \frametitle{Task Oriented Programming (
3)
}
174 \framesubtitle{Combinators
}
175 \begin{block
}{Sequence
}
177 (>>=) infixl
1 :: (Task a) (a -> Task b) -> Task b | iTask a & iTask b
178 (>>*) infixl
1 :: (Task a)
[TaskCont a (Task b)
] -> Task b | iTask a & iTask b
180 = OnValue ((TaskValue a) -> Maybe b)
181 | OnAction Action ((TaskValue a) -> Maybe b)
182 | E.e: OnException (e -> b) & iTask e
183 | OnAllExceptions (String -> b)
184 :: Action = Action String
188 \begin{block
}{Parallel
}
190 (-||-) infixr
3 :: (Task a) (Task a) -> Task a | iTask a
191 ( ||-) infixr
3 :: (Task a) (Task b) -> Task b | iTask a & iTask b
192 (-|| ) infixl
3 :: (Task a) (Task b) -> Task a | iTask a & iTask b
193 (-&&-) infixr
4 :: (Task a) (Task b) -> Task (a,b) | iTask a & iTask b
198 \begin{frame
}[fragile
]
199 \frametitle{Shared Data Sources (SDS)
}
200 \begin{block
}{What is an SDS
}
201 \begin{itemize
}[<+->
]
208 :: RWShared p r w = ...
209 :: ReadWriteShared r w :== RWShared () r w
210 :: Shared r :== ReadWriteShared r r
212 get :: (ReadWriteShared r w) -> Task r | iTask r
213 set :: w (ReadWriteShared r w) -> Task w | iTask w
214 upd :: (r -> w) (ReadWriteShared r w) -> Task w | iTask r & iTask w
216 sharedStore :: String a -> Shared a | JSONEncode
{|*|
}, JSONDecode
{|*|
}
218 wait :: String (r -> Bool) (ReadWriteShared r w) -> Task r
222 \begin{frame
}[fragile
]
224 \framesubtitle{Parametric Lenses
}
225 \begin{block
}{What is the
\CI{p
} for in
\CI{RWShared p r w
}}
228 \item Parameter fixed when writing
229 \item Used for notifications
234 sdsFocus :: p1 (RWShared p1 r w) -> RWShared p2 r w | iTask p
236 :: SDSNotifyPred p :== p -> Bool
237 :: SDSLensRead p r rs = SDSRead (p -> rs -> MaybeError TaskException r)
238 | SDSReadConst (p -> r)
239 :: SDSLensWrite p w rs ws = SDSWrite (p -> rs -> w -> MaybeError TaskException (Maybe ws))
240 | SDSWriteConst (p -> w -> MaybeError TaskException (Maybe ws))
241 :: SDSLensNotify p w rs = SDSNotify (p -> rs -> w -> SDSNotifyPred p)
242 | SDSNotifyConst (p -> w -> SDSNotifyPred p)
244 sdsLens :: String (p -> ps) (SDSLensRead p r rs) (SDSLensWrite p w rs ws)
245 (SDSLensNotify p w rs) (RWShared ps rs ws) -> RWShared p r w | iTask ps
250 \frametitle{Why add IoT devices to iTasks
}
261 \begin{block
}{Current possibilities
}
263 \item Implement a device as an SDS
265 \item Tailor made SDS for every task
266 \item Difficult to get logic in
268 \item Arjan's Distributed iTasks
270 \item Requires fast hardware
277 \frametitle{Solution
}
279 \begin{block
}{EDSL to the rescue
}