| 224 | } |
| 225 | |
| 226 | void 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 | |
| 245 | void HandlerHidapi::AtomicDevice::parseRaw( const DataPacketRaw& packet, int packet_length, Action& action ) const |
| 246 | { |
no test coverage detected