source: pacpussensors/trunk/Dualshock/dualshock.cpp@ 132

Last change on this file since 132 was 22, checked in by phudelai, 11 years ago

New control mode added + Security with the controller

File size: 1.3 KB
Line 
1/*********************************************************************
2// created: 2012/03/01 - 14:06
3// filename: dualshock.cpp
4//
5// author: Pierre Hudelaine
6// Copyright Heudiasyc UMR UTC/CNRS 7253
7//
8// version: $Id: $
9//
10// purpose: Read the dualshock 3 button using bluetooth
11//
12*********************************************************************/
13
14#include "dualshock.h"
15
16#include "kernel/cstdint.h"
17#include "kernel/ComponentFactory.h"
18#include "kernel/ComponentManager.h"
19#include "kernel/DbiteFileTypes.h"
20#include "kernel/Log.h"
21
22using namespace pacpus;
23using std::string;
24
25DECLARE_STATIC_LOGGER("pacpus.base.dualshock");
26
27static ComponentFactory<Dualshock> sFactory("Dualshock");
28
29Dualshock::Dualshock(QString name)
30 : ComponentBase(name)
31{
32}
33
34Dualshock::~Dualshock()
35{
36}
37
38void Dualshock::startActivity()
39{
40 try {
41 d = new(DualshockAPI);
42 d->start();
43 }
44 catch(char const* str) {
45 std::cerr << "ERROR: " << str << std::endl;
46 }
47 std::cerr << "Thread dualshock started\n";
48}
49
50void Dualshock::stopActivity()
51{
52 d->stop();
53 std::cerr << "Thread dualshock stopped\n";
54}
55
56ComponentBase::COMPONENT_CONFIGURATION Dualshock::configureComponent(XmlComponentConfig config)
57{
58 return ComponentBase::CONFIGURED_OK;
59}
Note: See TracBrowser for help on using the repository browser.