mirror of https://github.com/espruino/BangleApps
On Gadgetbridge, ensure the default data handler is set rather than built into bangleRx.
This means that when comms.js does its hacky thing to replace the data handler it doesn't end up duplicating handlers. Fixes #3151pull/3152/head
parent
31bf63aeb5
commit
932d2c0d9d
|
@ -248,12 +248,14 @@ if (typeof Android!=="undefined") {
|
|||
hadData : false,
|
||||
handlers : []
|
||||
}
|
||||
connection.on("data", function(d) {
|
||||
connection.received += d;
|
||||
connection.hadData = true;
|
||||
if (connection.cb) connection.cb(d);
|
||||
});
|
||||
|
||||
function bangleRx(data) {
|
||||
// document.getElementById("status").innerText = "RX:"+data;
|
||||
connection.received += data;
|
||||
connection.hadData = true;
|
||||
if (connection.cb) connection.cb(data);
|
||||
// call data event
|
||||
if (connection.handlers["data"])
|
||||
connection.handlers["data"](data);
|
||||
|
|
Loading…
Reference in New Issue