From: Robert Kaiser Date: Thu, 29 Jan 2015 02:10:45 +0000 (+0100) Subject: complete the FOSDEM 2015 slides X-Git-Url: https://git-public.kairo.at/?p=slides.git;a=commitdiff_plain;h=a5b5cb49b761a50d347f99b9f8f78f0c190b915c;hp=b41707de4c4f88a5d499c0854a8762391cfae9fd complete the FOSDEM 2015 slides --- diff --git a/fosdem2015/index.html b/fosdem2015/index.html index 1522846..b976577 100755 --- a/fosdem2015/index.html +++ b/fosdem2015/index.html @@ -87,7 +87,7 @@

Firefox OS Tricorder App

-

Displays sensor data

+

Displays data from device sensors as exposed by WebAPIs

marketplace.firefox.com/app/tricorder/

Code: github.com/KaiRo-at/tricorder

@@ -96,7 +96,9 @@

Firefox OS Tricorder UI

-
+
+Tricorder UI description
@@ -131,7 +133,9 @@
   this.watchID = navigator.geolocation.watchPosition(
-    function(position) { ... },
+    function(position) {
+      position.coords.latitude / .longitude / .accuracy / ...
+    },
     function(error) { ... },
     {enableHighAccuracy: true, maximumAge: 10000, timeout: 60000}
   );
@@ -145,7 +149,7 @@
 

Gravity Module

-

Accelerometer, Magnetic Compass

+

Accelerometer, Magnetometer

APIs: deviceorientation, devicemotion events

Permissions: ---

@@ -187,6 +191,23 @@
+  navigator.getUserMedia({ audio: true },
+    function(aLocalMediaStream) {
+      gModSound.mAudio.stream = aLocalMediaStream;
+      gModSound.mAudio.context = new window.AudioContext();
+      gModSound.mAudio.input = gModSound.mAudio.context.createMediaStreamSource(gModSound.mAudio.stream);
+      gModSound.mAudio.analyzer = gModSound.mAudio.context.createAnalyser();
+      gModSound.mAudio.input.connect(gModSound.mAudio.analyzer);
+    },
+    function(err) { ... }
+  );
+
+  // in window.requestAnimationFrame():
+  var data = new Uint8Array(gModSound.mAudio.frequencySlices);
+  gModSound.mAudio.analyzer.getByteFrequencyData(data);
+  // ... do something with data ...
+
+  gModSound.mAudio.stream.stop();
 
@@ -206,6 +227,21 @@
+  window.addEventListener("devicelight", this.lightEvent, true);
+  window.addEventListener("deviceproximity", this.proxEvent, true);
+
+  lightEvent: function(lightData) {
+    lightData.value (in lux)
+  },
+  proxEvent: function(proxData) {
+    proxData.min <= .value <= .max (in cm)
+  },
+
+  window.removeEventListener("devicelight", this.lightEvent, true);
+  window.removeEventListener("deviceproximity", this.proxEvent, true);
+
+  // flash/torch code works via navigator.mozCameras.getCamera
+  // flaky and subject to change, please consult code on github
 
@@ -225,6 +261,26 @@
+  (navigator.battery.level * 100).toFixed(1) + "%";
+
+  if (navigator.battery.charging) {
+    if (navigator.battery.chargingTime == 0 ||
+        navigator.battery.chargingTime == Infinity) {
+      "charging";
+    }
+    else {
+      "charging, " + navigator.battery.chargingTime + "s remaining";
+    }
+  }
+  else {
+    if (navigator.battery.dischargingTime == 0 ||
+        navigator.battery.dischargingTime == Infinity) {
+      "discharging";
+    }
+    else {
+      navigator.battery.dischargingTime + "s usage remaining";
+    }
+  }
 
diff --git a/fosdem2015/tricorder-ui.svg b/fosdem2015/tricorder-ui.svg new file mode 100644 index 0000000..e9d0195 --- /dev/null +++ b/fosdem2015/tricorder-ui.svg @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + Stardate + Title + Full screen + Modules + + + + + + + + diff --git a/fosdem2015/tricorder_20150124_01.png b/fosdem2015/tricorder_20150124_01.png new file mode 100644 index 0000000..04cef2d Binary files /dev/null and b/fosdem2015/tricorder_20150124_01.png differ