Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ <h2 id="z"></h2>

// so now we have the characteristic and we can keep reading data...
function readZ() {
char.readValue().then(buffer => {
var data = new DataView(buffer);
char.readValue().then(data => {
// In Chrome 50+, a DataView is returned instead of an ArrayBuffer.
data = data.buffer ? data : new DataView(data);

var z = data.getUint8(5) << 8 | data.getUint8(4);
if (z > 32767) { // overflow
Expand Down