Skip to content

Commit

Permalink
Added an "isConnected" condition to the HardwareDetection function.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachkinstner committed Oct 6, 2015
1 parent b7c3bb1 commit d15b884
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions HardwareDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ HardwareDetection::HardwareDetection() : mFound(false) {

/*----------------------------------------------------------------------------------------------------*/
OSVR_ReturnCode HardwareDetection::operator()(OSVR_PluginRegContext pContext) {
Leap::Controller controller;

if ( !controller.isConnected() ) {
mFound = false;
return OSVR_RETURN_FAILURE;
}

if ( !mFound ) {
mFound = true;
osvr::pluginkit::registerObjectForDeletion(pContext, new ControllerDevice(pContext));
Expand Down

1 comment on commit d15b884

@zachkinstner
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See issue #13.

Please sign in to comment.