espruinoctrl updates for Bangle.js 2
Disable not existing BTN3 on Bangle.js 2, set maximum transmit powermaster
parent
705a5d7a1b
commit
fec1432280
|
|
@ -1 +1,2 @@
|
|||
0.01: New App!
|
||||
0.02: Disable not existing BTN3 on Bangle.js 2, set maximum transmit power
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ function cmd(cmd,mac,rx) {
|
|||
if (mac) {
|
||||
E.showMessage("Connecting\\n"+mac);
|
||||
if (mac.length==17) mac+=" random";
|
||||
NRF.setTxPower(process.env.HWVERSION == 2 ? 8 : 4);
|
||||
NRF.connect(mac).then(dev=>send(dev,cmd,onDone)).catch(err);
|
||||
} else {
|
||||
E.showMessage("Scanning...");
|
||||
|
|
@ -193,14 +194,16 @@ function sendCommandRX(device, text, callback) {
|
|||
function done() {
|
||||
Terminal.println("\\n============\\n Disconnected");
|
||||
device.disconnect();
|
||||
setTimeout(function() {
|
||||
setWatch(function() {
|
||||
if (callback) callback();
|
||||
resolve();
|
||||
}, BTN3);
|
||||
g.reset().setFont("6x8",2).setFontAlign(0,0,1);
|
||||
g.drawString("Back", g.getWidth()-10, g.getHeight()-50);
|
||||
}, 200);
|
||||
if (global.BTN3 !== undefined) {
|
||||
setTimeout(function() {
|
||||
setWatch(function() {
|
||||
if (callback) callback();
|
||||
resolve();
|
||||
}, BTN3);
|
||||
g.reset().setFont("6x8",2).setFontAlign(0,0,1);
|
||||
g.drawString("Back", g.getWidth()-10, g.getHeight()-50);
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
device.getPrimaryService("6e400001-b5a3-f393-e0a9-e50e24dcca9e").then(function(s) {
|
||||
service = s;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"id": "espruinoctrl",
|
||||
"name": "Espruino Control",
|
||||
"shortName": "Espruino Ctrl",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"description": "Send commands to other Espruino devices via the Bluetooth UART interface. Customisable commands!",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,bluetooth",
|
||||
|
|
|
|||
Loading…
Reference in New Issue