1function handleData(event) {
2var buf = event.target.value.buffer;
3if (buf.byteLength >= 20 ) {
4// reading characteristic FFB1:
5var str = String.fromCharCode.apply(null, new Uint8Array(buf));
6console.log('I got ' + str);
7} else {
8// reading characteristic FFB2:
9console.log(new Uint8Array(buf));
10}
11}
12