I'm working on an app for communicatring with the RFDuino.
The app sends 1-character commands to the RFDuino and vice versa. This is working good.
However, I need to be able to send a character string from Evothings to the RFduino. I have tried to send numbers as an array
(with this code:
Code: Select all
app.device && app.device.writeDataArray(new Uint8Array([1],[2],[3]));
and that only gives me the first number (data[0]) on the RFduino side. data[1] and data[2] shows me nothing.
Also, the other way around, i can only read the first byte coming from the RFduino. I think this is due to the fact that I'm only reading the first byte here:
Code: Select all
app.device.enableNotification(
'00002221-0000-1000-8000-00805f9b34fb',
function(data)
{
var dataArray = new Uint8Array(data);
app.rfdstatus(dataArray[0]);
},
Code: Select all
if rfdstatus(dataArray[0]) = SomeThing, then read the rest and put it in a variable.