Last change
on this file since 21 was 21, checked in by phudelai, 11 years ago |
New component for the wifibot and the dualshock 3
|
File size:
910 bytes
|
Rev | Line | |
---|
[21] | 1 | #include "dualshock.h"
|
---|
| 2 |
|
---|
| 3 | #include "kernel/cstdint.h"
|
---|
| 4 | #include "kernel/ComponentFactory.h"
|
---|
| 5 | #include "kernel/ComponentManager.h"
|
---|
| 6 | #include "kernel/DbiteFileTypes.h"
|
---|
| 7 | #include "kernel/Log.h"
|
---|
| 8 |
|
---|
| 9 | using namespace pacpus;
|
---|
| 10 | using std::string;
|
---|
| 11 |
|
---|
| 12 | DECLARE_STATIC_LOGGER("pacpus.base.dualshock");
|
---|
| 13 |
|
---|
| 14 | static ComponentFactory<Dualshock> sFactory("Dualshock");
|
---|
| 15 |
|
---|
| 16 | Dualshock::Dualshock(QString name)
|
---|
| 17 | : ComponentBase(name)
|
---|
| 18 | {
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | Dualshock::~Dualshock()
|
---|
| 22 | {
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | void Dualshock::startActivity()
|
---|
| 26 | {
|
---|
| 27 | try {
|
---|
| 28 | d = new(DualshockAPI);
|
---|
| 29 | d->start();
|
---|
| 30 | }
|
---|
| 31 | catch(char const* str) {
|
---|
| 32 | std::cerr << "ERROR: " << str << std::endl;
|
---|
| 33 | }
|
---|
| 34 | std::cerr << "Thread dualshock started\n";
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | void Dualshock::stopActivity()
|
---|
| 38 | {
|
---|
| 39 | d->stop();
|
---|
| 40 | std::cerr << "Thread dualshock stopped\n";
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | ComponentBase::COMPONENT_CONFIGURATION Dualshock::configureComponent(XmlComponentConfig config)
|
---|
| 44 | {
|
---|
| 45 | return ComponentBase::CONFIGURED_OK;
|
---|
| 46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.