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
- Variables
- type AddCharacteristicParams
- type AddCharacteristicResult
- type AddDescriptorParams
- type AddDescriptorResult
- type AddServiceParams
- type AddServiceResult
- type CentralState
- type CharacteristicOperationType
- type CharacteristicProperties
- type CharacteristicWriteType
- type DescriptorOperationType
- type EnableParams
- type EventCharacteristicOperationReceived
- type EventDescriptorOperationReceived
- type EventGattOperationReceived
- type GATTOperationType
- type ManufacturerData
- type RemoveCharacteristicParams
- type RemoveDescriptorParams
- type RemoveServiceParams
- type ScanEntry
- type ScanRecord
- type SetSimulatedCentralStateParams
- type SimulateAdvertisementParams
- type SimulateCharacteristicOperationResponseParams
- type SimulateDescriptorOperationResponseParams
- type SimulateGATTDisconnectionParams
- type SimulateGATTOperationResponseParams
- type SimulatePreconnectedPeripheralParams
Constants ¶
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 ¶
var AddCharacteristic = cdp.Command[AddCharacteristicParams, AddCharacteristicResult]{Method: CommandAddCharacteristic}
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
var AddDescriptor = cdp.Command[AddDescriptorParams, AddDescriptorResult]{Method: CommandAddDescriptor}
AddDescriptor adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|.
See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-addDescriptor
var AddService = cdp.Command[AddServiceParams, AddServiceResult]{Method: CommandAddService}
AddService adds a service with |serviceUuid| to the peripheral with |address|.
See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-addService
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.
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.
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
var Enable = cdp.Command[EnableParams, cdp.Empty]{Method: CommandEnable}
Enable enable the BluetoothEmulation domain.
See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-enable
var GattOperationReceived = cdp.Event[EventGattOperationReceived]{Method: "BluetoothEmulation.gattOperationReceived"}
GattOperationReceived event for when a GATT operation of |type| to the peripheral with |address| happened.
var RemoveCharacteristic = cdp.Command[RemoveCharacteristicParams, cdp.Empty]{Method: CommandRemoveCharacteristic}
RemoveCharacteristic removes the characteristic respresented by |characteristicId| from the simulated central.
var RemoveDescriptor = cdp.Command[RemoveDescriptorParams, cdp.Empty]{Method: CommandRemoveDescriptor}
RemoveDescriptor removes the descriptor with |descriptorId| from the simulated central.
See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-removeDescriptor
var RemoveService = cdp.Command[RemoveServiceParams, cdp.Empty]{Method: CommandRemoveService}
RemoveService removes the service respresented by |serviceId| from the simulated central.
See: https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation#method-removeService
var SetSimulatedCentralState = cdp.Command[SetSimulatedCentralStateParams, cdp.Empty]{Method: CommandSetSimulatedCentralState}
SetSimulatedCentralState set the state of the simulated central.
var SimulateAdvertisement = cdp.Command[SimulateAdvertisementParams, cdp.Empty]{Method: CommandSimulateAdvertisement}
SimulateAdvertisement simulates an advertisement packet described in |entry| being received by the central.
var SimulateCharacteristicOperationResponse = cdp.Command[SimulateCharacteristicOperationResponseParams, cdp.Empty]{Method: CommandSimulateCharacteristicOperationResponse}
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.
var SimulateDescriptorOperationResponse = cdp.Command[SimulateDescriptorOperationResponseParams, cdp.Empty]{Method: CommandSimulateDescriptorOperationResponse}
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.
var SimulateGATTDisconnection = cdp.Command[SimulateGATTDisconnectionParams, cdp.Empty]{Method: CommandSimulateGATTDisconnection}
SimulateGATTDisconnection simulates a GATT disconnection from the peripheral with |address|.
var SimulateGATTOperationResponse = cdp.Command[SimulateGATTOperationResponseParams, cdp.Empty]{Method: CommandSimulateGATTOperationResponse}
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.
var SimulatePreconnectedPeripheral = cdp.Command[SimulatePreconnectedPeripheralParams, cdp.Empty]{Method: CommandSimulatePreconnectedPeripheral}
SimulatePreconnectedPeripheral simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.
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.
const ( CharacteristicOperationTypeRead CharacteristicOperationType = "read" CharacteristicOperationTypeWrite CharacteristicOperationType = "write" CharacteristicOperationTypeSubscribeToNotifications CharacteristicOperationType = "subscribe-to-notifications" CharacteristicOperationTypeUnsubscribeFromNotifications CharacteristicOperationType = "unsubscribe-from-notifications" )
CharacteristicOperationType values.
func (CharacteristicOperationType) String ¶
func (t CharacteristicOperationType) String() 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.
type CharacteristicWriteType ¶
type CharacteristicWriteType string
CharacteristicWriteType indicates the various types of characteristic write.
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.
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.
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.
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.
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.