|
Last change
on this file since 48 was 22, checked in by phudelai, 12 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 |
|
|---|
| 22 | using namespace pacpus;
|
|---|
| 23 | using std::string;
|
|---|
| 24 |
|
|---|
| 25 | DECLARE_STATIC_LOGGER("pacpus.base.dualshock");
|
|---|
| 26 |
|
|---|
| 27 | static ComponentFactory<Dualshock> sFactory("Dualshock");
|
|---|
| 28 |
|
|---|
| 29 | Dualshock::Dualshock(QString name)
|
|---|
| 30 | : ComponentBase(name)
|
|---|
| 31 | {
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 | Dualshock::~Dualshock()
|
|---|
| 35 | {
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | void 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 |
|
|---|
| 50 | void Dualshock::stopActivity()
|
|---|
| 51 | {
|
|---|
| 52 | d->stop();
|
|---|
| 53 | std::cerr << "Thread dualshock stopped\n";
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|
| 56 | ComponentBase::COMPONENT_CONFIGURATION Dualshock::configureComponent(XmlComponentConfig config)
|
|---|
| 57 | {
|
|---|
| 58 | return ComponentBase::CONFIGURED_OK;
|
|---|
| 59 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.