| // Copyright 2024 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| #include "libhoth_usb.hpp" |
| |
| #include <stdexcept> |
| |
| // NOLINTNEXTLINE(cert-dcl58-cpp) |
| namespace google |
| { |
| namespace hoth |
| { |
| int LibHothUsbImpl::open(const option* opt, device** dev) |
| { |
| return ::libhoth_usb_open(opt, dev); |
| } |
| |
| int LibHothUsbImpl::send(device* dev, const void* request, size_t size) |
| { |
| return ::libhoth_send_request(dev, request, size); |
| } |
| |
| int LibHothUsbImpl::recv(device* dev, void* response, size_t response_size, |
| size_t* actual_size, int timeout_ms) |
| { |
| return ::libhoth_usb_receive_response(dev, response, response_size, |
| actual_size, timeout_ms); |
| } |
| |
| int LibHothUsbImpl::close(device* dev) |
| { |
| return ::libhoth_usb_close(dev); |
| } |
| |
| int LibHothUsbImpl::claim(device* dev) |
| { |
| return dev->claim(dev); |
| } |
| |
| int LibHothUsbImpl::release(device* dev) |
| { |
| return dev->release(dev); |
| } |
| |
| LibHothUsbImpl libhoth_usb; |
| } // namespace hoth |
| |
| } // namespace google |