#ifndef EXTENSIONS_COMMON_API_USB_H__
#define EXTENSIONS_COMMON_API_USB_H__
#include <stdint.h>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/values.h"
#include <string_view>
namespace extensions {
namespace api {
namespace usb {
enum class Direction { … };
const char* ToString(Direction as_enum);
Direction ParseDirection(std::string_view as_string);
std::u16string GetDirectionParseError(std::string_view as_string);
enum class Recipient { … };
const char* ToString(Recipient as_enum);
Recipient ParseRecipient(std::string_view as_string);
std::u16string GetRecipientParseError(std::string_view as_string);
enum class RequestType { … };
const char* ToString(RequestType as_enum);
RequestType ParseRequestType(std::string_view as_string);
std::u16string GetRequestTypeParseError(std::string_view as_string);
enum class TransferType { … };
const char* ToString(TransferType as_enum);
TransferType ParseTransferType(std::string_view as_string);
std::u16string GetTransferTypeParseError(std::string_view as_string);
enum class SynchronizationType { … };
const char* ToString(SynchronizationType as_enum);
SynchronizationType ParseSynchronizationType(std::string_view as_string);
std::u16string GetSynchronizationTypeParseError(std::string_view as_string);
enum class UsageType { … };
const char* ToString(UsageType as_enum);
UsageType ParseUsageType(std::string_view as_string);
std::u16string GetUsageTypeParseError(std::string_view as_string);
struct Device { … };
struct ConnectionHandle { … };
struct EndpointDescriptor { … };
struct InterfaceDescriptor { … };
struct ConfigDescriptor { … };
struct ControlTransferInfo { … };
struct GenericTransferInfo { … };
struct IsochronousTransferInfo { … };
struct TransferResultInfo { … };
struct DeviceFilter { … };
struct EnumerateDevicesOptions { … };
struct EnumerateDevicesAndRequestAccessOptions { … };
struct DevicePromptOptions { … };
namespace GetDevices {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<Device>& devices);
}
}
namespace GetUserSelectedDevices {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<Device>& devices);
}
}
namespace GetConfigurations {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<ConfigDescriptor>& configs);
}
}
namespace RequestAccess {
struct Params { … };
namespace Results {
base::Value::List Create(bool success);
}
}
namespace OpenDevice {
struct Params { … };
namespace Results {
base::Value::List Create(const ConnectionHandle& handle);
}
}
namespace FindDevices {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<ConnectionHandle>& handles);
}
}
namespace CloseDevice {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace SetConfiguration {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace GetConfiguration {
struct Params { … };
namespace Results {
base::Value::List Create(const ConfigDescriptor& config);
}
}
namespace ListInterfaces {
struct Params { … };
namespace Results {
base::Value::List Create(const std::vector<InterfaceDescriptor>& descriptors);
}
}
namespace ClaimInterface {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace ReleaseInterface {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace SetInterfaceAlternateSetting {
struct Params { … };
namespace Results {
base::Value::List Create();
}
}
namespace ControlTransfer {
struct Params { … };
namespace Results {
base::Value::List Create(const TransferResultInfo& info);
}
}
namespace BulkTransfer {
struct Params { … };
namespace Results {
base::Value::List Create(const TransferResultInfo& info);
}
}
namespace InterruptTransfer {
struct Params { … };
namespace Results {
base::Value::List Create(const TransferResultInfo& info);
}
}
namespace IsochronousTransfer {
struct Params { … };
namespace Results {
base::Value::List Create(const TransferResultInfo& info);
}
}
namespace ResetDevice {
struct Params { … };
namespace Results {
base::Value::List Create(bool success);
}
}
namespace OnDeviceAdded {
extern const char kEventName[];
base::Value::List Create(const Device& device);
}
namespace OnDeviceRemoved {
extern const char kEventName[];
base::Value::List Create(const Device& device);
}
}
}
}
#endif