espruinoctrl updates for Bangle.js 2

Disable not existing BTN3 on Bangle.js 2, set maximum transmit power
master
Erik Andresen 2023-01-13 22:50:05 +01:00
parent 705a5d7a1b
commit fec1432280
3 changed files with 13 additions and 9 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Disable not existing BTN3 on Bangle.js 2, set maximum transmit power

View File

@ -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;

View File

@ -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",