Changes

Jump to: navigation, search

B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter

1,627 bytes added, 03:37, 22 December 2015
add start/stopAdvertising
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#BluetoothAdapterState|BluetoothAdapterState]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#BluetoothAdapterAttribute|BluetoothAdapterAttribute]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#BluetoothAdvertisingData|BluetoothAdvertisingData]]
=== BluetoothAdapter ===
[NewObject] Promise<[[B2G/Bluetooth/WebBluetooth-v2/BluetoothDiscoveryHandle|BluetoothDiscoveryHandle]]> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#startLeScan.28sequence.3CDOMString.3E_aServiceUuids.29|startLeScan(sequence<DOMString> aServiceUuids)]];
[NewObject] Promise<void> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#stopLeScan.28BluetoothDiscoveryHandle_aDiscoveryHandle.29|stopLeScan(BluetoothDiscoveryHandle aDiscoveryHandle)]];
[NewObject] Promise<void> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#startAdvertising.28optional_BluetoothAdvertisingData_advData.29|startAdvertising(optional BluetoothAdvertisingData advData)]];
[NewObject] Promise<void> [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#stopAdvertising.28.29|stopAdvertising()]];
};
"discovering"
}
 
=== BluetoothAdvertisingData ===
dictionary BluetoothAdvertisingData
{
unsigned short appearance = 0;
boolean includeDevName = false;
boolean includeTxPower = false;
ArrayBuffer? manufacturerData = null;
ArrayBuffer? serviceData = null;
sequence<DOMString> serviceUuids = [];
};
== Properties ==
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#startLeScan.28sequence.3CDOMString.3E_aServiceUuids.29|BluetoothAdapter.startLeScan(sequence<DOMString> aServiceUuids)]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#stopLeScan.28BluetoothDiscoveryHandle_aDiscoveryHandle.29|BluetoothAdapter.stopLeScan(BluetoothDiscoveryHandle aDiscoveryHandle)]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#startAdvertising.28optional_BluetoothAdvertisingData_advData.29|startAdvertising(optional BluetoothAdvertisingData advData)]];
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#stopAdvertising.28.29|stopAdvertising()]];
 
=== enable() ===
console.log("Rejected with this reason: " + aReason);
});
 
=== startAdvertising(optional BluetoothAdvertisingData advData) ===
 
; Description
: Start to broadcast advertisements with an optional custom advertisement data.
 
; Parameters
: ''advData''
:: The custom advertisement data.
 
; Return
: A Promise to indicate whether the operation is resolved or rejected. If the bluetooth adapter is currently disabled, the Promise would be rejected.
 
=== stopAdvertising() ===
 
; Description
: Stop broadcasting advertisements.
 
; Return
: A Promise to indicate whether the operation is resolved or rejected. If the bluetooth adapter is currently disabled, the Promise would be rejected.
== See also ==
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothManager|BluetoothManager]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice|BluetoothDevice]]
120
edits

Navigation menu