Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Instance IDs #51

Closed
scheib opened this issue Oct 1, 2014 · 7 comments
Closed

Remove Instance IDs #51

scheib opened this issue Oct 1, 2014 · 7 comments

Comments

@scheib
Copy link
Contributor

scheib commented Oct 1, 2014

The instanceid attribute currently exists on BluetoothDevice, BluetoothGATTService, BluetoothGATTCharacteristic, and BluetoothGATTDescriptor. The instanceid can be used to

  1. Disambiguate multiple instances of objects with the same UUID.
  2. Get an object for the instance from the navigator.bluetooth.get* methods (BluetoothInteraction interface).

However, instance IDs may not be exposed on all platform APIs. E.G. See Apple's CBService.

Implementations of Web Bluetooth could manufacture IDs even when the OS API does not provide them to work around this. IDs would need to be invalidated whenever the association can't be maintained, e.g. device disconnection or on Service Change.

Further, the information does not seem essential to a minimum viable Web Bluetooth specification. Multiple service, characteristic, descriptor instances will be returned as unique objects, and applications can assign ID if necessary to them in the same way this specification wound need to on operating systems that do not expose an instance ID.

@scheib
Copy link
Contributor Author

scheib commented Oct 1, 2014

#52 proposes a subset of removing instance ids: Remove BluetoothInteraction get* Methods

@jyasskin
Copy link
Member

jyasskin commented Oct 1, 2014

I think BluetoothDevice.instanceId is still valuable and implementable as discussed in #32. It's the others that aren't available on Mac/iOS.

@scheib
Copy link
Contributor Author

scheib commented Oct 1, 2014

@jyasskin
Copy link
Member

jyasskin commented Oct 1, 2014

They moved it into CBPeer but haven't added documentation for CBPeer yet.

@jracle
Copy link

jracle commented Oct 4, 2014

@scheib inedeed, as @jyasskin said it has been displaced apparently. I'll ask my (Logitech)Peers here if they know more about that (pun intended..)

@jyasskin
Copy link
Member

jyasskin commented Feb 2, 2015

Do we still need this?

@scheib
Copy link
Contributor Author

scheib commented Feb 2, 2015

Ok to close, here are my notes:

The usecases in #32 as I understand are essentially:
a) Devices connected to, disconnected, then connected to again should be identifiable as the same device if they are the same device.
b) This concept probably applies to other GATT concepts, but no strong use case is described for why this is valuable.

However in person a while ago Jeffrey and I discussed a particular of 'b':
c) API convenience of connecting to a device and then directly calling navigator.bluetooth.getService/getCharacteristic/getDescriptor to succinctly re-find a known characteristic of interest instead of an app storing the Service/Characteristic UUIDs and searching again for the particular instances of interest. There may also be a performance win here, beyond just additional code, as it avoids round trips.

#52 proposes removing navigator.bluetooth.getService/getCharacteristic/getDescriptor

I believe the minimum viable specification doesn't need to satisfy 'c'. I'm OK with leaving it, but also think it would be acceptable to remove the accessors in #52 unless we come up with another good specific use case in 'b'. Less spec complexity leads to shipping something sooner, and the workaround for 'c' isn't unreasonable I think.

jyasskin added a commit to jyasskin/web-bluetooth-1 that referenced this issue May 19, 2015
…oothInteraction.

The Mac/iOS platforms don't expose a persistent instance ID for attributes. I
believe they use object identity within a process to distinguish multiple
attributes with the same UUID, although that's not documented. This patch also
documents that the web platform will use object identity for this purpose.

Removing instance IDs makes BluetoothInteraction empty, so I don't need
Bluetooth to have multiple components anymore.

Fixes WebBluetoothCG#51 and fixes WebBluetoothCG#52.
jyasskin added a commit to jyasskin/web-bluetooth-1 that referenced this issue May 19, 2015
…oothInteraction.

The Mac/iOS platforms don't expose a persistent instance ID for attributes. I
believe they use object identity within a process to distinguish multiple
attributes with the same UUID, although that's not documented. This patch also
documents that the web platform will use object identity for this purpose.

Removing instance IDs makes BluetoothInteraction empty, so I don't need
Bluetooth to have multiple components anymore.

Fixes WebBluetoothCG#51 and fixes WebBluetoothCG#52.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants