Implementation of the getPrimaryService(s), the getCharacteristic(s) and the getDescriptor(s) functions.

This commit is contained in:
fokinv 2016-03-31 10:35:24 +02:00 committed by Attila Dusnoki
parent 9825ea41b4
commit b01c52c18f
9 changed files with 411 additions and 59 deletions

View file

@ -8,9 +8,12 @@ pub enum BluetoothMethodMsg {
RequestDevice(IpcSender<BluetoothObjectMsg>),
GATTServerConnect(String, IpcSender<BluetoothObjectMsg>),
GATTServerDisconnect(String, IpcSender<BluetoothObjectMsg>),
GetPrimaryService(String, IpcSender<BluetoothObjectMsg>),
GetCharacteristic(String, IpcSender<BluetoothObjectMsg>),
GetDescriptor(String, IpcSender<BluetoothObjectMsg>),
GetPrimaryService(String, String, IpcSender<BluetoothObjectMsg>),
GetPrimaryServices(String, Option<String>, IpcSender<BluetoothObjectMsg>),
GetCharacteristic(String, String, IpcSender<BluetoothObjectMsg>),
GetCharacteristics(String, Option<String>, IpcSender<BluetoothObjectMsg>),
GetDescriptor(String, String, IpcSender<BluetoothObjectMsg>),
GetDescriptors(String, Option<String>, IpcSender<BluetoothObjectMsg>),
ReadValue(String, IpcSender<BluetoothObjectMsg>),
WriteValue(String, Vec<u8>, IpcSender<BluetoothObjectMsg>),
Exit,
@ -40,6 +43,9 @@ pub enum BluetoothObjectMsg {
is_primary: bool,
instance_id: String
},
BluetoothServices {
services_vec: Vec<BluetoothObjectMsg>
},
BluetoothCharacteristic {
// Characteristic
uuid: String,
@ -55,10 +61,16 @@ pub enum BluetoothObjectMsg {
reliable_write: bool,
writable_auxiliaries: bool
},
BluetoothCharacteristics {
characteristics_vec: Vec<BluetoothObjectMsg>
},
BluetoothDescriptor {
uuid: String,
instance_id: String
},
BluetoothDescriptors {
descriptors_vec: Vec<BluetoothObjectMsg>,
},
BluetoothReadValue {
value: Vec<u8>
},