- From: Alexander Shalamov via GitHub <sysbot+gh@w3.org>
- Date: Fri, 23 Oct 2015 11:46:05 +0000
- To: public-web-nfc@w3.org
@zolkis I think we need to create an issue for "multiple nfc adapters case". To my knowledge, there are no known platforms that have such HW configuration (>1 nfc adapter). This issue increases complexity of API implementation as well as usability of the API by the developers. Here is an example: ```javascript var nfcAdapter; var watchId; // UA shows dialog (select adapter => adapter 1 is selected) navigatior.nfc.requestAdapter().then( (adapter) => {nfcAdapter = adapter; } ); nfcAdapter.watch(...).then((id) => {watchId = id;}) nfcAdapter.pushMesage(...); // UA shows dialog (select adapter => adapter 2 is selected) navigatior.nfc.requestAdapter().then( (adapter) => {nfcAdapter = adapter; } ); nfcAdapter.pushMesage(...); nfcAdapter.unwatch(watchId); // Side effects? ``` 1. What should we do with first nfcAdapter? Should we release HW? Should we suspend watch / push? 2. Should we reject promise for first pushMessage call? 3. Should we move watch/push operations to new adapter? 4. Adapter doesn't have an id, therefore developer is not even aware that HW was changed => security issue? 5. Other Device APIs does not expose HW "adapter" multiplicity to the spec, NFC should not be exception. Battery (some laptops have 2) Geolocation (can have USB GPS dongle) Bluetooth (can be internal + USB) **Proposal:** I would propose to remove "hw adapter multiplicity" complexity from initial specification and add enumeration later if requested by real life use-cases. -- GitHub Notif of comment by alexshalamov See https://github.com/w3c/web-nfc/issues/67#issuecomment-150550996
Received on Friday, 23 October 2015 11:46:08 UTC