Bom dia,
Eu tenho uma aplicação em Cordova. Eu quero conectá-la ao arduino através do bluetooth. Não consigo receber o valor que vem do arduino
var macAddress = "00:06:66:4D:00:00";
var app = {
initialize: function () {
this.bindEvents();
},
bindEvents: function () {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function () {
bluetoothSerial.connect(macAddress, app.onConnect, app.onDisconnect);
},
onConnect: function () {
statusDiv.innerHTML = "Connected to " + macAddress + ".";
bluetoothSerial.subscribe("\n", app.onMessage, app.subscribeFailed);
bluetoothSerial.read(function (data) { console.log(data, 'read'); }, app.subscribeFailed);
},
onDisconnect: function () {
alert("Disconnected");
statusDiv.innerHTML = "Disconnected.";
},
onMessage: function (data) {
console.log(data, 'onMessage');
counter.innerHTML = data;
},
subscribeFailed: function () {
alert("subscribe failed");
}
};
A consola dá-me isto:
The key "target-densitydpi" is not supported. (index):65
adding proxy for Battery (index):65
adding proxy for Camera (index):65
adding proxy for File (index):65
adding proxy for Capture (index):65
adding proxy for Device (index):65
adding proxy for Accelerometer (index):65
adding proxy for Compass (index):65
adding proxy for Globalization (index):65
adding proxy for InAppBrowser (index):65
adding proxy for NetworkStatus (index):65
adding proxy for SplashScreen (index):65
Persistent fs quota granted (index):65
Error: exec proxy not found for :: StatusBar :: _ready (index):65
bluetoothSerial.connect: 00:06:66:4D:00:00 (index):65
bluetoothSerial.subscribe ' ' (index):65
bluetoothSerial.read: (index):65 read
Eu penso que eu estou conectada com o bluetooth mas não consigo obter os dados que vem do arduino. Na consola eu noteu esta linha:
Error: exec proxy not found for :: StatusBar :: _ready (index):65
Pode ser este o problema? Se sim, como o posso resolver? (estou a trabalhar em windows 10);
Obrigada.