File tree 1 file changed +40
-0
lines changed
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ This file is part of the ArduinoIoTCloud library.
3
+
4
+ Copyright (c) 2024 Arduino SA
5
+
6
+ This Source Code Form is subject to the terms of the Mozilla Public
7
+ License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+ */
10
+
11
+ #pragma once
12
+
13
+ /* *****************************************************************************
14
+ * INCLUDE
15
+ ******************************************************************************/
16
+
17
+ #include < message/Commands.h>
18
+ #include < functional>
19
+
20
+ using upstreamFunction = std::function<void (Message*)>;
21
+
22
+ /* *****************************************************************************
23
+ * CLASS DECLARATION
24
+ ******************************************************************************/
25
+
26
+ class MessageStream {
27
+ public:
28
+ MessageStream (upstreamFunction upstream): upstream(upstream) {}
29
+
30
+ /* *
31
+ * Send message upstream
32
+ * @param m: message to send
33
+ */
34
+ virtual inline void sendUpstream (Message* m) {
35
+ upstream (m);
36
+ }
37
+
38
+ private:
39
+ upstreamFunction upstream;
40
+ };
You can’t perform that action at this time.
0 commit comments