W3C home > Mailing lists > Public > public-autowebplatform@w3.org > April 2014

Re: Vehicle Availability RFC

From: <andy@cx3marketing.com>
Date: Wed, 9 Apr 2014 15:57:51 -0400
Cc: "public-autowebplatform@w3.org" <public-autowebplatform@w3.org>
Message-Id: <E7C0E5BD-1888-4BFE-A489-FB1EA6D7FB13@cx3marketing.com>
To: "Rees, Kevron" <kevron.m.rees@intel.com>
Hey Kevron,
Just so I understand this properly: if the API returns “security” then this means “not supported because the OEM thinks this feature is a security risk and it isn’t implemented” and not “not supported because your application does not have adequate security credentials”. If the first is what you intend, could I recommend still prefixing the security, policy and other enums with “not_supported”?

Would it be better to have the availability return a boolean and provide an optional way to get the rationale? It seems that it would make the use of the API a lot easier for the developer, since there may be quite a few availability tests required. If we make them all test === “available”, a simple typo could silently break the code.

—Andy


___________________________________________
Andy Gryc | Co-founder
M: +1 613.618.8730 | E: andy@cx3marketing.com
W: www.cx3marketing.com

On Apr 9, 2014, at 3:38 PM, Rees, Kevron <kevron.m.rees@intel.com> wrote:

> The purpose of the availability API additions is to allow developers
> to not only determine if a particular data is supported, but also tell
> them exactly why it isn't supported.  It also handles the scenario
> that if an attribute is not available at the moment, applications can
> be notified when the attribute becomes available.
> 
> enum Availability
> {
>  "available",
>  "not_supported",
>  "not_supported_yet",
>  "security",
>  "policy",
>  "other"
> }
> 
> partial Interface VehicleInterface {
> 
>  Availability available();
>  short availabilityChangedListener( AvailableCallback callback );
>  void removeAvailabilityChangedListener( short handle );
> }
> 
> Example 1:
> 
> if( ( var a = vehicle.vehicleSpeed.available() ) === "available" )
> {
>  // we can use it.
> }
> else
> {
>  // tell us why:
>  console.log(a);
> }
> 
> Example 2:
> 
> var canHasVehicleSpeed = vehicle.vehicleSpeed.available() == "available";
> 
> vehicle.vehicle.availabilityChangedListener( function (available) {
>  canHasVehicleSpeed = available == "available";
> });
> 
> ...
> 
> if(canHasVehicleSpeed)
> {
>   vehicle.vehicleSpeed.get().then(callback);
> }
> 
> 
> -Kevron
> 
Received on Wednesday, 9 April 2014 19:58:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:52:52 UTC