B2G/Bluetooth/WebBluetooth-v2/Discussion/2014-03-14: Difference between revisions

(Created page with " == Items == === BluetoothManager === * Access adapter in onadapterremoved ** onadapterremoved(address) -> onadapterremoved(adapter) before adapter is really removed? adapt...")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:


== Info ==


== Items ==
=== Attendees ===
* BT team: Eric Chou, Gina Yeh, Ben Tian, Shawn Huang, Jamin Liu, Jocelyn Liu
* Gaia: Arthur Chen, Ian Liu, Evelyn Hung, Alive Kuo
* WebAPI: Gene Lian
 
=== Time & Location ===
3pm - 6pm @Utopia
 
=== Meeting Minutes ===
[https://wiki.mozilla.org/images/e/e0/Webbluetooth-api-0314.pdf Meeting minutes] by Jamin Liu
 
=== Response to Suggestions ===
[https://wiki.mozilla.org/images/5/55/Webbluetooth-response-0314.pdf Response to Suggestions]
 
* Revision (2014-05-12)
:: '''13) Should we rebind handlers for adapter after it's been disabled ? (Evelyn)'''
:: <strike>YES. To be consistent with attributes, the event handlers should also be reset as default value (nullptr). Application should rebind all handlers after adapter is re-enabled.</strike>
:: NO. The event handlers are kept until applications remove them. The reason is that applications are unaware of the reset by gecko and assignments of reset event handlers cause unexpected behavior.
:: '''Example'''
var adapter = navigator.mozBluetooth.defaultAdapter;
var device = ''PairedDevice'';
device.attributechanged = adapter.onattributechanged;
adapter.disable().then { function onResolve() {
  console.log("Resolved with void value");
  '''// device.onattributechanged becomes nullptr but application is unaware!'''
}, function onReject(aReason) {
  console.log("Rejected with this reason: " + aReason);
});
 
== BT Team Internal Discussion Result ==


=== BluetoothManager ===
=== BluetoothManager ===
* Access adapter in onadapterremoved  
* Access adapter in onadapterremoved  
** onadapterremoved(address) -> onadapterremoved(adapter) before adapter is really removed? adapter's attributes are accessible with default values.
** onadapterremoved(address) -> onadapterremoved(adapter) before adapter is really removed? adapter's attributes are accessible with default values.
: '''(Unchanged) Yes. Remove.'''


* Remove adapter from adapters[] array or not?
* Remove adapter from adapters[] array or not?
** gaia has to rebind handlers if adapter is removed from array.
** gaia has to rebind handlers if adapter is removed from array.
: '''(Unchanged) Yes. Remove.'''


* Track default adapter added/removed - options
* Track default adapter added/removed - options
Line 14: Line 47:
** onadapteradded/removed(adapter, bool isDefault)
** onadapteradded/removed(adapter, bool isDefault)
** bool adapter.isDefault
** bool adapter.isDefault
: '''Option 2'''


=== BluetoothAdapter ===
=== BluetoothAdapter ===
Line 20: Line 54:
** add "pairing", "connecting", and "connected"?
** add "pairing", "connecting", and "connected"?
*** outgoing vs incoming pairing/connection state transition
*** outgoing vs incoming pairing/connection state transition
: '''(Unchanged) No for both. Reason - 1) independent states from enabled/disabled 2) we cannot ensure correct 'pairing'/'connecting' transition for incoming pairing/connection.
'''


* adapter attributes validity
* adapter attributes validity
** are all attributes available after state is "enabled"?
** are all attributes available after state is "enabled"?
: '''(Unchanged) No. Just forward what we get from backend and we don't ensure the sequence.'''


* '''DOMRequest life cycle'''
* DOMRequest life cycle
** should gaia hold req reference until stop discovery? does DOMRequest live after onsuccess is fired?
** should gaia hold req reference until stop discovery?
*** YES. gaia should hold reference if req is still needed.
** does DOMRequest live after onsuccess is fired?
*** YES. the life cycle ends when both gaia and gecko release the req. (by schien)
** fire onsuccess before or after ondevicefound?
: '''(Unchanged) before. Note BluetoothReplyRunnable frees the DOMRequest object after onsuccess is fired.'''


* Return BluetoothDevice in pairing event handlers
* Return BluetoothDevice in pairing event handlers
** carry correct address
** carry correct address
** what are the value of the device's attributes?
** what are the value of the device's attributes?
: '''Carry a handle. pros over func ptr - signature & address.'''
[chrome only]
interface BluetoothPairingObject {
  void setPasskey(DOMString passkey);
  readonly BluetoothDevice device;
}


* Move pairing event handlers into device?
* Move pairing event handlers into device?
: '''(Unchanged) No.'''
* Can application start discovery while adapter is discovering?
: '''No. It gets onerror. Applications have to stop current discovery first.'''
* When adapter.state becomes "disabled", should all its attributes become default values and onattributechanged are fired?
: '''Yes. As state becomes "enabled" for consistency.'''
Confirmed users
891

edits