aboutsummaryrefslogtreecommitdiffstats
path: root/components/bluetooth_traits/lib.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-12-16 12:30:41 -0800
committerGitHub <noreply@github.com>2016-12-16 12:30:41 -0800
commit6efea399ed0e44fe6bd151f346ca2c3371e2f66c (patch)
tree0ef00cb38846e01b45b1c0a72f236e6c56d903ef /components/bluetooth_traits/lib.rs
parenta4ecdf2d5fda281f25e2689852bc2134429e07c6 (diff)
parentb0103682fa2cd5147778e70b065ad4ee051684fd (diff)
downloadservo-6efea399ed0e44fe6bd151f346ca2c3371e2f66c.tar.gz
servo-6efea399ed0e44fe6bd151f346ca2c3371e2f66c.zip
Auto merge of #14593 - szeged:getgattchildren, r=jdm
Implement GetGATTChildren <!-- Please describe your changes on the following line: --> Implement the [GetGATTChildren](https://webbluetoothcg.github.io/web-bluetooth/#getgattchildren) function for webbluetooth. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14593) <!-- Reviewable:end -->
Diffstat (limited to 'components/bluetooth_traits/lib.rs')
-rw-r--r--components/bluetooth_traits/lib.rs29
1 files changed, 13 insertions, 16 deletions
diff --git a/components/bluetooth_traits/lib.rs b/components/bluetooth_traits/lib.rs
index 81f224ab3bd..ede1c8ecdba 100644
--- a/components/bluetooth_traits/lib.rs
+++ b/components/bluetooth_traits/lib.rs
@@ -27,6 +27,14 @@ pub enum BluetoothError {
}
#[derive(Deserialize, Serialize)]
+pub enum GATTType {
+ PrimaryService,
+ Characteristic,
+ IncludedService,
+ Descriptor,
+}
+
+#[derive(Deserialize, Serialize)]
pub struct BluetoothDeviceMsg {
// Bluetooth Device properties
pub id: String,
@@ -78,14 +86,7 @@ pub enum BluetoothRequest {
RequestDevice(RequestDeviceoptions, IpcSender<BluetoothResponseResult>),
GATTServerConnect(String, IpcSender<BluetoothResponseResult>),
GATTServerDisconnect(String, IpcSender<BluetoothResult<bool>>),
- GetPrimaryService(String, String, IpcSender<BluetoothResponseResult>),
- GetPrimaryServices(String, Option<String>, IpcSender<BluetoothResponseResult>),
- GetIncludedService(String, String, IpcSender<BluetoothResponseResult>),
- GetIncludedServices(String, Option<String>, IpcSender<BluetoothResponseResult>),
- GetCharacteristic(String, String, IpcSender<BluetoothResponseResult>),
- GetCharacteristics(String, Option<String>, IpcSender<BluetoothResponseResult>),
- GetDescriptor(String, String, IpcSender<BluetoothResponseResult>),
- GetDescriptors(String, Option<String>, IpcSender<BluetoothResponseResult>),
+ GetGATTChildren(String, Option<String>, bool, GATTType, IpcSender<BluetoothResponseResult>),
ReadValue(String, IpcSender<BluetoothResponseResult>),
WriteValue(String, Vec<u8>, IpcSender<BluetoothResponseResult>),
EnableNotification(String, bool, IpcSender<BluetoothResponseResult>),
@@ -98,14 +99,10 @@ pub enum BluetoothRequest {
pub enum BluetoothResponse {
RequestDevice(BluetoothDeviceMsg),
GATTServerConnect(bool),
- GetPrimaryService(BluetoothServiceMsg),
- GetPrimaryServices(BluetoothServicesMsg),
- GetIncludedService(BluetoothServiceMsg),
- GetIncludedServices(BluetoothServicesMsg),
- GetCharacteristic(BluetoothCharacteristicMsg),
- GetCharacteristics(BluetoothCharacteristicsMsg),
- GetDescriptor(BluetoothDescriptorMsg),
- GetDescriptors(BluetoothDescriptorsMsg),
+ GetPrimaryServices(BluetoothServicesMsg, bool),
+ GetIncludedServices(BluetoothServicesMsg, bool),
+ GetCharacteristics(BluetoothCharacteristicsMsg, bool),
+ GetDescriptors(BluetoothDescriptorsMsg, bool),
ReadValue(Vec<u8>),
WriteValue(Vec<u8>),
EnableNotification(()),