WebAPI/WebBluetooth: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 31: Line 31:
   interface nsIDOMBluetoothAdapter : nsIDOMEventTarget
   interface nsIDOMBluetoothAdapter : nsIDOMEventTarget
   {
   {
    readonly attribute DOMString address;
    readonly attribute unsigned long class;
    readonly attribute bool discovering;
    readonly attribute bool enabled;
    attribute bool discoverable;
    attribute unsigned long discoverabletimeout;
    attribute DOMString name;
 
     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 ondevicefound;
    readonly attribute DOMString address;
     attribute nsIDOMEventListener ondevicedisappeared;
    readonly attribute unsigned long class;
     attribute nsIDOMEventListener ondeviceconnected;
    readonly attribute bool enabled;
     attribute nsIDOMEventListener ondevicedisconnected;
    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
   };
   };


44

edits

Navigation menu