W3C home > Mailing lists > Public > public-web-bluetooth-log@w3.org > April 2015

Re: [web-bluetooth] Map to remove listing units

From: Elliott Sprehn via GitHub <sysbot+gh@w3.org>
Date: Thu, 30 Apr 2015 04:31:53 +0000
To: public-web-bluetooth-log@w3.org
Message-ID: <issue_comment.created-97659988-1430368312-sysbot+gh@w3.org>
That's not idiomatic JS, it would be HEART_RATE then, and the .service
 is pretty weird but I suppose you can do that. It means allocating 
this service object for every context and creating a BluetoothService 
interface only for the purpose of constants. This thing is 
conceptually a map, you want a way to go from UUID -> Name, and from 
Name -> UUID. You probably also want a way to register new names? In 
either case you don't want navigator.bluetooth.uuids.{...}, constants 
shouldn't be on your instance.

I'd suggest navigator.bluetooth.requestDevice since that's talking to 
the browser's bluetooth system, just like the other device capability 
APIs. The object model for your system should just be interfaces on 
the window though, and you can put static constants there.

In general I'd encourage you to study the other device capability APIs
 and try to be consistent. :) 

-- 
GitHub Notif of comment by esprehn
See 
https://github.com/WebBluetoothCG/web-bluetooth/issues/49#issuecomment-97659988
Received on Thursday, 30 April 2015 04:31:55 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 30 April 2015 04:31:56 UTC