MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / resetDevice

Method resetDevice

source/MRViewer/MRSpaceMouseHandlerHidapi.cpp:226–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void HandlerHidapi::AtomicDevice::resetDevice( VendorId vId, ProductId pId )
227{
228 std::unique_lock lock( mutex_ );
229 bool clear = vId == 0 && pId == 0;
230 if ( clear )
231 {
232 if ( device_ )
233 {
234 device_->resetDevice();
235 device_.reset();
236 }
237 return;
238 }
239 if ( !device_ )
240 device_ = std::make_unique<Device>();
241 device_->resetDevice(); // as far as we now only support single device with HID API we reset old one
242 device_->updateDevice( vId, pId );
243}
244
245void HandlerHidapi::AtomicDevice::parseRaw( const DataPacketRaw& packet, int packet_length, Action& action ) const
246{

Callers 2

findAndAttachDevice_Method · 0.45
initListenerThread_Method · 0.45

Calls 2

updateDeviceMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected