bluetoothemulation

package
v0.158.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bluetoothemulation provides the Chrome DevTools Protocol commands, types, and events for the BluetoothEmulation domain.

This domain allows configuring virtual Bluetooth devices to test the web-bluetooth API.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandEnable                                  = "BluetoothEmulation.enable"
	CommandSetSimulatedCentralState                = "BluetoothEmulation.setSimulatedCentralState"
	CommandDisable                                 = "BluetoothEmulation.disable"
	CommandSimulatePreconnectedPeripheral          = "BluetoothEmulation.simulatePreconnectedPeripheral"
	CommandSimulateAdvertisement                   = "BluetoothEmulation.simulateAdvertisement"
	CommandSimulateGATTOperationResponse           = "BluetoothEmulation.simulateGATTOperationResponse"
	CommandSimulateCharacteristicOperationResponse = "BluetoothEmulation.simulateCharacteristicOperationResponse"
	CommandSimulateDescriptorOperationResponse     = "BluetoothEmulation.simulateDescriptorOperationResponse"
	CommandAddService                              = "BluetoothEmulation.addService"
	CommandRemoveService                           = "BluetoothEmulation.removeService"
	CommandAddCharacteristic                       = "BluetoothEmulation.addCharacteristic"
	CommandRemoveCharacteristic                    = "BluetoothEmulation.removeCharacteristic"
	CommandAddDescriptor                           = "BluetoothEmulation.addDescriptor"
	CommandRemoveDescriptor                        = "BluetoothEmulation.removeDescriptor"
	CommandSimulateGATTDisconnection               = "BluetoothEmulation.simulateGATTDisconnection"
)

Command names.

Variables

AddCharacteristic adds a characteristic with |characteristicUuid| and |properties| to the service represented by |serviceId|.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-addCharacteristic

AddDescriptor adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-addDescriptor

AddService adds a service with |serviceUuid| to the peripheral with |address|.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-addService

View Source
var CharacteristicOperationReceived = cdp.Event[EventCharacteristicOperationReceived]{Method: "BluetoothEmulation.characteristicOperationReceived"}

CharacteristicOperationReceived event for when a characteristic operation of |type| to the characteristic respresented by |characteristicId| happened. |data| and |writeType| is expected to exist when |type| is write.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#event-characteristicOperationReceived

View Source
var DescriptorOperationReceived = cdp.Event[EventDescriptorOperationReceived]{Method: "BluetoothEmulation.descriptorOperationReceived"}

DescriptorOperationReceived event for when a descriptor operation of |type| to the descriptor respresented by |descriptorId| happened. |data| is expected to exist when |type| is write.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#event-descriptorOperationReceived

View Source
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}

Disable disable the BluetoothEmulation domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-disable

Enable enable the BluetoothEmulation domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-enable

View Source
var GattOperationReceived = cdp.Event[EventGattOperationReceived]{Method: "BluetoothEmulation.gattOperationReceived"}

GattOperationReceived event for when a GATT operation of |type| to the peripheral with |address| happened.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#event-gattOperationReceived

RemoveCharacteristic removes the characteristic respresented by |characteristicId| from the simulated central.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-removeCharacteristic

RemoveDescriptor removes the descriptor with |descriptorId| from the simulated central.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-removeDescriptor

RemoveService removes the service respresented by |serviceId| from the simulated central.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-removeService

SetSimulatedCentralState set the state of the simulated central.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-setSimulatedCentralState

SimulateAdvertisement simulates an advertisement packet described in |entry| being received by the central.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-simulateAdvertisement

SimulateCharacteristicOperationResponse simulates the response from the characteristic with |characteristicId| for a characteristic operation of |type|. The |code| value follows the Error Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. The |data| is expected to exist when simulating a successful read operation response.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-simulateCharacteristicOperationResponse

SimulateDescriptorOperationResponse simulates the response from the descriptor with |descriptorId| for a descriptor operation of |type|. The |code| value follows the Error Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. The |data| is expected to exist when simulating a successful read operation response.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-simulateDescriptorOperationResponse

SimulateGATTDisconnection simulates a GATT disconnection from the peripheral with |address|.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-simulateGATTDisconnection

SimulateGATTOperationResponse simulates the response code from the peripheral with |address| for a GATT operation of |type|. The |code| value follows the HCI Error Codes from Bluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-simulateGATTOperationResponse

SimulatePreconnectedPeripheral simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-simulatePreconnectedPeripheral

Functions

This section is empty.

Types

type AddCharacteristicParams

type AddCharacteristicParams struct {
	ServiceID          string                    `json:"serviceId"`
	CharacteristicUUID string                    `json:"characteristicUuid"`
	Properties         *CharacteristicProperties `json:"properties"`
}

AddCharacteristicParams are the parameters of the command BluetoothEmulation.addCharacteristic.

type AddCharacteristicResult added in v0.157.3

type AddCharacteristicResult struct {
	CharacteristicID string `json:"characteristicId,omitempty,omitzero"` // An identifier that uniquely represents this characteristic.
}

AddCharacteristicResult is the result of the command BluetoothEmulation.addCharacteristic.

type AddDescriptorParams

type AddDescriptorParams struct {
	CharacteristicID string `json:"characteristicId"`
	DescriptorUUID   string `json:"descriptorUuid"`
}

AddDescriptorParams are the parameters of the command BluetoothEmulation.addDescriptor.

type AddDescriptorResult added in v0.157.3

type AddDescriptorResult struct {
	DescriptorID string `json:"descriptorId,omitempty,omitzero"` // An identifier that uniquely represents this descriptor.
}

AddDescriptorResult is the result of the command BluetoothEmulation.addDescriptor.

type AddServiceParams

type AddServiceParams struct {
	Address     string `json:"address"`
	ServiceUUID string `json:"serviceUuid"`
}

AddServiceParams are the parameters of the command BluetoothEmulation.addService.

type AddServiceResult added in v0.157.3

type AddServiceResult struct {
	ServiceID string `json:"serviceId,omitempty,omitzero"` // An identifier that uniquely represents this service.
}

AddServiceResult is the result of the command BluetoothEmulation.addService.

type CentralState

type CentralState string

CentralState indicates the various states of Central.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-CentralState

const (
	CentralStateAbsent     CentralState = "absent"
	CentralStatePoweredOff CentralState = "powered-off"
	CentralStatePoweredOn  CentralState = "powered-on"
)

CentralState values.

func (CentralState) String

func (t CentralState) String() string

String returns the CentralState as string value.

type CharacteristicOperationType

type CharacteristicOperationType string

CharacteristicOperationType indicates the various types of characteristic operation.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-CharacteristicOperationType

const (
	CharacteristicOperationTypeRead                         CharacteristicOperationType = "read"
	CharacteristicOperationTypeWrite                        CharacteristicOperationType = "write"
	CharacteristicOperationTypeSubscribeToNotifications     CharacteristicOperationType = "subscribe-to-notifications"
	CharacteristicOperationTypeUnsubscribeFromNotifications CharacteristicOperationType = "unsubscribe-from-notifications"
)

CharacteristicOperationType values.

func (CharacteristicOperationType) String

String returns the CharacteristicOperationType as string value.

type CharacteristicProperties

type CharacteristicProperties struct {
	Broadcast                 bool `json:"broadcast"`
	Read                      bool `json:"read"`
	WriteWithoutResponse      bool `json:"writeWithoutResponse"`
	Write                     bool `json:"write"`
	Notify                    bool `json:"notify"`
	Indicate                  bool `json:"indicate"`
	AuthenticatedSignedWrites bool `json:"authenticatedSignedWrites"`
	ExtendedProperties        bool `json:"extendedProperties"`
}

CharacteristicProperties describes the properties of a characteristic. This follows Bluetooth Core Specification BT 4.2 Vol 3 Part G 3.3.1. Characteristic Properties.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-CharacteristicProperties

type CharacteristicWriteType

type CharacteristicWriteType string

CharacteristicWriteType indicates the various types of characteristic write.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-CharacteristicWriteType

const (
	CharacteristicWriteTypeWriteDefaultDeprecated CharacteristicWriteType = "write-default-deprecated"
	CharacteristicWriteTypeWriteWithResponse      CharacteristicWriteType = "write-with-response"
	CharacteristicWriteTypeWriteWithoutResponse   CharacteristicWriteType = "write-without-response"
)

CharacteristicWriteType values.

func (CharacteristicWriteType) String

func (t CharacteristicWriteType) String() string

String returns the CharacteristicWriteType as string value.

type DescriptorOperationType

type DescriptorOperationType string

DescriptorOperationType indicates the various types of descriptor operation.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-DescriptorOperationType

const (
	DescriptorOperationTypeRead  DescriptorOperationType = "read"
	DescriptorOperationTypeWrite DescriptorOperationType = "write"
)

DescriptorOperationType values.

func (DescriptorOperationType) String

func (t DescriptorOperationType) String() string

String returns the DescriptorOperationType as string value.

type EnableParams

type EnableParams struct {
	State       CentralState `json:"state"`       // State of the simulated central.
	LeSupported bool         `json:"leSupported"` // If the simulated central supports low-energy.
}

EnableParams are the parameters of the command BluetoothEmulation.enable.

type EventCharacteristicOperationReceived

type EventCharacteristicOperationReceived struct {
	CharacteristicID string                      `json:"characteristicId"`
	Type             CharacteristicOperationType `json:"type"`
	Data             []byte                      `json:"data,omitempty,omitzero"`
	WriteType        CharacteristicWriteType     `json:"writeType,omitempty,omitzero"`
}

EventCharacteristicOperationReceived event for when a characteristic operation of |type| to the characteristic respresented by |characteristicId| happened. |data| and |writeType| is expected to exist when |type| is write.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#event-characteristicOperationReceived

type EventDescriptorOperationReceived

type EventDescriptorOperationReceived struct {
	DescriptorID string                  `json:"descriptorId"`
	Type         DescriptorOperationType `json:"type"`
	Data         []byte                  `json:"data,omitempty,omitzero"`
}

EventDescriptorOperationReceived event for when a descriptor operation of |type| to the descriptor respresented by |descriptorId| happened. |data| is expected to exist when |type| is write.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#event-descriptorOperationReceived

type EventGattOperationReceived

type EventGattOperationReceived struct {
	Address string            `json:"address"`
	Type    GATTOperationType `json:"type"`
}

EventGattOperationReceived event for when a GATT operation of |type| to the peripheral with |address| happened.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#event-gattOperationReceived

type GATTOperationType

type GATTOperationType string

GATTOperationType indicates the various types of GATT event.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-GATTOperationType

const (
	GATTOperationTypeConnection GATTOperationType = "connection"
	GATTOperationTypeDiscovery  GATTOperationType = "discovery"
)

GATTOperationType values.

func (GATTOperationType) String

func (t GATTOperationType) String() string

String returns the GATTOperationType as string value.

type ManufacturerData

type ManufacturerData struct {
	Key  int64  `json:"key"`  // Company identifier https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/company_identifiers/company_identifiers.yaml https://usb.org/developers
	Data []byte `json:"data"` // Manufacturer-specific data
}

ManufacturerData stores the manufacturer data.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-ManufacturerData

type RemoveCharacteristicParams

type RemoveCharacteristicParams struct {
	CharacteristicID string `json:"characteristicId"`
}

RemoveCharacteristicParams are the parameters of the command BluetoothEmulation.removeCharacteristic.

type RemoveDescriptorParams

type RemoveDescriptorParams struct {
	DescriptorID string `json:"descriptorId"`
}

RemoveDescriptorParams are the parameters of the command BluetoothEmulation.removeDescriptor.

type RemoveServiceParams

type RemoveServiceParams struct {
	ServiceID string `json:"serviceId"`
}

RemoveServiceParams are the parameters of the command BluetoothEmulation.removeService.

type ScanEntry

type ScanEntry struct {
	DeviceAddress string      `json:"deviceAddress"`
	Rssi          int64       `json:"rssi"`
	ScanRecord    *ScanRecord `json:"scanRecord"`
}

ScanEntry stores the advertisement packet information that is sent by a Bluetooth device.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-ScanEntry

type ScanRecord

type ScanRecord struct {
	Name             string              `json:"name,omitempty,omitzero"`
	UUIDs            []string            `json:"uuids,omitempty,omitzero"`
	Appearance       int64               `json:"appearance,omitempty,omitzero"`       // Stores the external appearance description of the device.
	TxPower          int64               `json:"txPower,omitempty,omitzero"`          // Stores the transmission power of a broadcasting device.
	ManufacturerData []*ManufacturerData `json:"manufacturerData,omitempty,omitzero"` // Key is the company identifier and the value is an array of bytes of manufacturer specific data.
}

ScanRecord stores the byte data of the advertisement packet sent by a Bluetooth device.

See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#type-ScanRecord

type SetSimulatedCentralStateParams

type SetSimulatedCentralStateParams struct {
	State CentralState `json:"state"` // State of the simulated central.
}

SetSimulatedCentralStateParams are the parameters of the command BluetoothEmulation.setSimulatedCentralState.

type SimulateAdvertisementParams

type SimulateAdvertisementParams struct {
	Entry *ScanEntry `json:"entry"`
}

SimulateAdvertisementParams are the parameters of the command BluetoothEmulation.simulateAdvertisement.

type SimulateCharacteristicOperationResponseParams

type SimulateCharacteristicOperationResponseParams struct {
	CharacteristicID string                      `json:"characteristicId"`
	Type             CharacteristicOperationType `json:"type"`
	Code             int64                       `json:"code"`
	Data             []byte                      `json:"data,omitempty,omitzero"`
}

SimulateCharacteristicOperationResponseParams are the parameters of the command BluetoothEmulation.simulateCharacteristicOperationResponse.

type SimulateDescriptorOperationResponseParams

type SimulateDescriptorOperationResponseParams struct {
	DescriptorID string                  `json:"descriptorId"`
	Type         DescriptorOperationType `json:"type"`
	Code         int64                   `json:"code"`
	Data         []byte                  `json:"data,omitempty,omitzero"`
}

SimulateDescriptorOperationResponseParams are the parameters of the command BluetoothEmulation.simulateDescriptorOperationResponse.

type SimulateGATTDisconnectionParams

type SimulateGATTDisconnectionParams struct {
	Address string `json:"address"`
}

SimulateGATTDisconnectionParams are the parameters of the command BluetoothEmulation.simulateGATTDisconnection.

type SimulateGATTOperationResponseParams

type SimulateGATTOperationResponseParams struct {
	Address string            `json:"address"`
	Type    GATTOperationType `json:"type"`
	Code    int64             `json:"code"`
}

SimulateGATTOperationResponseParams are the parameters of the command BluetoothEmulation.simulateGATTOperationResponse.

type SimulatePreconnectedPeripheralParams

type SimulatePreconnectedPeripheralParams struct {
	Address           string              `json:"address"`
	Name              string              `json:"name"`
	ManufacturerData  []*ManufacturerData `json:"manufacturerData"`
	KnownServiceUUIDs []string            `json:"knownServiceUuids"`
}

SimulatePreconnectedPeripheralParams are the parameters of the command BluetoothEmulation.simulatePreconnectedPeripheral.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL