source: pacpussensors/trunk/Wifibot/ps3remote.h@ 99

Last change on this file since 99 was 99, checked in by nguyenhu, 9 years ago

compilation under linux with 0.2.X framework

File size: 1.2 KB
Line 
1/*********************************************************************
2// created: 2012/03/01 - 14:06
3// filename: PS3remote.h
4//
5// author: Pierre Hudelaine
6// Copyright Heudiasyc UMR UTC/CNRS 7253
7//
8// version: $Id: $
9//
10// purpose: Read the dualshock 3 buttons using bluetooth
11//
12*********************************************************************/
13
14#ifndef PS3_REMOTE_H
15# define PS3_REMOTE_H
16
17# include <QApplication>
18# include <QThread>
19# include <QTimer>
20# include <QMutex>
21
22# include "../Dualshock/controller.h"
23# include "../PacpusSocket/PacpusUDPSocket.h"
24
25namespace pacpus {
26
27 class PS3remote: public QThread {
28 Q_OBJECT
29
30 public:
31 PS3remote();
32 PS3remote(PacpusUDPSocket *socket);
33 ~PS3remote();
34 void run();
35 void stop();
36 void setCmd(uint16_t Ls, uint16_t Rs, int leftF, int rightF);
37 void sendCmd();
38 void modePS3();
39 void modeChar();
40 void modeJoystick();
41 void checkMode();
42
43 private:
44 ShMem *shmem;
45 struct dualshockButtons_s * b;
46 QMutex mutex;
47 int quit;
48 PacpusUDPSocket * socket_;
49 QTimer * timer_;
50 char buf[4];
51
52 public Q_SLOTS:
53 void wifibotRemanentSending();
54 };
55
56};
57
58#endif
Note: See TracBrowser for help on using the repository browser.