MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / Open

Method Open

cpp/src/platform/HidController.cpp:134–159  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Open and configure a HID port -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

132// Open and configure a HID port
133//-----------------------------------------------------------------------------
134bool 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>

Callers 1

InitMethod · 0.45

Calls 1

StartMethod · 0.45

Tested by

no test coverage detected