Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update Bluetooth samples.

The Bluetooth API has moved to dev channel.  Update the samples
accordingly.
  • Loading branch information...
commit a67052bb60d12dc231d6b2eeb51ac556652f9d4f 1 parent 7cf72d7
Bryan Yeung authored
View
4 ioio/README.md
@@ -5,9 +5,9 @@ Very simple IOIO client. Tested with [this hardware](http://www.adafruit.com/blo
The constants and information about the protocol was taken from https://github.com/ytai/ioio/wiki/
## Caveats:
-* The bluetooth API is only available on Chrom(e|ium)OS
+* The bluetooth API is only available on dev-channel Chrom(e|ium)OS
* Resource clean-up isn't happening properly yet: you will likely have to disable/enable bluetooth between runs of the program or the connection will fail
## APIs
-* [Bluetooth](http://developer.chrome.com/apps/experimental.bluetooth.html)
+* [Bluetooth](http://developer.chrome.com/apps/bluetooth.html)
View
8 ioio/main.js
@@ -24,7 +24,7 @@ function runAtInterval(socket) {
view[3] = pin << 2 | level;
level = (level == 0) ? 1 : 0;
- chrome.experimental.bluetooth.write({socketId:socket.id, data:buffer},
+ chrome.bluetooth.write({socketId:socket.id, data:buffer},
function(bytes) {
if (chrome.runtime.lastError) {
log('Write error: ' + chrome.runtime.lastError.message);
@@ -50,7 +50,7 @@ var connectCallback = function(socket) {
// https://github.com/ytai/ioio/wiki/
view[0] = 3;
view[1] = pin << 2 | 2;
- chrome.experimental.bluetooth.write({socketId:socket.id, data:buffer},
+ chrome.bluetooth.write({socketId:socket.id, data:buffer},
function(bytes) {
if (chrome.runtime.lastError) {
log('Write error: ' + chrome.runtime.lastError.message);
@@ -77,10 +77,10 @@ var connectToDevice = function(result) {
for (var i in result) {
var device = result[i];
log('Connecting to device: ' + device.name + ' @ ' + device.address);
- chrome.experimental.bluetooth.connect(
+ chrome.bluetooth.connect(
{deviceAddress: device.address, serviceUuid: kUUID}, connectCallback);
}
};
log('Starting IOIO demo...');
-chrome.experimental.bluetooth.getDevices({uuid: kUUID}, connectToDevice);
+chrome.bluetooth.getDevices({uuid: kUUID}, connectToDevice);
View
2  ioio/manifest.json
@@ -10,6 +10,6 @@
}
},
"permissions": [
- "experimental"
+ "bluetooth"
]
}
View
6 zephyr_hxm/README.md
@@ -1,14 +1,14 @@
# Zephyr heart rate monitor device
-Very simple Zephyr HXM heart rate monitor driver. This sample uses the experimental bluetooth API to fetch heart rate data from a Zephyr HXM device
+Very simple Zephyr HXM heart rate monitor driver. This sample uses the bluetooth API to fetch heart rate data from a Zephyr HXM device
## Caveats:
-- The bluetooth API is only available on Chrom(e|ium)OS
+- The bluetooth API is only available on dev-channel Chrom(e|ium)OS
- Resource clean-up isn't happening properly yet: you will likely have to disable/enable bluetooth between runs of the program or the connection will fail
## APIs
-* [Bluetooth](http://developer.chrome.com/apps/experimental.bluetooth.html)
+* [Bluetooth](http://developer.chrome.com/apps/bluetooth.html)
* [Sandboxed iframe](http://developer.chrome.com/apps/app_external.html#sandboxing)
View
8 zephyr_hxm/main.js
@@ -17,7 +17,7 @@ var kUUID = '00001101-0000-1000-8000-00805f9b34fb';
var readIntervalId;
var readInterval = function (socket) {
return function() {
- chrome.experimental.bluetooth.read({socketId:socket.id}, function(data) {
+ chrome.bluetooth.read({socketId:socket.id}, function(data) {
if (chrome.extension.lastError) {
log('Read error:');
log(chrome.extension.lastError);
@@ -102,7 +102,7 @@ var connectToDevice = function(result) {
var device = result[i];
if (device.name == 'HXM014782') {
log('Connecting to device: ' + device.name + ' @ ' + device.address);
- chrome.experimental.bluetooth.connect(
+ chrome.bluetooth.connect(
{deviceAddress: device.address, serviceUuid: kUUID}, connectCallback);
}
}
@@ -117,13 +117,13 @@ if (kSimulate) {
updateHeartRate(60 + Math.floor((Math.random()*10)+1));
}, 1000);
} else {
- chrome.experimental.bluetooth.getDevices({uuid: kUUID}, connectToDevice);
+ chrome.bluetooth.getDevices({uuid: kUUID}, connectToDevice);
}
document.getElementById('close').addEventListener('click',
function() {
if (!kSimulate) {
- chrome.experimental.bluetooth.disconnect({socketId:socketId_});
+ chrome.bluetooth.disconnect({socketId:socketId_});
}
window.close();
});
View
2  zephyr_hxm/manifest.json
@@ -10,7 +10,7 @@
}
},
"permissions": [
- "experimental"
+ "bluetooth"
],
"sandbox": {
"pages": ["graph.html"]
Please sign in to comment.
Something went wrong with that request. Please try again.