Skip to content

Instantly share code, notes, and snippets.

@zakorgy
Created January 29, 2016 08:44
Show Gist options
  • Save zakorgy/f30a2946f67fe1b77945 to your computer and use it in GitHub Desktop.
Save zakorgy/f30a2946f67fe1b77945 to your computer and use it in GitHub Desktop.
#[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 Option<JS<BluetoothGATTRemoteServer>> -re 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