diff options
Diffstat (limited to 'proto-vjoystick')
-rw-r--r-- | proto-vjoystick/vjoystick.cpp | 15 | ||||
-rw-r--r-- | proto-vjoystick/vjoystick.h | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/proto-vjoystick/vjoystick.cpp b/proto-vjoystick/vjoystick.cpp index 557b5e99..9ff64998 100644 --- a/proto-vjoystick/vjoystick.cpp +++ b/proto-vjoystick/vjoystick.cpp @@ -125,6 +125,21 @@ vjoystick_proto::~vjoystick_proto() { } +module_status vjoystick_proto::check_status() +{ + switch (h.get_state()) + { + case state_notent: + return error("vjoystick #1 doesn't exist"); + case state_fail: + return error("can't initialize vjoystick"); + case state_success: + return status_ok(); + default: + return error("unknown error"); + } +} + void vjoystick_proto::pose(const double *pose) { if (h.get_state() != state_success) diff --git a/proto-vjoystick/vjoystick.h b/proto-vjoystick/vjoystick.h index 49302030..0eac2ed2 100644 --- a/proto-vjoystick/vjoystick.h +++ b/proto-vjoystick/vjoystick.h @@ -53,7 +53,7 @@ class vjoystick_proto : public IProtocol public: vjoystick_proto(); ~vjoystick_proto() override; - bool correct() override { return h.get_state() == state_success; } + module_status check_status() override; void pose( const double *headpose ) override; QString game_name() override { return "Virtual joystick"; } private: |