Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 872672d

Browse files
authored
Merge pull request #95 from smalruby/fix/microbit-more-gatt-error
fix: catch GATT server disconnected error in MicrobitMore
2 parents 7a2b8e4 + 6c306ec commit 872672d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/extensions/microbitMore/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,12 @@ class MbitMore {
858858
this.soundLevel = dataView.getUint8(6);
859859
this.resetConnectionTimeout();
860860
resolve(this);
861+
})
862+
.catch(err => {
863+
window.clearTimeout(this.bleBusyTimeoutID);
864+
this.bleBusy = false;
865+
log.error(err);
866+
resolve(this);
861867
});
862868
});
863869
}
@@ -999,6 +1005,12 @@ class MbitMore {
9991005
this.magneticForce.z = dataView.getInt16(16, true);
10001006
this.resetConnectionTimeout();
10011007
resolve(this);
1008+
})
1009+
.catch(err => {
1010+
window.clearTimeout(this.bleBusyTimeoutID);
1011+
this.bleBusy = false;
1012+
log.error(err);
1013+
resolve(this);
10021014
});
10031015
});
10041016
}

0 commit comments

Comments
 (0)