W3C home > Mailing lists > Public > public-device-apis@w3.org > April 2013

Re: Vibration: throwing and pause

From: Kostiainen, Anssi <anssi.kostiainen@intel.com>
Date: Thu, 18 Apr 2013 08:00:11 +0000
To: Anne van Kesteren <annevk@annevk.nl>, Justin Lebar <justin.lebar@gmail.com>
CC: "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <76657FEA-E491-47A8-9850-3D4372417C8B@intel.com>
Hi Anne, Justin,

Thanks for your review and feedback! Here's a summary of your
proposed changes:

* in step 4 add "and is not zero"

* in step 7 s/abort the algorithm at this point/terminate these
  steps/

* in step 9 s/return false/return true/

* s/abort/terminate/g

* in [NEW] step s/Run the remainder of these steps 
  asynchronously, and return true from the method./Return true,
  and then continue running these steps asynchronously./

* in step 10.2 s/spin/wait/

And here's the new version of the algorithm with the above
changes baked in:

[[

1. Let pattern be the value of the first argument.

2. If pattern is a list, proceed to the next step. Otherwise run
  the following substeps:
  1. Let list be an initially empty list, and add pattern to
     list.
  2. Let pattern be list.

3. If any entry of pattern exceeds an implementation-dependent
  limit, then return false and terminate these steps.

4. If the length of pattern is even and is not zero, then remove
   the last entry in pattern.

5. If the length of pattern exceeds an implementation dependent
  limit, then return false and terminate these steps.

6. If the hidden attribute [PAGE-VISIBILITY] is set to true,
   then return false and terminate these steps.

[ Note 1 ]

7. An implementation may return false and terminate these steps.

[ Note 2 ]

8. Cancel the pre-existing instance of the processing vibration
  patterns algorithm, if any.

9. If pattern is 0, an empty list, or if the device does not
   provide a vibration mechanism (or it is disabled), then return
   true and terminate these steps.

[NEW] Return true, and then continue running these steps
      asynchronously.

10. For each time in pattern, run the following substeps:
  1. If the index of time is even (the first entry has index 0),
     vibrate the device for time milliseconds.
  2. Otherwise wait for time milliseconds.

]]

Please take a look at this version and let me know if I missed
any of your feedback, or if there are any further bugs or issues.

Thanks,

-Anssi
Received on Thursday, 18 April 2013 08:00:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:58 UTC