Created
January 29, 2016 08:39
-
-
Save zakorgy/b60b36aaacb6338e728f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[dom_struct] | |
pub struct BluetoothDevice { | |
reflector_: Reflector, | |
id: DOMString, | |
name: DOMString, | |
adData: JS<BluetoothAdvertisingData>, | |
deviceClass: u32, | |
vendorIDSource: VendorIDSource, | |
vendorID: u32, | |
productID: u32, | |
productVersion: u32, | |
gattServer: JS<BluetoothGATTRemoteServer>, <-- ezt kellene átírni Optionre szerintem | |
** A leírásban ez van hozzá: | |
** If the UA is currently connected to this device’s GATT server, gattServer | |
** provides a way to interact with it. While this device is disconnected, gattServer is null. | |
//TODO:uuids: Vec<u32>, | |
} | |
impl BluetoothDevice { | |
pub fn new_inherited(id: DOMString, | |
name: DOMString, | |
adData: &BluetoothAdvertisingData, | |
deviceClass: u32, | |
vendorIDSource: VendorIDSource, | |
vendorID: u32, | |
productID: u32, | |
productVersion: u32, | |
gattServer: &BluetoothGATTRemoteServer) | |
-> BluetoothDevice { | |
BluetoothDevice { | |
reflector_: Reflector::new(), | |
id: id, | |
name: name, | |
adData: JS::from_ref(adData), | |
deviceClass: deviceClass, | |
vendorIDSource: vendorIDSource, | |
vendorID: vendorID, | |
productID: productID, | |
productVersion: productVersion, | |
gattServer: JS::from_ref(gattServer), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment