Skip to main content

rustenium_cdp_definitions/browser_protocol/bluetooth_emulation/
events.rs

1use serde::{Deserialize, Serialize};
2#[doc = "Event for when a GATT operation of |type| to the peripheral with |address|\nhappened.\n[gattOperationReceived](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#event-gattOperationReceived)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct GattOperationReceivedParams {
5    #[serde(rename = "address")]
6    pub address: String,
7    #[serde(rename = "type")]
8    pub r#type: super::types::GattOperationType,
9}
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11pub enum GattOperationReceivedMethod {
12    #[serde(rename = "BluetoothEmulation.gattOperationReceived")]
13    GattOperationReceived,
14}
15#[doc = "Event for when a GATT operation of |type| to the peripheral with |address|\nhappened.\n[gattOperationReceived](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#event-gattOperationReceived)"]
16#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
17pub struct GattOperationReceived {
18    pub method: GattOperationReceivedMethod,
19    pub params: GattOperationReceivedParams,
20}
21impl GattOperationReceived {
22    pub const IDENTIFIER: &'static str = "BluetoothEmulation.gattOperationReceived";
23    pub fn identifier(&self) -> &'static str {
24        Self::IDENTIFIER
25    }
26}
27#[doc = "Event for when a characteristic operation of |type| to the characteristic\nrespresented by |characteristicId| happened. |data| and |writeType| is\nexpected to exist when |type| is write.\n[characteristicOperationReceived](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#event-characteristicOperationReceived)"]
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub struct CharacteristicOperationReceivedParams {
30    #[serde(rename = "characteristicId")]
31    pub characteristic_id: String,
32    #[serde(rename = "type")]
33    pub r#type: super::types::CharacteristicOperationType,
34    #[serde(rename = "data")]
35    #[serde(skip_serializing_if = "Option::is_none")]
36    #[serde(default)]
37    pub data: Option<crate::Binary>,
38    #[serde(rename = "writeType")]
39    #[serde(skip_serializing_if = "Option::is_none")]
40    #[serde(default)]
41    pub write_type: Option<super::types::CharacteristicWriteType>,
42}
43#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
44pub enum CharacteristicOperationReceivedMethod {
45    #[serde(rename = "BluetoothEmulation.characteristicOperationReceived")]
46    CharacteristicOperationReceived,
47}
48#[doc = "Event for when a characteristic operation of |type| to the characteristic\nrespresented by |characteristicId| happened. |data| and |writeType| is\nexpected to exist when |type| is write.\n[characteristicOperationReceived](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#event-characteristicOperationReceived)"]
49#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
50pub struct CharacteristicOperationReceived {
51    pub method: CharacteristicOperationReceivedMethod,
52    pub params: CharacteristicOperationReceivedParams,
53}
54impl CharacteristicOperationReceived {
55    pub const IDENTIFIER: &'static str = "BluetoothEmulation.characteristicOperationReceived";
56    pub fn identifier(&self) -> &'static str {
57        Self::IDENTIFIER
58    }
59}
60#[doc = "Event for when a descriptor operation of |type| to the descriptor\nrespresented by |descriptorId| happened. |data| is expected to exist when\n|type| is write.\n[descriptorOperationReceived](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#event-descriptorOperationReceived)"]
61#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
62pub struct DescriptorOperationReceivedParams {
63    #[serde(rename = "descriptorId")]
64    pub descriptor_id: String,
65    #[serde(rename = "type")]
66    pub r#type: super::types::DescriptorOperationType,
67    #[serde(rename = "data")]
68    #[serde(skip_serializing_if = "Option::is_none")]
69    #[serde(default)]
70    pub data: Option<crate::Binary>,
71}
72#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
73pub enum DescriptorOperationReceivedMethod {
74    #[serde(rename = "BluetoothEmulation.descriptorOperationReceived")]
75    DescriptorOperationReceived,
76}
77#[doc = "Event for when a descriptor operation of |type| to the descriptor\nrespresented by |descriptorId| happened. |data| is expected to exist when\n|type| is write.\n[descriptorOperationReceived](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#event-descriptorOperationReceived)"]
78#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
79pub struct DescriptorOperationReceived {
80    pub method: DescriptorOperationReceivedMethod,
81    pub params: DescriptorOperationReceivedParams,
82}
83impl DescriptorOperationReceived {
84    pub const IDENTIFIER: &'static str = "BluetoothEmulation.descriptorOperationReceived";
85    pub fn identifier(&self) -> &'static str {
86        Self::IDENTIFIER
87    }
88}
89group_enum ! (BluetoothEmulationEvents { GattOperationReceived (GattOperationReceived) , CharacteristicOperationReceived (CharacteristicOperationReceived) , DescriptorOperationReceived (DescriptorOperationReceived) } + identifiable);