Refactor Bluetooth error handling

This commit is contained in:
zakorgy 2016-07-21 12:41:47 +02:00 committed by zakorgyula
parent d8991496c6
commit b4db14471b
7 changed files with 76 additions and 62 deletions

View file

@ -1,9 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_scanfilter::RequestDeviceoptions;
use ipc_channel::ipc::IpcSender;
#[derive(Deserialize, Serialize)]
pub enum BluetoothError {
Type(String),
Network,
NotFound,
NotSupported,
Security,
}
#[derive(Deserialize, Serialize)]
pub struct BluetoothDeviceMsg {
// Bluetooth Device properties
@ -51,7 +61,7 @@ pub type BluetoothCharacteristicsMsg = Vec<BluetoothCharacteristicMsg>;
pub type BluetoothDescriptorsMsg = Vec<BluetoothDescriptorMsg>;
pub type BluetoothResult<T> = Result<T, String>;
pub type BluetoothResult<T> = Result<T, BluetoothError>;
#[derive(Deserialize, Serialize)]
pub enum BluetoothMethodMsg {