| 155 | | << "[p5glove] P5Glove is active.\n" << vprDEBUG_FLUSH; |
|---|
| 156 | | } |
|---|
| 157 | | catch (vpr::Exception& ex) |
|---|
| 158 | | { |
|---|
| 159 | | vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL) |
|---|
| 160 | | << clrOutBOLD(clrRED, "ERROR") |
|---|
| 161 | | << ": Failed to spawn thread for P5 Glove driver!\n" |
|---|
| 162 | | << vprDEBUG_FLUSH; |
|---|
| 163 | | vprDEBUG_NEXT(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL) |
|---|
| 164 | | << ex.what() << std::endl << vprDEBUG_FLUSH; |
|---|
| 165 | | started = false; |
|---|
| | 141 | << "[p5glove] Successfully connected, Now sampling dataglove " |
|---|
| | 142 | << "data.\n" << vprDEBUG_FLUSH; |
|---|
| | 143 | |
|---|
| | 144 | // Create a new thread to handle the control and set exit flag to |
|---|
| | 145 | // false. |
|---|
| | 146 | mExitFlag = false; |
|---|
| | 147 | vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL) |
|---|
| | 148 | << "[p5glove] Spawning control thread.\n" << vprDEBUG_FLUSH; |
|---|
| | 149 | |
|---|
| | 150 | try |
|---|
| | 151 | { |
|---|
| | 152 | mThread = |
|---|
| | 153 | new vpr::Thread(boost::bind(&P5GloveWrapper::controlLoop, |
|---|
| | 154 | this)); |
|---|
| | 155 | mActive = true; |
|---|
| | 156 | started = true; |
|---|
| | 157 | |
|---|
| | 158 | vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL) |
|---|
| | 159 | << "[p5glove] P5Glove is active.\n" << vprDEBUG_FLUSH; |
|---|
| | 160 | } |
|---|
| | 161 | catch (vpr::Exception& ex) |
|---|
| | 162 | { |
|---|
| | 163 | vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL) |
|---|
| | 164 | << clrOutBOLD(clrRED, "ERROR") |
|---|
| | 165 | << ": Failed to spawn thread for P5 Glove driver!\n" |
|---|
| | 166 | << vprDEBUG_FLUSH; |
|---|
| | 167 | vprDEBUG_NEXT(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL) |
|---|
| | 168 | << ex.what() << std::endl << vprDEBUG_FLUSH; |
|---|
| | 169 | started = false; |
|---|
| | 170 | } |
|---|