aboutsummaryrefslogtreecommitdiffstats
path: root/components/bluetooth_traits
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2018-10-26 16:44:45 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2018-10-29 09:21:37 -0500
commit05391e27cda2f394adc5c16584bcbc55d921eb5e (patch)
treee77fda5519c73f3fe3af9ae0f33b42c613f8b3a9 /components/bluetooth_traits
parente580250d5d99060b0ee8d88e3ff66b6d9ec24050 (diff)
downloadservo-05391e27cda2f394adc5c16584bcbc55d921eb5e.tar.gz
servo-05391e27cda2f394adc5c16584bcbc55d921eb5e.zip
Add lots of derived Debug impls
Diffstat (limited to 'components/bluetooth_traits')
-rw-r--r--components/bluetooth_traits/lib.rs16
-rw-r--r--components/bluetooth_traits/scanfilter.rs8
2 files changed, 12 insertions, 12 deletions
diff --git a/components/bluetooth_traits/lib.rs b/components/bluetooth_traits/lib.rs
index 0925234666b..ef9b58237eb 100644
--- a/components/bluetooth_traits/lib.rs
+++ b/components/bluetooth_traits/lib.rs
@@ -14,7 +14,7 @@ pub mod scanfilter;
use ipc_channel::ipc::IpcSender;
use scanfilter::{BluetoothScanfilterSequence, RequestDeviceoptions};
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub enum BluetoothError {
Type(String),
Network,
@@ -24,7 +24,7 @@ pub enum BluetoothError {
InvalidState,
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub enum GATTType {
PrimaryService,
Characteristic,
@@ -32,21 +32,21 @@ pub enum GATTType {
Descriptor,
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothDeviceMsg {
// Bluetooth Device properties
pub id: String,
pub name: Option<String>,
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothServiceMsg {
pub uuid: String,
pub is_primary: bool,
pub instance_id: String,
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothCharacteristicMsg {
// Characteristic
pub uuid: String,
@@ -63,7 +63,7 @@ pub struct BluetoothCharacteristicMsg {
pub writable_auxiliaries: bool,
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothDescriptorMsg {
pub uuid: String,
pub instance_id: String,
@@ -79,7 +79,7 @@ pub type BluetoothResult<T> = Result<T, BluetoothError>;
pub type BluetoothResponseResult = Result<BluetoothResponse, BluetoothError>;
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub enum BluetoothRequest {
RequestDevice(RequestDeviceoptions, IpcSender<BluetoothResponseResult>),
GATTServerConnect(String, IpcSender<BluetoothResponseResult>),
@@ -107,7 +107,7 @@ pub enum BluetoothRequest {
Exit,
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub enum BluetoothResponse {
RequestDevice(BluetoothDeviceMsg),
GATTServerConnect(bool),
diff --git a/components/bluetooth_traits/scanfilter.rs b/components/bluetooth_traits/scanfilter.rs
index cde3d172a25..099b9372a4e 100644
--- a/components/bluetooth_traits/scanfilter.rs
+++ b/components/bluetooth_traits/scanfilter.rs
@@ -10,7 +10,7 @@ use std::slice::Iter;
// That leaves 29 bytes for the name.
const MAX_NAME_LENGTH: usize = 29;
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct ServiceUUIDSequence(Vec<String>);
impl ServiceUUIDSequence {
@@ -26,7 +26,7 @@ impl ServiceUUIDSequence {
type ManufacturerData = HashMap<u16, (Vec<u8>, Vec<u8>)>;
type ServiceData = HashMap<String, (Vec<u8>, Vec<u8>)>;
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothScanfilter {
name: Option<String>,
name_prefix: String,
@@ -83,7 +83,7 @@ impl BluetoothScanfilter {
}
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct BluetoothScanfilterSequence(Vec<BluetoothScanfilter>);
impl BluetoothScanfilterSequence {
@@ -110,7 +110,7 @@ impl BluetoothScanfilterSequence {
}
}
-#[derive(Deserialize, Serialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct RequestDeviceoptions {
filters: BluetoothScanfilterSequence,
optional_services: ServiceUUIDSequence,