chromium/out/Default/gen/extensions/common/api/bluetooth_low_energy.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/bluetooth_low_energy.idl
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef EXTENSIONS_COMMON_API_BLUETOOTH_LOW_ENERGY_H__
#define EXTENSIONS_COMMON_API_BLUETOOTH_LOW_ENERGY_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 bluetooth_low_energy {

//
// Types
//

// Values representing the possible properties of a characteristic.
// Characteristic permissions are inferred from these properties. Please see the
// Bluetooth 4.x spec to see the meaning of each individual property.
enum class CharacteristicProperty {};


const char* ToString(CharacteristicProperty as_enum);
CharacteristicProperty ParseCharacteristicProperty(std::string_view as_string);
std::u16string GetCharacteristicPropertyParseError(std::string_view as_string);

// Values representing possible permissions for a descriptor. Please see the
// Bluetooth 4.x spec to see the meaning of each individual permission.
enum class DescriptorPermission {};


const char* ToString(DescriptorPermission as_enum);
DescriptorPermission ParseDescriptorPermission(std::string_view as_string);
std::u16string GetDescriptorPermissionParseError(std::string_view as_string);

// Type of advertisement. If 'broadcast' is chosen, the sent advertisement type
// will be ADV_NONCONN_IND and the device will broadcast with a random MAC
// Address. If set to 'peripheral', the advertisement type will be ADV_IND or
// ADV_SCAN_IND and the device will broadcast with real Bluetooth Adapter's MAC
// Address.
enum class AdvertisementType {};


const char* ToString(AdvertisementType as_enum);
AdvertisementType ParseAdvertisementType(std::string_view as_string);
std::u16string GetAdvertisementTypeParseError(std::string_view as_string);

struct Device {};

struct Service {};

struct Characteristic {};

struct Descriptor {};

struct ConnectProperties {};

struct NotificationProperties {};

struct ManufacturerData {};

struct ServiceData {};

struct Advertisement {};

struct Request {};

struct Response {};

struct Notification {};


//
// Functions
//

namespace Connect {

struct Params {};

namespace Results {

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

}  // namespace Connect

namespace Disconnect {

struct Params {};

namespace Results {

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

}  // namespace Disconnect

namespace GetService {

struct Params {};

namespace Results {

base::Value::List Create(const Service& result);
}  // namespace Results

}  // namespace GetService

namespace CreateService {

struct Params {};

namespace Results {

base::Value::List Create(const std::string& service_id);
}  // namespace Results

}  // namespace CreateService

namespace GetServices {

struct Params {};

namespace Results {

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

}  // namespace GetServices

namespace GetCharacteristic {

struct Params {};

namespace Results {

base::Value::List Create(const Characteristic& result);
}  // namespace Results

}  // namespace GetCharacteristic

namespace CreateCharacteristic {

struct Params {};

namespace Results {

base::Value::List Create(const std::string& characteristic_id);
}  // namespace Results

}  // namespace CreateCharacteristic

namespace GetCharacteristics {

struct Params {};

namespace Results {

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

}  // namespace GetCharacteristics

namespace GetIncludedServices {

struct Params {};

namespace Results {

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

}  // namespace GetIncludedServices

namespace GetDescriptor {

struct Params {};

namespace Results {

base::Value::List Create(const Descriptor& result);
}  // namespace Results

}  // namespace GetDescriptor

namespace CreateDescriptor {

struct Params {};

namespace Results {

base::Value::List Create(const std::string& descriptor_id);
}  // namespace Results

}  // namespace CreateDescriptor

namespace GetDescriptors {

struct Params {};

namespace Results {

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

}  // namespace GetDescriptors

namespace ReadCharacteristicValue {

struct Params {};

namespace Results {

base::Value::List Create(const Characteristic& result);
}  // namespace Results

}  // namespace ReadCharacteristicValue

namespace WriteCharacteristicValue {

struct Params {};

namespace Results {

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

}  // namespace WriteCharacteristicValue

namespace StartCharacteristicNotifications {

struct Params {};

namespace Results {

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

}  // namespace StartCharacteristicNotifications

namespace StopCharacteristicNotifications {

struct Params {};

namespace Results {

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

}  // namespace StopCharacteristicNotifications

namespace NotifyCharacteristicValueChanged {

struct Params {};

namespace Results {

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

}  // namespace NotifyCharacteristicValueChanged

namespace ReadDescriptorValue {

struct Params {};

namespace Results {

base::Value::List Create(const Descriptor& result);
}  // namespace Results

}  // namespace ReadDescriptorValue

namespace WriteDescriptorValue {

struct Params {};

namespace Results {

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

}  // namespace WriteDescriptorValue

namespace RegisterService {

struct Params {};

namespace Results {

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

}  // namespace RegisterService

namespace UnregisterService {

struct Params {};

namespace Results {

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

}  // namespace UnregisterService

namespace RemoveService {

struct Params {};

namespace Results {

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

}  // namespace RemoveService

namespace RegisterAdvertisement {

struct Params {};

namespace Results {

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

}  // namespace RegisterAdvertisement

namespace UnregisterAdvertisement {

struct Params {};

namespace Results {

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

}  // namespace UnregisterAdvertisement

namespace ResetAdvertising {

namespace Results {

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

}  // namespace ResetAdvertising

namespace SetAdvertisingInterval {

struct Params {};

namespace Results {

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

}  // namespace SetAdvertisingInterval

namespace SendRequestResponse {

struct Params {};

}  // namespace SendRequestResponse

//
// Events
//

namespace OnServiceAdded {

extern const char kEventName[];  // "bluetoothLowEnergy.onServiceAdded"

// The GATT service that was added.
base::Value::List Create(const Service& service);
}  // namespace OnServiceAdded

namespace OnServiceChanged {

extern const char kEventName[];  // "bluetoothLowEnergy.onServiceChanged"

// The GATT service whose state has changed.
base::Value::List Create(const Service& service);
}  // namespace OnServiceChanged

namespace OnServiceRemoved {

extern const char kEventName[];  // "bluetoothLowEnergy.onServiceRemoved"

// The GATT service that was removed.
base::Value::List Create(const Service& service);
}  // namespace OnServiceRemoved

namespace OnCharacteristicValueChanged {

extern const char kEventName[];  // "bluetoothLowEnergy.onCharacteristicValueChanged"

// The GATT characteristic whose value has changed.
base::Value::List Create(const Characteristic& characteristic);
}  // namespace OnCharacteristicValueChanged

namespace OnDescriptorValueChanged {

extern const char kEventName[];  // "bluetoothLowEnergy.onDescriptorValueChanged"

// The GATT characteristic descriptor whose value has changed.
base::Value::List Create(const Descriptor& descriptor);
}  // namespace OnDescriptorValueChanged

namespace OnCharacteristicReadRequest {

extern const char kEventName[];  // "bluetoothLowEnergy.onCharacteristicReadRequest"

// Request data for this request.
base::Value::List Create(const Request& request, const std::string& characteristic_id);
}  // namespace OnCharacteristicReadRequest

namespace OnCharacteristicWriteRequest {

extern const char kEventName[];  // "bluetoothLowEnergy.onCharacteristicWriteRequest"

// Request data for this request.
base::Value::List Create(const Request& request, const std::string& characteristic_id);
}  // namespace OnCharacteristicWriteRequest

namespace OnDescriptorReadRequest {

extern const char kEventName[];  // "bluetoothLowEnergy.onDescriptorReadRequest"

// Request data for this request.
base::Value::List Create(const Request& request, const std::string& descriptor_id);
}  // namespace OnDescriptorReadRequest

namespace OnDescriptorWriteRequest {

extern const char kEventName[];  // "bluetoothLowEnergy.onDescriptorWriteRequest"

// Request data for this request.
base::Value::List Create(const Request& request, const std::string& descriptor_id);
}  // namespace OnDescriptorWriteRequest

}  // namespace bluetooth_low_energy
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_BLUETOOTH_LOW_ENERGY_H__