From c449a258f1de107f2f80ec36ec14947b07f222bf Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 24 Jun 2020 09:55:28 +0100 Subject: [PATCH] Added Espruino control (fix #417) --- apps.json | 14 ++ apps/espruinoctrl/ChangeLog | 1 + apps/espruinoctrl/README.md | 28 ++++ apps/espruinoctrl/app-icon.js | 1 + apps/espruinoctrl/app.png | Bin 0 -> 1302 bytes apps/espruinoctrl/custom.html | 275 ++++++++++++++++++++++++++++++++++ 6 files changed, 319 insertions(+) create mode 100644 apps/espruinoctrl/ChangeLog create mode 100644 apps/espruinoctrl/README.md create mode 100644 apps/espruinoctrl/app-icon.js create mode 100644 apps/espruinoctrl/app.png create mode 100644 apps/espruinoctrl/custom.html diff --git a/apps.json b/apps.json index 14feabe80..eb9b7b6a3 100644 --- a/apps.json +++ b/apps.json @@ -1987,5 +1987,19 @@ "storage": [ {"name":"gpsautotime.wid.js","url":"widget.js"} ] + }, + { "id": "espruinoctrl", + "name": "Espruino Control", + "shortName":"Espruino Ctrl", + "icon": "app.png", + "version":"0.01", + "description": "Send commands to other Espruino devices via the Bluetooth UART interface. Customisable commands!", + "tags": "", + "readme": "README.md", + "custom": "custom.html", + "storage": [ + {"name":"espruinoctrl.app.js"}, + {"name":"espruinoctrl.img","url":"app-icon.js","evaluate":true} + ] } ] diff --git a/apps/espruinoctrl/ChangeLog b/apps/espruinoctrl/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/espruinoctrl/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/espruinoctrl/README.md b/apps/espruinoctrl/README.md new file mode 100644 index 000000000..a7bca662c --- /dev/null +++ b/apps/espruinoctrl/README.md @@ -0,0 +1,28 @@ +# Espruino Control + +Send commands to other Espruino devices via the Bluetooth UART interface. + +## Customising + +Click the customise button and you can customise your commands +with 4 options: + + +* **Title** - The title of the menu item that will be displayed +* **Command** - The JS command to execute, eg. `LED.toggle()` +* **MAC Address** - If specified, of the form `aa:bb:cc:dd:ee:ff`. The device +with this address will be connected to directly. If not specified a menu +showing available Espruino devices is popped up. +* **RX** - If checked, the app will display any data received from the +device being connected to. Use this if you want to print data - eg: `print(E.getBattery())` + +When done, click 'Upload'. Your changes will be saved to local storage +so they'll be remembered next time you upload from the same device.s + +## Usage + +Simply load the app and you'll see a menu with the menu items +you defined. Select one and you'll be able to connect to the device +and send the command. + +If a command should wait for a response then diff --git a/apps/espruinoctrl/app-icon.js b/apps/espruinoctrl/app-icon.js new file mode 100644 index 000000000..70d2dd062 --- /dev/null +++ b/apps/espruinoctrl/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwhH+AH4A/AH4A/AH4AFwIuuAAIllAAYIGF041IF34AKqwuuAANXF9QuCAANdGHqQgGBwvdGCIud5mjGB4udAAIwPFz3MSR61VFxQwNci4vGeh4uXGAguHGBK3WGA4AIegtXc69dGBxoBGAouWO4IwNe4gwZa4YwLFwikEFzAwLFwwwCFzQwKFw68YGB4AdF5AwmF5IwlF5QwkF5Yw/F8IwEL9WBB4IuuADwuzGxAugFAgliGBYutAH4A/AH4A/ADA=")) diff --git a/apps/espruinoctrl/app.png b/apps/espruinoctrl/app.png new file mode 100644 index 0000000000000000000000000000000000000000..900861e43729a5385ffe8352888915c2d4653c50 GIT binary patch literal 1302 zcmV+x1?l>UP)?ZmN^iIB{MNu%(l4E0-}r2scX4p zZrw1(#6MHOm~3N<^2fPpB5Z!d9|jg#m#vI$ktK7+tYJWmOVlMQo7Rn@K(&-XbOZWz zk3XQ@rK7#~;ss3X^N;f$&ig#?Ip@BoFOWnMNhGn9U`tIP9-3_q9)vC9%XK>&%gaOY z{Qi>yX2>50pk=_RvE{lK;)&2MCb1)SyIu%rod8zfu}C;nx5K>Wu+6cR2yGE=1XSq; z$NT`SbH!XV0Zpx^vxESBfw{;70K@L4V-5omo{r%a7C4-X7k42`hyfq~IB2)ulO9a@ z3Pg`8j1eY=n)>Z#TcS-=M`L3n_v4LV3j?`I*KYhkz~q+zTctTIPPKDAq#BiqGYI#%2kDC|EL>uR?`e=qc0AO@{e6y?H zeL-m)Mld(GISxwssV+bWQyYN4#kN03d=hXuHC43@pO|a+8O8Rw$b(SD%KV-28{1c!AQOE=RH>=}p64}`x2gq%S2&_` z=GPj^Z?A@HMCAP-JkQGfosm^VUngSUhqx3|{SJ#qO#w_;R@@4Poil%DazJM^6UM;X z01jjN+-sZ-umAm4zERUv*RP**NUwOky84D(Qi@8bbnS*u^*K2mG3HDTI2#ecHU@r* z_y2S;Z4(G*N^*x%8#Z(x_MY&KjX&FcspnNCoMa1VYCWALVCwusMTM4SdVOr;MMX%F z2apZ`2L14WK|j0=z^z$+gkmU|l4S|_*mhROrOj9vsaHUC!h**eKQ!MMw)^ z*rPOPQQ=Bco<28rRL0dR#PBMxPngM%+`4 zLp}_!gin18_(2;+Wz0ytAmo7r0+@j3Fq?dcF<9%YTec=>?4Py4(387r%%iHZOn|s0 zWVhQj!vXD4Oux%Zz7j7L681o&)2Y=BjvXaNol>vFNhFa(68}&91AovF7oUbDTL1t6 M07*qoM6N<$g0ps59{>OV literal 0 HcmV?d00001 diff --git a/apps/espruinoctrl/custom.html b/apps/espruinoctrl/custom.html new file mode 100644 index 000000000..e6297cf2e --- /dev/null +++ b/apps/espruinoctrl/custom.html @@ -0,0 +1,275 @@ + + + + + + + + +

Enter the menu items you'd like to see appear in the app below. MAC Address is the MAC address + of the device to use. If it isn't specified then a menu will be presented showing available devices.

+
+ + + + + + + + + + + + +
TitleCommandMAC AddressRX
+
+

+ + + + + +