----------------------------------------------------------------------------- Open and configure a HID port -----------------------------------------------------------------------------
| 132 | // Open and configure a HID port |
| 133 | //----------------------------------------------------------------------------- |
| 134 | bool HidController::Open |
| 135 | ( |
| 136 | string const& _hidControllerName |
| 137 | ) |
| 138 | { |
| 139 | if( m_bOpen ) |
| 140 | { |
| 141 | return false; |
| 142 | } |
| 143 | |
| 144 | m_hidControllerName = _hidControllerName; |
| 145 | |
| 146 | // Try to init the serial port |
| 147 | if( !Init( 1 ) ) |
| 148 | { |
| 149 | // Failed. We bail to allow the app a chance to take over, rather than retry |
| 150 | // automatically. Automatic retries only occur after a successful init. |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | m_thread = new Thread( "HidController" ); |
| 155 | |
| 156 | // Start the read thread |
| 157 | m_thread->Start( ThreadEntryPoint, this ); |
| 158 | return true; |
| 159 | } |
| 160 | |
| 161 | //----------------------------------------------------------------------------- |
| 162 | // <HidController::Close> |