-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestRC.cpp
More file actions
34 lines (29 loc) · 755 Bytes
/
Copy pathTestRC.cpp
File metadata and controls
34 lines (29 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* TestRC.cpp
*
* Created on: 29 juin 2017
* Author: horfee
*/
#include "RCReceiverTransmitter.h"
#include "Utils.h"
#include <syslog.h>
#include <thread>
class RCListener: public RCMessageListener {
public:
virtual void onSignalReceived(int message) {
logMessage(LOG_INFO, "Message received : %d", message);
}
};
int main1(int argc, char* argv[]) {
setlogmask (LOG_UPTO (LOG_DEBUG));
openlog (argv[0], LOG_CONS | LOG_PERROR | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
if ( wiringPiSetup() == -1 ) {
logMessage(LOG_ERR, "Unable to initialize wiringpi");
exit(1);
}
RCReceiverTransmitter rcModule(4, 5);
rcModule.addListener(new RCListener());
rcModule.start();
std::this_thread::sleep_for(std::chrono::minutes(5));
return 0;
}