diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-03 22:23:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-04 12:19:26 +0100 |
commit | b256886a5cb9f2ae3ebda70a2045b19ed9f4233e (patch) | |
tree | 4fa1e46de224cf834a05824dc1eb86001bdb3300 /proto-vjoystick/vjoystick.cpp | |
parent | e89709a801e7874bc02c66848c638c6a0ccc85c1 (diff) |
api: add status check for modules
Diffstat (limited to 'proto-vjoystick/vjoystick.cpp')
-rw-r--r-- | proto-vjoystick/vjoystick.cpp | 15 |
1 files changed, 15 insertions, 0 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) |