mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Refactored a bluetooth* related files from codeStyle to code_style.
This commit is contained in:
parent
55ff161ed5
commit
5fa54177ca
5 changed files with 32 additions and 32 deletions
|
@ -19,9 +19,9 @@ pub struct BluetoothCharacteristicProperties {
|
||||||
write: bool,
|
write: bool,
|
||||||
notify: bool,
|
notify: bool,
|
||||||
indicate: bool,
|
indicate: bool,
|
||||||
authenticatedSignedWrites: bool,
|
authenticated_signed_writes: bool,
|
||||||
reliableWrite: bool,
|
reliable_write: bool,
|
||||||
writableAuxiliaries: bool,
|
writable_auxiliaries: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BluetoothCharacteristicProperties {
|
impl BluetoothCharacteristicProperties {
|
||||||
|
@ -31,9 +31,9 @@ impl BluetoothCharacteristicProperties {
|
||||||
write: bool,
|
write: bool,
|
||||||
notify: bool,
|
notify: bool,
|
||||||
indicate: bool,
|
indicate: bool,
|
||||||
authenticatedSignedWrites: bool,
|
authenticated_signed_writes: bool,
|
||||||
reliableWrite: bool,
|
reliable_write: bool,
|
||||||
writableAuxiliaries: bool)
|
writable_auxiliaries: bool)
|
||||||
-> BluetoothCharacteristicProperties {
|
-> BluetoothCharacteristicProperties {
|
||||||
BluetoothCharacteristicProperties {
|
BluetoothCharacteristicProperties {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
|
@ -43,9 +43,9 @@ impl BluetoothCharacteristicProperties {
|
||||||
write: write,
|
write: write,
|
||||||
notify: notify,
|
notify: notify,
|
||||||
indicate: indicate,
|
indicate: indicate,
|
||||||
authenticatedSignedWrites: authenticatedSignedWrites,
|
authenticated_signed_writes: authenticated_signed_writes,
|
||||||
reliableWrite: reliableWrite,
|
reliable_write: reliable_write,
|
||||||
writableAuxiliaries: writableAuxiliaries,
|
writable_auxiliaries: writable_auxiliaries,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,16 +107,16 @@ impl BluetoothCharacteristicPropertiesMethods for BluetoothCharacteristicPropert
|
||||||
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites
|
||||||
fn AuthenticatedSignedWrites(&self) -> bool {
|
fn AuthenticatedSignedWrites(&self) -> bool {
|
||||||
self.authenticatedSignedWrites
|
self.authenticated_signed_writes
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-reliablewrite
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-reliablewrite
|
||||||
fn ReliableWrite(&self) -> bool {
|
fn ReliableWrite(&self) -> bool {
|
||||||
self.reliableWrite
|
self.reliable_write
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writableauxiliaries
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writableauxiliaries
|
||||||
fn WritableAuxiliaries(&self) -> bool {
|
fn WritableAuxiliaries(&self) -> bool {
|
||||||
self.writableAuxiliaries
|
self.writable_auxiliaries
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,20 +17,20 @@ pub struct BluetoothDevice {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
id: DOMString,
|
id: DOMString,
|
||||||
name: Option<DOMString>,
|
name: Option<DOMString>,
|
||||||
adData: MutHeap<JS<BluetoothAdvertisingData>>,
|
ad_data: MutHeap<JS<BluetoothAdvertisingData>>,
|
||||||
gatt: MutNullableHeap<JS<BluetoothRemoteGATTServer>>,
|
gatt: MutNullableHeap<JS<BluetoothRemoteGATTServer>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BluetoothDevice {
|
impl BluetoothDevice {
|
||||||
pub fn new_inherited(id: DOMString,
|
pub fn new_inherited(id: DOMString,
|
||||||
name: Option<DOMString>,
|
name: Option<DOMString>,
|
||||||
adData: &BluetoothAdvertisingData)
|
ad_data: &BluetoothAdvertisingData)
|
||||||
-> BluetoothDevice {
|
-> BluetoothDevice {
|
||||||
BluetoothDevice {
|
BluetoothDevice {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
adData: MutHeap::new(adData),
|
ad_data: MutHeap::new(ad_data),
|
||||||
gatt: Default::default(),
|
gatt: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ impl BluetoothDeviceMethods for BluetoothDevice {
|
||||||
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-addata
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-addata
|
||||||
fn AdData(&self) -> Root<BluetoothAdvertisingData> {
|
fn AdData(&self) -> Root<BluetoothAdvertisingData> {
|
||||||
self.adData.get()
|
self.ad_data.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt
|
||||||
|
|
|
@ -37,14 +37,14 @@ pub struct BluetoothRemoteGATTCharacteristic {
|
||||||
uuid: DOMString,
|
uuid: DOMString,
|
||||||
properties: MutHeap<JS<BluetoothCharacteristicProperties>>,
|
properties: MutHeap<JS<BluetoothCharacteristicProperties>>,
|
||||||
value: DOMRefCell<Option<ByteString>>,
|
value: DOMRefCell<Option<ByteString>>,
|
||||||
instanceID: String,
|
instance_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BluetoothRemoteGATTCharacteristic {
|
impl BluetoothRemoteGATTCharacteristic {
|
||||||
pub fn new_inherited(service: &BluetoothRemoteGATTService,
|
pub fn new_inherited(service: &BluetoothRemoteGATTService,
|
||||||
uuid: DOMString,
|
uuid: DOMString,
|
||||||
properties: &BluetoothCharacteristicProperties,
|
properties: &BluetoothCharacteristicProperties,
|
||||||
instanceID: String)
|
instance_id: String)
|
||||||
-> BluetoothRemoteGATTCharacteristic {
|
-> BluetoothRemoteGATTCharacteristic {
|
||||||
BluetoothRemoteGATTCharacteristic {
|
BluetoothRemoteGATTCharacteristic {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
|
@ -52,7 +52,7 @@ impl BluetoothRemoteGATTCharacteristic {
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
properties: MutHeap::new(properties),
|
properties: MutHeap::new(properties),
|
||||||
value: DOMRefCell::new(None),
|
value: DOMRefCell::new(None),
|
||||||
instanceID: instanceID,
|
instance_id: instance_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ impl BluetoothRemoteGATTCharacteristic {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_instance_id(&self) -> String {
|
fn get_instance_id(&self) -> String {
|
||||||
self.instanceID.clone()
|
self.instance_id.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,20 +28,20 @@ pub struct BluetoothRemoteGATTDescriptor {
|
||||||
characteristic: MutHeap<JS<BluetoothRemoteGATTCharacteristic>>,
|
characteristic: MutHeap<JS<BluetoothRemoteGATTCharacteristic>>,
|
||||||
uuid: DOMString,
|
uuid: DOMString,
|
||||||
value: DOMRefCell<Option<ByteString>>,
|
value: DOMRefCell<Option<ByteString>>,
|
||||||
instanceID: String,
|
instance_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BluetoothRemoteGATTDescriptor {
|
impl BluetoothRemoteGATTDescriptor {
|
||||||
pub fn new_inherited(characteristic: &BluetoothRemoteGATTCharacteristic,
|
pub fn new_inherited(characteristic: &BluetoothRemoteGATTCharacteristic,
|
||||||
uuid: DOMString,
|
uuid: DOMString,
|
||||||
instanceID: String)
|
instance_id: String)
|
||||||
-> BluetoothRemoteGATTDescriptor {
|
-> BluetoothRemoteGATTDescriptor {
|
||||||
BluetoothRemoteGATTDescriptor {
|
BluetoothRemoteGATTDescriptor {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
characteristic: MutHeap::new(characteristic),
|
characteristic: MutHeap::new(characteristic),
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
value: DOMRefCell::new(None),
|
value: DOMRefCell::new(None),
|
||||||
instanceID: instanceID,
|
instance_id: instance_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ impl BluetoothRemoteGATTDescriptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_instance_id(&self) -> String {
|
fn get_instance_id(&self) -> String {
|
||||||
self.instanceID.clone()
|
self.instance_id.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,22 +24,22 @@ pub struct BluetoothRemoteGATTService {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
device: MutHeap<JS<BluetoothDevice>>,
|
device: MutHeap<JS<BluetoothDevice>>,
|
||||||
uuid: DOMString,
|
uuid: DOMString,
|
||||||
isPrimary: bool,
|
is_primary: bool,
|
||||||
instanceID: String,
|
instance_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BluetoothRemoteGATTService {
|
impl BluetoothRemoteGATTService {
|
||||||
pub fn new_inherited(device: &BluetoothDevice,
|
pub fn new_inherited(device: &BluetoothDevice,
|
||||||
uuid: DOMString,
|
uuid: DOMString,
|
||||||
isPrimary: bool,
|
is_primary: bool,
|
||||||
instanceID: String)
|
instance_id: String)
|
||||||
-> BluetoothRemoteGATTService {
|
-> BluetoothRemoteGATTService {
|
||||||
BluetoothRemoteGATTService {
|
BluetoothRemoteGATTService {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
device: MutHeap::new(device),
|
device: MutHeap::new(device),
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
isPrimary: isPrimary,
|
is_primary: is_primary,
|
||||||
instanceID: instanceID,
|
instance_id: instance_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ impl BluetoothRemoteGATTService {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_instance_id(&self) -> String {
|
fn get_instance_id(&self) -> String {
|
||||||
self.instanceID.clone()
|
self.instance_id.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
||||||
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-isprimary
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-isprimary
|
||||||
fn IsPrimary(&self) -> bool {
|
fn IsPrimary(&self) -> bool {
|
||||||
self.isPrimary
|
self.is_primary
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-uuid
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-uuid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue