44
edits
No edit summary |
|||
Line 31: | Line 31: | ||
interface nsIDOMBluetoothAdapter : nsIDOMEventTarget | interface nsIDOMBluetoothAdapter : nsIDOMEventTarget | ||
{ | { | ||
nsIDOMDOMRequest setEnabled(bool enabled); | nsIDOMDOMRequest setEnabled(bool enabled); | ||
bool startDiscovery(); | bool startDiscovery(); // ret: false if bluetooth is not enabled | ||
void stopDiscovery(); | void stopDiscovery(); | ||
nsIDOMBluetoothDevice getDevice(DOMString address); | nsIDOMBluetoothDevice getDevice(DOMString address); // Like a device creator | ||
bool connect(in nsIDOMBluetoothDevice device); | bool connect(in nsIDOMBluetoothDevice device); | ||
void disconnect(in nsIDOMBluetoothDevice device); | void disconnect(in nsIDOMBluetoothDevice device); | ||
attribute nsIDOMEventListener | readonly attribute DOMString address; | ||
attribute nsIDOMEventListener | readonly attribute unsigned long class; | ||
attribute nsIDOMEventListener | readonly attribute bool enabled; | ||
attribute nsIDOMEventListener | readonly attribute bool discovering; | ||
attribute DOMString name; // Set custom device name | |||
attribute bool discoverable; // Set to false if this device would not like to be discovered | |||
attribute unsigned long discoverabletimeout; // Unit: sec | |||
attribute nsIDOMEventListener ondeviceFound; // Fired when discoverying and any device is discovered. | |||
attribute nsIDOMEventListener ondeviceDisappeared; // Fired when any device is out of discoverable range. | |||
attribute nsIDOMEventListener ondeviceConnected; // Fired when a remote device is connected | |||
attribute nsIDOMEventListener ondeviceDisconnected; // Fired when a remote device is disconnected | |||
}; | }; | ||
edits