equal
deleted
inserted
replaced
15 * You should have received a copy of the GNU General Public License |
15 * You should have received a copy of the GNU General Public License |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 */ |
17 */ |
18 #pragma once |
18 #pragma once |
19 |
19 |
|
20 #include <vector> |
|
21 #include <array> |
|
22 #include <ctype.h> |
|
23 |
20 #include <QObject> |
24 #include <QObject> |
|
25 #include <QLocalServer> |
|
26 #include <QLocalSocket> |
21 |
27 |
22 #include "MotionEvent.h" |
28 #include "MotionEvent.h" |
23 #include "ButtonEvent.h" |
29 #include "ButtonEvent.h" |
24 |
30 |
25 class SimulatorSocketServer : public QObject { |
31 class SimulatorSocketServer : public QObject { |
30 virtual ~SimulatorSocketServer(); |
36 virtual ~SimulatorSocketServer(); |
31 public slots: |
37 public slots: |
32 void publishMotionEvent(const MotionEvent e); |
38 void publishMotionEvent(const MotionEvent e); |
33 void publishButtonEvent(const ButtonEvent e); |
39 void publishButtonEvent(const ButtonEvent e); |
34 private: |
40 private: |
35 |
41 QLocalServer* server = new QLocalServer(this); |
|
42 std::vector<QLocalSocket*> connections; |
|
43 void publish(const std::array<int32_t, 8> &data); |
36 }; |
44 }; |