I have been able to establish a Bluetooth connection with the device. Found a service and characteristics UUID in an Arduino forum.
However, how I should read the data now (with what code), I'm stumped. Had tried it with the combination of the module suggested by you and about the known to me BLE connection setup in the WEB IDE.
var gatt,characteristic;
NRF.requestDevice({ filters: [{ adress: 'c4:64:e3:e8:d6:e9' }] }).then(function(device) {
console.log("Found");
return device.gatt.connect();
}).then(function(g) {
console.log("Connected");
gatt = g;
return gatt.getPrimaryService(
"039afff0-2c94-11e3-9e06-0002a5d5c51b");
}).then(function(service) {
return service.getCharacteristic(
"039afff8-2c94-11e3-9e06-0002a5d5c51b");
}).then(function (c) {
console.log("Got Characteristic");
characteristic = c;
startReading();
});
function startReading() {
var busy = false;
var i = setInterval(function() {
if (!gatt.connected) {
clearInterval(i);
return;
}
if (busy) return;
busy = true;
function processBrainData(data) {
console.log(data.field, data.value);
} brain.on('data', processBrainData);
}, 50);
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi Gordon,
thanks for your answer.
I have been able to establish a Bluetooth connection with the device. Found a service and characteristics UUID in an Arduino forum.
However, how I should read the data now (with what code), I'm stumped. Had tried it with the combination of the module suggested by you and about the known to me BLE connection setup in the WEB IDE.