chromium/out/Default/gen/extensions/common/api/serial.h

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// GENERATED FROM THE API DEFINITION IN
//   extensions/common/api/serial.idl
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef EXTENSIONS_COMMON_API_SERIAL_H__
#define EXTENSIONS_COMMON_API_SERIAL_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 serial {

//
// Types
//

struct DeviceInfo {};

enum class DataBits {};


const char* ToString(DataBits as_enum);
DataBits ParseDataBits(std::string_view as_string);
std::u16string GetDataBitsParseError(std::string_view as_string);

enum class ParityBit {};


const char* ToString(ParityBit as_enum);
ParityBit ParseParityBit(std::string_view as_string);
std::u16string GetParityBitParseError(std::string_view as_string);

enum class StopBits {};


const char* ToString(StopBits as_enum);
StopBits ParseStopBits(std::string_view as_string);
std::u16string GetStopBitsParseError(std::string_view as_string);

struct ConnectionOptions {};

struct ConnectionInfo {};

enum class SendError {};


const char* ToString(SendError as_enum);
SendError ParseSendError(std::string_view as_string);
std::u16string GetSendErrorParseError(std::string_view as_string);

struct SendInfo {};

struct HostControlSignals {};

struct DeviceControlSignals {};

struct ReceiveInfo {};

enum class ReceiveError {};


const char* ToString(ReceiveError as_enum);
ReceiveError ParseReceiveError(std::string_view as_string);
std::u16string GetReceiveErrorParseError(std::string_view as_string);

struct ReceiveErrorInfo {};


//
// Functions
//

namespace GetDevices {

namespace Results {

base::Value::List Create(const std::vector<DeviceInfo>& ports);
}  // namespace Results

}  // namespace GetDevices

namespace Connect {

struct Params {};

namespace Results {

base::Value::List Create(const ConnectionInfo& connection_info);
}  // namespace Results

}  // namespace Connect

namespace Update {

struct Params {};

namespace Results {

base::Value::List Create(bool result);
}  // namespace Results

}  // namespace Update

namespace Disconnect {

struct Params {};

namespace Results {

base::Value::List Create(bool result);
}  // namespace Results

}  // namespace Disconnect

namespace SetPaused {

struct Params {};

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace SetPaused

namespace GetInfo {

struct Params {};

namespace Results {

base::Value::List Create(const ConnectionInfo& connection_info);
}  // namespace Results

}  // namespace GetInfo

namespace GetConnections {

namespace Results {

base::Value::List Create(const std::vector<ConnectionInfo>& connection_infos);
}  // namespace Results

}  // namespace GetConnections

namespace Send {

struct Params {};

namespace Results {

base::Value::List Create(const SendInfo& send_info);
}  // namespace Results

}  // namespace Send

namespace Flush {

struct Params {};

namespace Results {

base::Value::List Create(bool result);
}  // namespace Results

}  // namespace Flush

namespace GetControlSignals {

struct Params {};

namespace Results {

base::Value::List Create(const DeviceControlSignals& signals);
}  // namespace Results

}  // namespace GetControlSignals

namespace SetControlSignals {

struct Params {};

namespace Results {

base::Value::List Create(bool result);
}  // namespace Results

}  // namespace SetControlSignals

namespace SetBreak {

struct Params {};

namespace Results {

base::Value::List Create(bool result);
}  // namespace Results

}  // namespace SetBreak

namespace ClearBreak {

struct Params {};

namespace Results {

base::Value::List Create(bool result);
}  // namespace Results

}  // namespace ClearBreak

//
// Events
//

namespace OnReceive {

extern const char kEventName[];  // "serial.onReceive"

// Event data.
base::Value::List Create(const ReceiveInfo& info);
}  // namespace OnReceive

namespace OnReceiveError {

extern const char kEventName[];  // "serial.onReceiveError"

base::Value::List Create(const ReceiveErrorInfo& info);
}  // namespace OnReceiveError

}  // namespace serial
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_SERIAL_H__