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.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) {
|
if (mac) {
|
||||||
E.showMessage("Connecting\\n"+mac);
|
E.showMessage("Connecting\\n"+mac);
|
||||||
if (mac.length==17) mac+=" random";
|
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);
|
NRF.connect(mac).then(dev=>send(dev,cmd,onDone)).catch(err);
|
||||||
} else {
|
} else {
|
||||||
E.showMessage("Scanning...");
|
E.showMessage("Scanning...");
|
||||||
|
|
@ -193,14 +194,16 @@ function sendCommandRX(device, text, callback) {
|
||||||
function done() {
|
function done() {
|
||||||
Terminal.println("\\n============\\n Disconnected");
|
Terminal.println("\\n============\\n Disconnected");
|
||||||
device.disconnect();
|
device.disconnect();
|
||||||
setTimeout(function() {
|
if (global.BTN3 !== undefined) {
|
||||||
setWatch(function() {
|
setTimeout(function() {
|
||||||
if (callback) callback();
|
setWatch(function() {
|
||||||
resolve();
|
if (callback) callback();
|
||||||
}, BTN3);
|
resolve();
|
||||||
g.reset().setFont("6x8",2).setFontAlign(0,0,1);
|
}, BTN3);
|
||||||
g.drawString("Back", g.getWidth()-10, g.getHeight()-50);
|
g.reset().setFont("6x8",2).setFontAlign(0,0,1);
|
||||||
}, 200);
|
g.drawString("Back", g.getWidth()-10, g.getHeight()-50);
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
device.getPrimaryService("6e400001-b5a3-f393-e0a9-e50e24dcca9e").then(function(s) {
|
device.getPrimaryService("6e400001-b5a3-f393-e0a9-e50e24dcca9e").then(function(s) {
|
||||||
service = s;
|
service = s;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "espruinoctrl",
|
"id": "espruinoctrl",
|
||||||
"name": "Espruino Control",
|
"name": "Espruino Control",
|
||||||
"shortName": "Espruino Ctrl",
|
"shortName": "Espruino Ctrl",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"description": "Send commands to other Espruino devices via the Bluetooth UART interface. Customisable commands!",
|
"description": "Send commands to other Espruino devices via the Bluetooth UART interface. Customisable commands!",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,bluetooth",
|
"tags": "tool,bluetooth",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue